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.
60 lines
2.3 KiB
60 lines
2.3 KiB
15 years ago
|
/*
|
||
|
* Copyright (C) 2002 David Faure <faure@kde.org>
|
||
|
*
|
||
|
* This library is free software; you can redistribute it and/or
|
||
|
* modify it under the terms of the GNU Library General Public
|
||
|
* License version 2 as published by the Free Software Foundation;
|
||
|
*
|
||
|
* This library is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||
|
* Library General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Library General Public License
|
||
|
* along with this library; see the file COPYING.LIB. If not, write to
|
||
|
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
* Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#include <kprotocolinfo.h>
|
||
|
#include <kprotocolmanager.h>
|
||
|
#include <kapplication.h>
|
||
|
#include <kglobalsettings.h>
|
||
|
#include <kcmdlineargs.h>
|
||
|
#include <kaboutdata.h>
|
||
|
#include <kdebug.h>
|
||
|
#include <assert.h>
|
||
|
|
||
|
int main(int argc, char **argv) {
|
||
12 years ago
|
TDEAboutData aboutData("kprotocolinfotest", "KProtocolinfo Test",
|
||
15 years ago
|
"1.0");
|
||
|
|
||
12 years ago
|
TDECmdLineArgs::init(argc, argv, &aboutData);
|
||
12 years ago
|
TDEApplication app;
|
||
15 years ago
|
|
||
|
KURL url;
|
||
|
url.setPath("/tmp");
|
||
|
assert( KProtocolInfo::supportsListing( KURL( "ftp://10.1.1.10") ) );
|
||
|
assert( KProtocolInfo::inputType(url) == KProtocolInfo::T_NONE );
|
||
|
assert( KProtocolInfo::outputType(url) == KProtocolInfo::T_FILESYSTEM );
|
||
|
assert( KProtocolInfo::supportsReading(url) == true );
|
||
|
KProtocolInfo::ExtraFieldList extraFields = KProtocolInfo::extraFields(url);
|
||
|
KProtocolInfo::ExtraFieldList::Iterator extraFieldsIt = extraFields.begin();
|
||
|
for ( ; extraFieldsIt != extraFields.end() ; ++extraFieldsIt )
|
||
|
kdDebug() << (*extraFieldsIt).name << " " << (*extraFieldsIt).type << endl;
|
||
|
|
||
|
assert( KProtocolInfo::showFilePreview( "file" ) == true );
|
||
|
assert( KProtocolInfo::showFilePreview( "audiocd" ) == false );
|
||
12 years ago
|
assert( TDEGlobalSettings::showFilePreview( "audiocd:/" ) == false );
|
||
15 years ago
|
|
||
14 years ago
|
TQString proxy;
|
||
|
TQString protocol = KProtocolManager::slaveProtocol( "http://bugs.kde.org", proxy );
|
||
15 years ago
|
assert( protocol == "http" );
|
||
|
|
||
14 years ago
|
TQStringList capabilities = KProtocolInfo::capabilities( "imap" );
|
||
15 years ago
|
kdDebug() << "kio_imap capabilities: " << capabilities << endl;
|
||
14 years ago
|
//assert(capabilities.contains("ACL"));
|
||
15 years ago
|
|
||
|
return 0;
|
||
|
}
|