Commit 5d0664b1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

KURL -> KUrl

svn path=/trunk/KDE/kdebase/kioslave/; revision=501890
parent a574beca
......@@ -38,7 +38,7 @@ AboutProtocol::~AboutProtocol()
{
}
void AboutProtocol::get( const KURL& )
void AboutProtocol::get( const KUrl& )
{
QByteArray output;
......@@ -51,7 +51,7 @@ void AboutProtocol::get( const KURL& )
finished();
}
void AboutProtocol::mimetype( const KURL& )
void AboutProtocol::mimetype( const KUrl& )
{
mimeType("text/html");
finished();
......
......@@ -32,8 +32,8 @@ public:
AboutProtocol(const QByteArray &pool_socket, const QByteArray &app_socket);
virtual ~AboutProtocol();
virtual void get(const KURL& url);
virtual void mimetype(const KURL& url);
virtual void get(const KUrl& url);
virtual void mimetype(const KUrl& url);
};
#endif
......@@ -47,7 +47,7 @@ CgiProtocol::~CgiProtocol()
kdDebug(7124) << "CgiProtocol::~CgiProtocol" << endl;
}
void CgiProtocol::get( const KURL& url )
void CgiProtocol::get( const KUrl& url )
{
kdDebug(7124) << "CgiProtocol::get()" << endl;
kdDebug(7124) << " URL: " << url.url() << endl;
......
......@@ -34,9 +34,9 @@ class CgiProtocol : public KIO::SlaveBase
CgiProtocol( const QByteArray &pool, const QByteArray &app );
virtual ~CgiProtocol();
virtual void get( const KURL& url );
virtual void get( const KUrl& url );
// virtual void mimetype( const KURL& url );
// virtual void mimetype( const KUrl& url );
protected:
// QCString errorMessage();
......
......@@ -60,7 +60,7 @@ FilterProtocol::FilterProtocol( const QByteArray & protocol, const QByteArray &p
Q_ASSERT(filter);
}
void FilterProtocol::get( const KURL & )
void FilterProtocol::get( const KUrl & )
{
if (subURL.isEmpty())
{
......@@ -154,12 +154,12 @@ void FilterProtocol::get( const KURL & )
finished();
}
void FilterProtocol::put( const KURL &/*url*/, int, bool /*_overwrite*/, bool /*_resume*/ )
void FilterProtocol::put( const KUrl &/*url*/, int, bool /*_overwrite*/, bool /*_resume*/ )
{
error( KIO::ERR_UNSUPPORTED_ACTION, QString::fromLatin1("put"));
}
void FilterProtocol::setSubURL(const KURL &url)
void FilterProtocol::setSubURL(const KUrl &url)
{
subURL = url;
}
......
......@@ -33,13 +33,13 @@ class FilterProtocol : public QObject, public KIO::SlaveBase
public:
FilterProtocol( const QByteArray & protocol, const QByteArray &pool, const QByteArray &app );
virtual void get( const KURL &url );
virtual void put( const KURL &url, int _mode, bool _overwrite,
virtual void get( const KUrl &url );
virtual void put( const KUrl &url, int _mode, bool _overwrite,
bool _resume );
virtual void setSubURL(const KURL &url);
virtual void setSubURL(const KUrl &url);
private:
KURL subURL;
KUrl subURL;
KFilterBase * filter;
};
......
......@@ -93,9 +93,9 @@ FingerProtocol::~FingerProtocol()
/* ---------------------------------------------------------------------------------- */
void FingerProtocol::get(const KURL& url )
void FingerProtocol::get(const KUrl& url )
{
//kdDebug() << "kio_finger::get(const KURL& url)" << endl ;
//kdDebug() << "kio_finger::get(const KUrl& url)" << endl ;
this->parseCommandLine(url);
......@@ -157,7 +157,7 @@ void FingerProtocol::slotGetStdOutput(KProcess* /* p */, char *s, int len)
/* ---------------------------------------------------------------------------------- */
void FingerProtocol::mimetype(const KURL & /*url*/)
void FingerProtocol::mimetype(const KUrl & /*url*/)
{
mimeType("text/html");
finished();
......@@ -227,7 +227,7 @@ void FingerProtocol::getProgramPath()
/* --------------------------------------------------------------------------- */
void FingerProtocol::parseCommandLine(const KURL& url)
void FingerProtocol::parseCommandLine(const KUrl& url)
{
myURL = new KURL(url);
......
......@@ -37,14 +37,14 @@ public:
FingerProtocol(const QByteArray &pool_socket, const QByteArray &app_socket);
virtual ~FingerProtocol();
virtual void mimetype(const KURL& url);
virtual void get(const KURL& url);
virtual void mimetype(const KUrl& url);
virtual void get(const KUrl& url);
private Q_SLOTS:
void slotGetStdOutput(KProcess*, char*, int);
private:
KURL *myURL;
KUrl *myURL;
QString *myPerlPath;
QString *myFingerPath;
......@@ -57,7 +57,7 @@ private:
KProcess *myKProcess;
void getProgramPath();
void parseCommandLine(const KURL& url);
void parseCommandLine(const KUrl& url);
};
......
......@@ -559,7 +559,7 @@ int fishProtocol::establishConnection(char *buffer, int len) {
thisFn += str;
} else if (buf.endsWith(":")) {
if (!redirectUser.isEmpty() && connectionUser != redirectUser) {
KURL dest = url;
KUrl dest = url;
dest.setUser(redirectUser);
dest.setPass(redirectPass);
redirection(dest);
......@@ -596,7 +596,7 @@ int fishProtocol::establishConnection(char *buffer, int len) {
firstLogin = false;
connectionAuth.password += "\n";
if (connectionAuth.username != connectionUser) {
KURL dest = url;
KUrl dest = url;
dest.setUser(connectionAuth.username);
dest.setPass(connectionAuth.password);
redirection(dest);
......@@ -1252,7 +1252,7 @@ int fishProtocol::received(const char *buffer, int buflen)
return buflen;
}
/** get a file */
void fishProtocol::get(const KURL& u){
void fishProtocol::get(const KUrl& u){
myDebug( << "@@@@@@@@@ get " << u << endl);
setHost(u.host(),u.port(),u.user(),u.pass());
url = u;
......@@ -1269,7 +1269,7 @@ void fishProtocol::get(const KURL& u){
}
/** put a file */
void fishProtocol::put(const KURL& u, int permissions, bool overwrite, bool /*resume*/){
void fishProtocol::put(const KUrl& u, int permissions, bool overwrite, bool /*resume*/){
myDebug( << "@@@@@@@@@ put " << u << " " << permissions << " " << overwrite << " " /* << resume */ << endl);
setHost(u.host(),u.port(),u.user(),u.pass());
url = u;
......@@ -1385,7 +1385,7 @@ void fishProtocol::run() {
}
}
/** stat a file */
void fishProtocol::stat(const KURL& u){
void fishProtocol::stat(const KUrl& u){
myDebug( << "@@@@@@@@@ stat " << u << endl);
setHost(u.host(),u.port(),u.user(),u.pass());
url = u;
......@@ -1402,7 +1402,7 @@ void fishProtocol::stat(const KURL& u){
run();
}
/** find mimetype for a file */
void fishProtocol::mimetype(const KURL& u){
void fishProtocol::mimetype(const KUrl& u){
myDebug( << "@@@@@@@@@ mimetype " << u << endl);
setHost(u.host(),u.port(),u.user(),u.pass());
url = u;
......@@ -1418,7 +1418,7 @@ void fishProtocol::mimetype(const KURL& u){
run();
}
/** list a directory */
void fishProtocol::listDir(const KURL& u){
void fishProtocol::listDir(const KUrl& u){
myDebug( << "@@@@@@@@@ listDir " << u << endl);
setHost(u.host(),u.port(),u.user(),u.pass());
url = u;
......@@ -1434,7 +1434,7 @@ void fishProtocol::listDir(const KURL& u){
run();
}
/** create a directory */
void fishProtocol::mkdir(const KURL& u, int permissions) {
void fishProtocol::mkdir(const KUrl& u, int permissions) {
myDebug( << "@@@@@@@@@ mkdir " << u << " " << permissions << endl);
setHost(u.host(),u.port(),u.user(),u.pass());
url = u;
......@@ -1450,7 +1450,7 @@ void fishProtocol::mkdir(const KURL& u, int permissions) {
run();
}
/** rename a file */
void fishProtocol::rename(const KURL& s, const KURL& d, bool overwrite) {
void fishProtocol::rename(const KUrl& s, const KUrl& d, bool overwrite) {
myDebug( << "@@@@@@@@@ rename " << s << " " << d << " " << overwrite << endl);
if (s.host() != d.host() || s.port() != d.port() || s.user() != d.user()) {
error(ERR_UNSUPPORTED_ACTION,s.prettyURL());
......@@ -1460,7 +1460,7 @@ void fishProtocol::rename(const KURL& s, const KURL& d, bool overwrite) {
url = d;
openConnection();
if (!isLoggedIn) return;
KURL src = s;
KUrl src = s;
url.cleanPath();
src.cleanPath();
if (!url.hasPath()) {
......@@ -1476,7 +1476,7 @@ void fishProtocol::rename(const KURL& s, const KURL& d, bool overwrite) {
run();
}
/** create a symlink */
void fishProtocol::symlink(const QString& target, const KURL& u, bool overwrite) {
void fishProtocol::symlink(const QString& target, const KUrl& u, bool overwrite) {
myDebug( << "@@@@@@@@@ symlink " << target << " " << u << " " << overwrite << endl);
setHost(u.host(),u.port(),u.user(),u.pass());
url = u;
......@@ -1496,7 +1496,7 @@ void fishProtocol::symlink(const QString& target, const KURL& u, bool overwrite)
run();
}
/** change file permissions */
void fishProtocol::chmod(const KURL& u, int permissions){
void fishProtocol::chmod(const KUrl& u, int permissions){
myDebug( << "@@@@@@@@@ chmod " << u << " " << permissions << endl);
setHost(u.host(),u.port(),u.user(),u.pass());
url = u;
......@@ -1511,7 +1511,7 @@ void fishProtocol::chmod(const KURL& u, int permissions){
run();
}
/** copies a file */
void fishProtocol::copy(const KURL &s, const KURL &d, int permissions, bool overwrite) {
void fishProtocol::copy(const KUrl &s, const KUrl &d, int permissions, bool overwrite) {
myDebug( << "@@@@@@@@@ copy " << s << " " << d << " " << permissions << " " << overwrite << endl);
if (s.host() != d.host() || s.port() != d.port() || s.user() != d.user()) {
error(ERR_UNSUPPORTED_ACTION,s.prettyURL());
......@@ -1522,7 +1522,7 @@ void fishProtocol::copy(const KURL &s, const KURL &d, int permissions, bool over
url = d;
openConnection();
if (!isLoggedIn) return;
KURL src = s;
KUrl src = s;
url.cleanPath();
src.cleanPath();
if (!src.hasPath()) {
......@@ -1539,7 +1539,7 @@ void fishProtocol::copy(const KURL &s, const KURL &d, int permissions, bool over
run();
}
/** removes a file or directory */
void fishProtocol::del(const KURL &u, bool isFile){
void fishProtocol::del(const KUrl &u, bool isFile){
myDebug( << "@@@@@@@@@ del " << u << " " << isFile << endl);
setHost(u.host(),u.port(),u.user(),u.pass());
url = u;
......@@ -1563,7 +1563,7 @@ void fishProtocol::special( const QByteArray &data ){
switch (tmp) {
case FISH_EXEC_CMD: // SSH EXEC
{
KURL u;
KUrl u;
QString command;
QString tempfile;
stream >> u;
......
......@@ -52,33 +52,33 @@ It is set to false if the connection becomes closed.
/** Forced close of the connection */
void closeConnection();
/** get a file */
void get(const KURL& url);
void get(const KUrl& url);
/** put a file */
void put(const KURL& url, int permissions, bool overwrite, bool resume);
void put(const KUrl& url, int permissions, bool overwrite, bool resume);
/** aborts command sequence and calls error() */
void error(int type, const QString &detail);
/** executes next command in sequence or calls finished() if all is done */
void finished();
/** stat a file */
void stat(const KURL& url);
void stat(const KUrl& url);
/** find mimetype for a file */
void mimetype(const KURL& url);
void mimetype(const KUrl& url);
/** list a directory */
void listDir(const KURL& url);
void listDir(const KUrl& url);
/** create a directory */
void mkdir(const KURL&url, int permissions);
void mkdir(const KUrl&url, int permissions);
/** rename a file */
void rename(const KURL& src, const KURL& dest, bool overwrite);
void rename(const KUrl& src, const KUrl& dest, bool overwrite);
/** create a symlink */
void symlink(const QString& target, const KURL& dest, bool overwrite);
void symlink(const QString& target, const KUrl& dest, bool overwrite);
/** change file permissions */
void chmod(const KURL& url, int permissions);
void chmod(const KUrl& url, int permissions);
/** copies a file */
void copy(const KURL &src, const KURL &dest, int permissions, bool overwrite);
void copy(const KUrl &src, const KUrl &dest, int permissions, bool overwrite);
/** report status */
void slave_status();
/** removes a file or directory */
void del(const KURL &u, bool isfile);
void del(const KUrl &u, bool isfile);
/** special like background execute */
void special( const QByteArray &data );
......@@ -115,7 +115,7 @@ protected: // Protected attributes
QString wantedFn;
QString statPath;
/** url of current request */
KURL url;
KUrl url;
/** true if connection is logged in successfully */
bool isLoggedIn;
/** host name of current connection */
......
......@@ -186,7 +186,7 @@ void FloppyProtocol::terminateBuffers()
//kdDebug(7101)<<"Floppy::terminateBuffers() ends"<<endl;
}
bool FloppyProtocol::stopAfterError(const KURL& url, const QString& drive)
bool FloppyProtocol::stopAfterError(const KUrl& url, const QString& drive)
{
if (m_stderrSize==0)
return true;
......@@ -252,10 +252,10 @@ bool FloppyProtocol::stopAfterError(const KURL& url, const QString& drive)
return true;
}
void FloppyProtocol::listDir( const KURL& _url)
void FloppyProtocol::listDir( const KUrl& _url)
{
kdDebug(7101)<<"Floppy::listDir() "<<_url.path()<<endl;
KURL url(_url);
KUrl url(_url);
QString path(url.path());
if ((path.isEmpty()) || (path=="/"))
......@@ -471,7 +471,7 @@ StatInfo FloppyProtocol::createStatInfo(const QString line, bool makeStat, const
return info;
}
StatInfo FloppyProtocol::_stat(const KURL& url)
StatInfo FloppyProtocol::_stat(const KUrl& url)
{
StatInfo info;
......@@ -577,7 +577,7 @@ StatInfo FloppyProtocol::_stat(const KURL& url)
return info;
}
int FloppyProtocol::freeSpace(const KURL& url)
int FloppyProtocol::freeSpace(const KUrl& url)
{
QString path(url.path());
QString drive;
......@@ -671,10 +671,10 @@ int FloppyProtocol::freeSpace(const KURL& url)
return -1;
}
void FloppyProtocol::stat( const KURL & _url)
void FloppyProtocol::stat( const KUrl & _url)
{
kdDebug(7101)<<"Floppy::stat() "<<_url.path()<<endl;
KURL url(_url);
KUrl url(_url);
QString path(url.path());
if ((path.isEmpty()) || (path=="/"))
......@@ -697,14 +697,14 @@ void FloppyProtocol::stat( const KURL & _url)
//otherwise the error() was already reported in _stat()
}
void FloppyProtocol::mkdir( const KURL& url, int)
void FloppyProtocol::mkdir( const KUrl& url, int)
{
kdDebug(7101)<<"FloppyProtocol::mkdir()"<<endl;
QString path(url.path());
if ((path.isEmpty()) || (path=="/"))
{
KURL newUrl(url);
KUrl newUrl(url);
newUrl.setPath("/a/");
redirection(newUrl);
finished();
......@@ -769,14 +769,14 @@ void FloppyProtocol::mkdir( const KURL& url, int)
finished();
}
void FloppyProtocol::del( const KURL& url, bool isfile)
void FloppyProtocol::del( const KUrl& url, bool isfile)
{
kdDebug(7101)<<"FloppyProtocol::del()"<<endl;
QString path(url.path());
if ((path.isEmpty()) || (path=="/"))
{
KURL newUrl(url);
KUrl newUrl(url);
newUrl.setPath("/a/");
redirection(newUrl);
finished();
......@@ -854,7 +854,7 @@ void FloppyProtocol::del( const KURL& url, bool isfile)
finished();
}
void FloppyProtocol::rename( const KURL &src, const KURL &dest, bool _overwrite )
void FloppyProtocol::rename( const KUrl &src, const KUrl &dest, bool _overwrite )
{
QString srcPath(src.path());
QString destPath(dest.path());
......@@ -940,14 +940,14 @@ void FloppyProtocol::rename( const KURL &src, const KURL &dest, bool _overwrite
finished();
}
void FloppyProtocol::get( const KURL& url )
void FloppyProtocol::get( const KUrl& url )
{
QString path(url.path());
kdDebug(7101)<<"Floppy::get() -"<<path<<"-"<<endl;
if ((path.isEmpty()) || (path=="/"))
{
KURL newUrl(url);
KUrl newUrl(url);
newUrl.setPath("/a/");
redirection(newUrl);
finished();
......@@ -1040,14 +1040,14 @@ void FloppyProtocol::get( const KURL& url )
finished();
}
void FloppyProtocol::put( const KURL& url, int , bool overwrite, bool )
void FloppyProtocol::put( const KUrl& url, int , bool overwrite, bool )
{
QString path(url.path());
kdDebug(7101)<<"Floppy::put() -"<<path<<"-"<<endl;
if ((path.isEmpty()) || (path=="/"))
{
KURL newUrl(url);
KUrl newUrl(url);
newUrl.setPath("/a/");
redirection(newUrl);
finished();
......
......@@ -46,14 +46,14 @@ class FloppyProtocol : public KIO::SlaveBase
FloppyProtocol (const QByteArray &pool, const QByteArray &app );
virtual ~FloppyProtocol();
virtual void listDir( const KURL& url);
virtual void stat( const KURL & url);
virtual void mkdir( const KURL& url, int);
virtual void del( const KURL& url, bool isfile);
virtual void rename(const KURL &src, const KURL &dest, bool overwrite);
virtual void get( const KURL& url );
virtual void put( const KURL& url, int _mode,bool overwrite, bool _resume );
//virtual void copy( const KURL& src, const KURL &dest, int, bool overwrite );
virtual void listDir( const KUrl& url);
virtual void stat( const KUrl & url);
virtual void mkdir( const KUrl& url, int);
virtual void del( const KUrl& url, bool isfile);
virtual void rename(const KUrl &src, const KUrl &dest, bool overwrite);
virtual void get( const KUrl& url );
virtual void put( const KUrl& url, int _mode,bool overwrite, bool _resume );
//virtual void copy( const KUrl& src, const KUrl &dest, int, bool overwrite );
protected:
Program *m_mtool;
int readStdout();
......@@ -61,10 +61,10 @@ class FloppyProtocol : public KIO::SlaveBase
StatInfo createStatInfo(const QString line, bool makeStat=false, const QString& dirName="");
void createUDSEntry(const StatInfo& info, KIO::UDSEntry& entry);
StatInfo _stat(const KURL& _url);
int freeSpace(const KURL& url);
StatInfo _stat(const KUrl& _url);
int freeSpace(const KUrl& url);
bool stopAfterError(const KURL& url, const QString& drive);
bool stopAfterError(const KUrl& url, const QString& drive);
void errorMissingMToolsProgram(const QString& name);
void clearBuffers();
......
......@@ -35,7 +35,7 @@ HomeImpl::HomeImpl()
m_effectiveUid = user.uid();
}
bool HomeImpl::parseURL(const KURL &url, QString &name, QString &path) const
bool HomeImpl::parseURL(const KUrl &url, QString &name, QString &path) const
{
QString url_path = url.path();
......@@ -54,13 +54,13 @@ bool HomeImpl::parseURL(const KURL &url, QString &name, QString &path) const
return name != QString();
}
bool HomeImpl::realURL(const QString &name, const QString &path, KURL &url)
bool HomeImpl::realURL(const QString &name, const QString &path, KUrl &url)
{
KUser user(name);
if ( user.isValid() )
{
KURL res;
KUrl res;
res.setPath( user.homeDir() );
res.addPath(path);
url = res;
......@@ -148,7 +148,7 @@ void HomeImpl::createHomeEntry(KIO::UDSEntry &entry,
entry.insert( KIO::UDS_ICON_NAME, icon_name);
KURL url;
KUrl url;
url.setPath(user.homeDir());
extractUrlInfos(url, entry);
}
......@@ -186,7 +186,7 @@ void HomeImpl::enterLoop()
eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
}
void HomeImpl::extractUrlInfos(const KURL &url, KIO::UDSEntry& infos)
void HomeImpl::extractUrlInfos(const KUrl &url, KIO::UDSEntry& infos)
{
m_entryBuffer.clear();
......
......@@ -33,8 +33,8 @@ Q_OBJECT
public:
HomeImpl();
bool parseURL(const KURL &url, QString &name, QString &path) const;
bool realURL(const QString &name, const QString &path, KURL &url);
bool parseURL(const KUrl &url, QString &name, QString &path) const;
bool realURL(const QString &name, const QString &path, KUrl &url);
bool statHome(const QString &name, KIO::UDSEntry &entry);
bool listHomes(KIO::UDSEntryList &list);
......@@ -54,7 +54,7 @@ Q_SIGNALS:
private:
void createHomeEntry(KIO::UDSEntry& entry, const KUser &user);
void extractUrlInfos(const KURL &url, KIO::UDSEntry& infos);
void extractUrlInfos(const KUrl &url, KIO::UDSEntry& infos);
KIO::UDSEntry m_entryBuffer;
......
......@@ -60,7 +60,7 @@ void HomeDirNotify::init()
uid_list.append( (*it).uid() );
QString name = (*it).loginName();
KURL url;
KUrl url;
url.setPath( (*it).homeDir() );
m_homeFoldersMap[name] = url;
......@@ -69,7 +69,7 @@ void HomeDirNotify::init()
}
}
KURL HomeDirNotify::toHomeURL(const KURL &url)
KUrl HomeDirNotify::toHomeURL(const KUrl &url)
{
kdDebug() << "HomeDirNotify::toHomeURL(" << url << ")" << endl;
......@@ -80,13 +80,13 @@ KURL HomeDirNotify::toHomeURL(const KURL &url)
for (; it!=end; ++it)
{
QString name = it.key();
KURL base = it.data();
KUrl base = it.data();
if ( base.isParentOf(url) )
{
QString path = KURL::relativePath(base.path(),
QString path = KUrl::relativePath(base.path(),
url.path());
KURL result("home:/"+name+"/"+path);
KUrl result("home:/"+name+"/"+path);
result.cleanPath();
kdDebug() << "result => " << result << endl;
return result;
......@@ -97,17 +97,17 @@ KURL HomeDirNotify::toHomeURL(const KURL &url)
return KURL();
}
KURL::List HomeDirNotify::toHomeURLList(const KURL::List &list)
KUrl::List HomeDirNotify::toHomeURLList(const KUrl::List &list)