TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kprotocolinfotest.cpp 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (C) 2002 David Faure <faure@kde.org>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License version 2 as published by the Free Software Foundation;
  7. *
  8. * This library is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * Library General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Library General Public License
  14. * along with this library; see the file COPYING.LIB. If not, write to
  15. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. * Boston, MA 02110-1301, USA.
  17. */
  18. #include <kprotocolinfo.h>
  19. #include <tdeprotocolmanager.h>
  20. #include <tdeapplication.h>
  21. #include <tdeglobalsettings.h>
  22. #include <tdecmdlineargs.h>
  23. #include <tdeaboutdata.h>
  24. #include <kdebug.h>
  25. #include <assert.h>
  26. int main(int argc, char **argv) {
  27. TDEAboutData aboutData("kprotocolinfotest", "KProtocolinfo Test",
  28. "1.0");
  29. TDECmdLineArgs::init(argc, argv, &aboutData);
  30. TDEApplication app(/*styles=*/false, /*gui=*/false);
  31. KURL url;
  32. url.setPath("/tmp");
  33. assert( KProtocolInfo::supportsListing( KURL( "ftp://10.1.1.10") ) );
  34. assert( KProtocolInfo::inputType(url) == KProtocolInfo::T_NONE );
  35. assert( KProtocolInfo::outputType(url) == KProtocolInfo::T_FILESYSTEM );
  36. assert( KProtocolInfo::supportsReading(url) == true );
  37. KProtocolInfo::ExtraFieldList extraFields = KProtocolInfo::extraFields(url);
  38. KProtocolInfo::ExtraFieldList::Iterator extraFieldsIt = extraFields.begin();
  39. for ( ; extraFieldsIt != extraFields.end() ; ++extraFieldsIt )
  40. kdDebug() << (*extraFieldsIt).name << " " << (*extraFieldsIt).type << endl;
  41. assert( KProtocolInfo::showFilePreview( "file" ) == true );
  42. assert( KProtocolInfo::showFilePreview( "audiocd" ) == false );
  43. assert( TDEGlobalSettings::showFilePreview( "audiocd:/" ) == false );
  44. TQString proxy;
  45. TQString protocol = KProtocolManager::slaveProtocol( "http://bugs.trinitydesktop.org", proxy );
  46. assert( protocol == "http" );
  47. TQStringList capabilities = KProtocolInfo::capabilities( "imap" );
  48. kdDebug() << "tdeio_imap capabilities: " << capabilities << endl;
  49. //assert(capabilities.contains("ACL"));
  50. return 0;
  51. }