Commit 3e693bf8 authored by Stephan Kulow's avatar Stephan Kulow
Browse files

replaced several URLs with Url and URI with Uri - the patch

became a bit larger than expected, so I couldn't have the time
to check if it still compiles with the changes done in between

svn path=/trunk/KDE/kdebase/runtime/; revision=578269
parent d350f34c
......@@ -72,7 +72,7 @@ void FilterProtocol::get( const KUrl & )
error( KIO::ERR_INTERNAL, mProtocol );
return;
}
needSubURLData();
needSubUrlData();
filter->init(QIODevice::ReadOnly);
......
......@@ -925,7 +925,7 @@ void fishProtocol::manageConnection(const QString &l) {
// By default, the mimetype comes from the extension
// We'll use the file(1) result only as fallback [like the rest of KDE does]
{
KMimeType::Ptr mime = KMimeType::findByURL( KUrl("fish://host/" + thisFn) );
KMimeType::Ptr mime = KMimeType::findByUrl( KUrl("fish://host/" + thisFn) );
if ( mime->name() != KMimeType::defaultMimeType() )
udsMime = mime->name();
}
......
......@@ -63,7 +63,7 @@ HomeProtocol::~HomeProtocol()
{
}
bool HomeProtocol::rewriteURL(const KUrl &url, KUrl &newUrl)
bool HomeProtocol::rewriteUrl(const KUrl &url, KUrl &newUrl)
{
QString name, path;
......
......@@ -30,7 +30,7 @@ public:
const QByteArray &app);
virtual ~HomeProtocol();
virtual bool rewriteURL(const KUrl &url, KUrl &newUrl);
virtual bool rewriteUrl(const KUrl &url, KUrl &newUrl);
virtual void listDir(const KUrl &url);
virtual void stat(const KUrl &url);
......
......@@ -41,7 +41,7 @@ typedef KGenericFactory<KAutoWebSearch> KAutoWebSearchFactory;
K_EXPORT_COMPONENT_FACTORY (libkuriikwsfilter, KAutoWebSearchFactory("kcmkurifilt"))
KAutoWebSearch::KAutoWebSearch(QObject *parent, const QStringList&)
:KURIFilterPlugin( "KURIIKWSFilterIface", parent, 1.0)
:KUriFilterPlugin( "KURIIKWSFilterIface", parent, 1.0)
{
QDBusConnection::sessionBus().connect(QString(), QString(), "org.kde.KUriFilterPlugin",
"configure", this, SLOT(configure()));
......@@ -59,7 +59,7 @@ void KAutoWebSearch::configure()
KURISearchFilterEngine::self()->loadConfig();
}
bool KAutoWebSearch::filterURI( KURIFilterData &data ) const
bool KAutoWebSearch::filterUri( KUriFilterData &data ) const
{
if (KURISearchFilterEngine::self()->verbose())
kDebug() << "KAutoWebSearch::filterURI: '" << data.uri().url() << "'" << endl;
......@@ -73,8 +73,8 @@ bool KAutoWebSearch::filterURI( KURIFilterData &data ) const
if ( KURISearchFilterEngine::self()->verbose() )
kDebug () << "Filtered URL: " << result << endl;
setFilteredURI( data, KUrl( result ) );
setURIType( data, KURIFilterData::NET_PROTOCOL );
setFilteredUri( data, KUrl( result ) );
setUriType( data, KUriFilterData::NET_PROTOCOL );
return true;
}
}
......
......@@ -2,7 +2,7 @@
Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
Copyright (C) 2000 Yves Arrouye <yves@realnames.com>
Copyright (C) 2002, 2003 Dawit Alemayehu <adawit@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
......@@ -28,14 +28,14 @@
class KInstance;
class KAutoWebSearch : public KURIFilterPlugin
class KAutoWebSearch : public KUriFilterPlugin
{
Q_OBJECT
public:
KAutoWebSearch(QObject *parent = 0, const QStringList &args = QStringList() );
~KAutoWebSearch();
virtual bool filterURI( KURIFilterData& ) const;
virtual bool filterUri( KUriFilterData& ) const;
public Q_SLOTS:
void configure();
......
......@@ -37,33 +37,33 @@
* kdelibs/kio/tests/kurifiltertest
*/
typedef KGenericFactory<KURISearchFilter> KURISearchFilterFactory;
K_EXPORT_COMPONENT_FACTORY(libkurisearchfilter, KURISearchFilterFactory("kcmkurifilt"))
typedef KGenericFactory<KUriSearchFilter> KUriSearchFilterFactory;
K_EXPORT_COMPONENT_FACTORY(libkurisearchfilter, KUriSearchFilterFactory("kcmkurifilt"))
KURISearchFilter::KURISearchFilter(QObject *parent,
KUriSearchFilter::KUriSearchFilter(QObject *parent,
const QStringList &)
:KURIFilterPlugin( "KURISearchFilter", parent, 1.0)
:KUriFilterPlugin( "KUriSearchFilter", parent, 1.0)
{
QDBusConnection::sessionBus().connect(QString(), QString(), "org.kde.KUriFilterPlugin",
"configure", this, SLOT(configure()));
}
KURISearchFilter::~KURISearchFilter()
KUriSearchFilter::~KUriSearchFilter()
{
}
void KURISearchFilter::configure()
void KUriSearchFilter::configure()
{
if ( KURISearchFilterEngine::self()->verbose() )
kDebug() << "KURISearchFilter::configure: Config reload request..." << endl;
kDebug() << "KUriSearchFilter::configure: Config reload request..." << endl;
KURISearchFilterEngine::self()->loadConfig();
}
bool KURISearchFilter::filterURI( KURIFilterData &data ) const
bool KUriSearchFilter::filterUri( KUriFilterData &data ) const
{
if ( KURISearchFilterEngine::self()->verbose() )
kDebug() << "KURISearchFilter::filterURI: '" << data.typedString() << "'" << endl;
kDebug() << "KUriSearchFilter::filterUri: '" << data.typedString() << "'" << endl;
QString result = KURISearchFilterEngine::self()->webShortcutQuery( data.typedString() );
......@@ -72,20 +72,20 @@ bool KURISearchFilter::filterURI( KURIFilterData &data ) const
if ( KURISearchFilterEngine::self()->verbose() )
kDebug() << "Filtered URL: " << result << endl;
setFilteredURI( data, KUrl( result ) );
setURIType( data, KURIFilterData::NET_PROTOCOL );
setFilteredUri( data, KUrl( result ) );
setUriType( data, KUriFilterData::NET_PROTOCOL );
return true;
}
return false;
}
KCModule *KURISearchFilter::configModule(QWidget *parent, const char *) const
KCModule *KUriSearchFilter::configModule(QWidget *parent, const char *) const
{
return new FilterOptions( KURISearchFilterFactory::instance(), parent);
return new FilterOptions( KUriSearchFilterFactory::instance(), parent);
}
QString KURISearchFilter::configName() const
QString KUriSearchFilter::configName() const
{
return i18n("Search F&ilters");
}
......
/* This file is part of the KDE project
Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
Copyright (C) 2000 Yves Arrouye <yves@realnames.com>
Copyright (C) 2002, 2003 Dawit Alemayehu <adawit@kde.org>
Copyright (C) 2002, 2003 Dawit Alemayehu <adawit@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -28,19 +28,19 @@
class KInstance;
class KURISearchFilter : public KURIFilterPlugin
class KUriSearchFilter : public KUriFilterPlugin
{
Q_OBJECT
public:
KURISearchFilter(QObject *parent = 0, const QStringList &args = QStringList() );
~KURISearchFilter();
KUriSearchFilter(QObject *parent = 0, const QStringList &args = QStringList() );
~KUriSearchFilter();
virtual bool filterURI( KURIFilterData& ) const;
virtual bool filterUri( KUriFilterData& ) const;
virtual KCModule *configModule(QWidget *parent = 0, const char *name = 0) const;
virtual QString configName() const;
public Q_SLOTS:
void configure(); // maybe move to KURIFilterPlugin?
void configure(); // maybe move to KUriFilterPlugin?
};
#endif
......
......@@ -38,8 +38,8 @@
* kdelibs/kio/tests/kurifiltertest
*/
LocalDomainURIFilter::LocalDomainURIFilter( QObject *parent, const QStringList & /*args*/ )
: KURIFilterPlugin( "localdomainurifilter", parent, 1.0 ),
LocalDomainUriFilter::LocalDomainUriFilter( QObject *parent, const QStringList & /*args*/ )
: KUriFilterPlugin( "localdomainurifilter", parent, 1.0 ),
last_time( 0 ),
m_hostPortPattern( QLatin1String(HOSTPORT_PATTERN) )
{
......@@ -48,21 +48,21 @@ LocalDomainURIFilter::LocalDomainURIFilter( QObject *parent, const QStringList &
configure();
}
bool LocalDomainURIFilter::filterURI( KURIFilterData& data ) const
bool LocalDomainUriFilter::filterUri( KUriFilterData& data ) const
{
KUrl url = data.uri();
QString cmd = url.url();
kDebug() << "LocalDomainURIFilter::filterURI: " << url << endl;
kDebug() << "LocalDomainUriFilter::filterUri: " << url << endl;
if( m_hostPortPattern.exactMatch( cmd ) &&
isLocalDomainHost( cmd ) )
{
cmd.prepend( QLatin1String("http://") );
setFilteredURI( data, KUrl( cmd ) );
setURIType( data, KURIFilterData::NET_PROTOCOL );
setFilteredUri( data, KUrl( cmd ) );
setUriType( data, KUriFilterData::NET_PROTOCOL );
kDebug() << "FilteredURI: " << data.uri() << endl;
kDebug() << "FilteredUri: " << data.uri() << endl;
return true;
}
......@@ -70,7 +70,7 @@ bool LocalDomainURIFilter::filterURI( KURIFilterData& data ) const
}
// if it's e.g. just 'www', try if it's a hostname in the local search domain
bool LocalDomainURIFilter::isLocalDomainHost( QString& cmd ) const
bool LocalDomainUriFilter::isLocalDomainHost( QString& cmd ) const
{
// find() returns -1 when no match -> left()/truncate() are noops then
QString host( cmd.left( cmd.indexOf( '/' ) ) );
......@@ -103,17 +103,17 @@ bool LocalDomainURIFilter::isLocalDomainHost( QString& cmd ) const
return last_result;
}
void LocalDomainURIFilter::receiveOutput( KProcess *, char *buf, int )
void LocalDomainUriFilter::receiveOutput( KProcess *, char *buf, int )
{
m_fullname = QFile::decodeName( buf );
}
void LocalDomainURIFilter::configure()
void LocalDomainUriFilter::configure()
{
// nothing
}
K_EXPORT_COMPONENT_FACTORY( liblocaldomainurifilter,
KGenericFactory<LocalDomainURIFilter>( "kcmkurifilt" ) )
KGenericFactory<LocalDomainUriFilter>( "kcmkurifilt" ) )
#include "localdomainurifilter.moc"
......@@ -37,13 +37,13 @@ class KProcess;
intranet.domain.org and if yes, it's a network URI.
*/
class LocalDomainURIFilter : public KURIFilterPlugin
class LocalDomainUriFilter : public KUriFilterPlugin
{
Q_OBJECT
public:
LocalDomainURIFilter( QObject* parent, const QStringList& args );
virtual bool filterURI( KURIFilterData &data ) const;
LocalDomainUriFilter( QObject* parent, const QStringList& args );
virtual bool filterUri( KUriFilterData &data ) const;
public Q_SLOTS:
void configure();
......
......@@ -134,15 +134,15 @@ static QString removeArgs( const QString& _cmd )
return cmd;
}
KShortURIFilter::KShortURIFilter( QObject *parent, const QStringList & /*args*/ )
:KURIFilterPlugin( "kshorturifilter", parent, 1.0)
KShortUriFilter::KShortUriFilter( QObject *parent, const QStringList & /*args*/ )
:KUriFilterPlugin( "kshorturifilter", parent, 1.0)
{
QDBusConnection::sessionBus().connect(QString(), QString(), "org.kde.KUriFilterPlugin",
"configure", this, SLOT(configure()));
configure();
}
bool KShortURIFilter::filterURI( KURIFilterData& data ) const
bool KShortUriFilter::filterUri( KUriFilterData& data ) const
{
/*
* Here is a description of how the shortURI deals with the supplied
......@@ -172,8 +172,8 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
{
// Handle "encrypted" URLs like: h++p://www.kde.org
url.setProtocol( QLatin1String("http"));
setFilteredURI( data, url);
setURIType( data, KURIFilterData::NET_PROTOCOL );
setFilteredUri( data, url);
setUriType( data, KUriFilterData::NET_PROTOCOL );
return true;
}
......@@ -185,8 +185,8 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
const QString starthere_proto = QFL1("start-here:");
if (cmd.indexOf(starthere_proto) == 0 )
{
setFilteredURI( data, KUrl("system:/") );
setURIType( data, KURIFilterData::LOCAL_DIR );
setFilteredUri( data, KUrl("system:/") );
setUriType( data, KUriFilterData::LOCAL_DIR );
return true;
}
......@@ -205,8 +205,8 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
else if ((cmd==info_proto) || (cmd==man_proto))
cmd+='/';
setFilteredURI( data, KUrl( cmd ));
setURIType( data, KURIFilterData::HELP );
setFilteredUri( data, KUrl( cmd ));
setUriType( data, KUriFilterData::HELP );
return true;
}
......@@ -216,8 +216,8 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
// make sure path is unix style
cmd.replace('\\', '/');
cmd.prepend( QLatin1String( "smb:" ) );
setFilteredURI( data, KUrl( cmd ));
setURIType( data, KURIFilterData::NET_PROTOCOL );
setFilteredUri( data, KUrl( cmd ));
setUriType( data, KUriFilterData::NET_PROTOCOL );
return true;
}
......@@ -277,7 +277,7 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
QString msg = dir ? i18n("<qt><b>%1</b> does not have a home folder.</qt>", user) :
i18n("<qt>There is no user called <b>%1</b>.</qt>", user);
setErrorMsg( data, msg );
setURIType( data, KURIFilterData::ERROR );
setUriType( data, KUriFilterData::ERROR );
// Always return true for error conditions so
// that other filters will not be invoked !!
return true;
......@@ -385,12 +385,12 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
u.setRef(ref);
u.setQuery(query);
if (!KAuthorized::authorizeURLAction( QLatin1String("open"), KUrl(), u))
if (!KAuthorized::authorizeUrlAction( QLatin1String("open"), KUrl(), u))
{
// No authorisation, we pretend it's a file will get
// an access denied error later on.
setFilteredURI( data, u );
setURIType( data, KURIFilterData::LOCAL_FILE );
setFilteredUri( data, u );
setUriType( data, KUriFilterData::LOCAL_FILE );
return true;
}
......@@ -399,8 +399,8 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
if( !isDir && access ( QFile::encodeName(path).data(), X_OK) == 0 )
{
//kDebug() << "Abs path to EXECUTABLE" << endl;
setFilteredURI( data, u );
setURIType( data, KURIFilterData::EXECUTABLE );
setFilteredUri( data, u );
setUriType( data, KUriFilterData::EXECUTABLE );
return true;
}
......@@ -410,8 +410,8 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
//kDebug() << "Abs path as local file or directory" << endl;
if ( !nameFilter.isEmpty() )
u.setFileName( nameFilter );
setFilteredURI( data, u );
setURIType( data, ( isDir ) ? KURIFilterData::LOCAL_DIR : KURIFilterData::LOCAL_FILE );
setFilteredUri( data, u );
setUriType( data, ( isDir ) ? KUriFilterData::LOCAL_DIR : KUriFilterData::LOCAL_FILE );
return true;
}
......@@ -428,11 +428,11 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
if( data.checkForExecutables() && !KStandardDirs::findExe( exe ).isNull() )
{
//kDebug() << "EXECUTABLE exe=" << exe << endl;
setFilteredURI( data, KUrl::fromPath( exe ));
setFilteredUri( data, KUrl::fromPath( exe ));
// check if we have command line arguments
if( exe != cmd )
setArguments(data, cmd.right(cmd.length() - exe.length()));
setURIType( data, KURIFilterData::EXECUTABLE );
setUriType( data, KUriFilterData::EXECUTABLE );
return true;
}
......@@ -444,11 +444,11 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
//kDebug() << "looking for protocol " << protocol << endl;
if ( KProtocolInfo::protocols().contains( protocol ) )
{
setFilteredURI( data, url );
setFilteredUri( data, url );
if ( protocol == QFL1("man") || protocol == QFL1("help") )
setURIType( data, KURIFilterData::HELP );
setUriType( data, KUriFilterData::HELP );
else
setURIType( data, KURIFilterData::NET_PROTOCOL );
setUriType( data, KUriFilterData::NET_PROTOCOL );
return true;
}
}
......@@ -466,8 +466,8 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
{
//kDebug() << "match - prepending " << (*it).prepend << endl;
cmd.prepend( (*it).prepend );
setFilteredURI( data, KUrl( cmd ) );
setURIType( data, (*it).type );
setFilteredUri( data, KUrl( cmd ) );
setUriType( data, (*it).type );
return true;
}
}
......@@ -481,8 +481,8 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
<< m_strDefaultProtocol << endl;
cmd.insert( 0, m_strDefaultProtocol );
setFilteredURI( data, KUrl( cmd ));
setURIType( data, KURIFilterData::NET_PROTOCOL );
setFilteredUri( data, KUrl( cmd ));
setUriType( data, KUriFilterData::NET_PROTOCOL );
return true;
}
}
......@@ -495,17 +495,17 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
u.setPath(path);
u.setRef(ref);
if (!KAuthorized::authorizeURLAction( QLatin1String("open"), KUrl(), u))
if (!KAuthorized::authorizeUrlAction( QLatin1String("open"), KUrl(), u))
{
// No authorisation, we pretend it exists and will get
// an access denied error later on.
setFilteredURI( data, u );
setURIType( data, KURIFilterData::LOCAL_FILE );
setFilteredUri( data, u );
setUriType( data, KUriFilterData::LOCAL_FILE );
return true;
}
//kDebug() << "fileNotFound -> ERROR" << endl;
setErrorMsg( data, i18n( "<qt>The file or folder <b>%1</b> does not exist.", data.uri().prettyUrl() ) );
setURIType( data, KURIFilterData::ERROR );
setUriType( data, KUriFilterData::ERROR );
return true;
}
......@@ -514,23 +514,23 @@ bool KShortURIFilter::filterURI( KURIFilterData& data ) const
return false;
}
KCModule* KShortURIFilter::configModule( QWidget*, const char* ) const
KCModule* KShortUriFilter::configModule( QWidget*, const char* ) const
{
return 0; //new KShortURIOptions( parent, name );
return 0; //new KShortUriOptions( parent, name );
}
QString KShortURIFilter::configName() const
QString KShortUriFilter::configName() const
{
return i18n("&ShortURLs");
}
void KShortURIFilter::configure()
void KShortUriFilter::configure()
{
KConfig config( name() + QFL1("rc"), false, false );
m_bVerbose = config.readEntry( "Verbose", false );
if ( m_bVerbose )
kDebug() << "KShortURIFilter::configure: Config reload request..." << endl;
kDebug() << "KShortUriFilter::configure: Config reload request..." << endl;
m_strDefaultProtocol = config.readEntry( "DefaultProtocol", QString("http://") );
EntryMap patterns = config.entryMap( QFL1("Pattern") );
......@@ -543,8 +543,8 @@ void KShortURIFilter::configure()
if (!protocol.isEmpty())
{
int type = config.readEntry(it.key(), -1);
if (type > -1 && type <= KURIFilterData::UNKNOWN)
m_urlHints.append( URLHint(it.value(), protocol, static_cast<KURIFilterData::URITypes>(type) ) );
if (type > -1 && type <= KUriFilterData::UNKNOWN)
m_urlHints.append( URLHint(it.value(), protocol, static_cast<KUriFilterData::UriTypes>(type) ) );
else
m_urlHints.append( URLHint(it.value(), protocol) );
}
......@@ -552,6 +552,6 @@ void KShortURIFilter::configure()
}
K_EXPORT_COMPONENT_FACTORY( libkshorturifilter,
KGenericFactory<KShortURIFilter>( "kcmkurifilt" ) )
KGenericFactory<KShortUriFilter>( "kcmkurifilt" ) )
#include "kshorturifilter.moc"
......@@ -38,7 +38,7 @@ class KInstance;
* @author Dawit Alemayehu <adawit@kde.org>
* @author Malte Starostik <starosti@zedat.fu-berlin.de>
*/
class KShortURIFilter : public KURIFilterPlugin
class KShortUriFilter : public KUriFilterPlugin
{
Q_OBJECT
public:
......@@ -49,12 +49,12 @@ public:
* @param parent the parent of this class.
* @param name the internal name for this object.
*/
KShortURIFilter( QObject *parent = 0, const QStringList &args = QStringList() );
KShortUriFilter( QObject *parent = 0, const QStringList &args = QStringList() );
/**
* Destructor
*/
virtual ~KShortURIFilter() {};
virtual ~KShortUriFilter() {};
/**
* Converts short URIs into fully qualified valid URIs
......@@ -67,7 +67,7 @@ public:
* @param data the data to be filtered
* @return true if the url has been filtered
*/
virtual bool filterURI( KURIFilterData &data ) const;
virtual bool filterUri( KUriFilterData &data ) const;
/**
* Returns the name of the config module for
......@@ -93,12 +93,12 @@ private:
struct URLHint
{
URLHint() {}
URLHint( QString r, QString p,
KURIFilterData::URITypes t = KURIFilterData::NET_PROTOCOL )
URLHint( QString r, QString p,
KUriFilterData::UriTypes t = KUriFilterData::NET_PROTOCOL )
: regexp(r), prepend(p), type(t) {}
QString regexp; // if this matches, then...
QString prepend; // ...prepend this to the url
KURIFilterData::URITypes type;
KUriFilterData::UriTypes type;
};
QList<URLHint> m_urlHints;
......
......@@ -80,7 +80,7 @@ KManPart::KManPart( QWidget * parent )
bool KManPart::openURL( const KUrl &url )
{
return KParts::ReadOnlyPart::openURL(url);
return KParts::ReadOnlyPart::openUrl(url);
}
bool KManPart::openFile()
......
......@@ -67,7 +67,7 @@ MediaProtocol::~MediaProtocol()
{
}
bool MediaProtocol::rewriteURL(const KUrl &url, KUrl &newUrl)
bool MediaProtocol::rewriteUrl(const KUrl &url, KUrl &newUrl)
{
QString name, path;
......
......@@ -32,7 +32,7 @@ public:
const QByteArray &app);
virtual ~MediaProtocol();
virtual bool rewriteURL(const KUrl &url, KUrl &newUrl);
virtual bool rewriteUrl(const KUrl &url, KUrl &newUrl);
virtual void put(const KUrl &url, int permissions,
bool overwrite, bool resume);
......
......@@ -345,7 +345,7 @@ void MediaImpl::createMediumEntry(KIO::UDSEntry& entry,
else
{
QString mime = medium.mimeType();
QString icon = KMimeType::mimeType(mime)->icon(mime);
QString icon = KMimeType::mimeType(mime)->iconName(mime);
entry.insert( KIO::UDS_ICON_NAME, icon );
}
......