[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdelibs/frameworks] kio/kio: KUrl -> QUrl
From:       David Faure <faure () kde ! org>
Date:       2012-04-30 23:22:56
Message-ID: 20120430232256.B730CA60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 097329a9706698ec3f8774dd27b70b5f54a9f9a6 by David Faure.
Committed on 01/05/2012 at 01:13.
Pushed by dfaure into branch 'frameworks'.

KUrl -> QUrl

Move KIO::open() declaration to filejob.h (needed to use KIO::open anyway)

M  +1    -1    kio/kio/deletejob.h
M  +5    -6    kio/kio/directorysizejob.cpp
M  +1    -1    kio/kio/directorysizejob.h
M  +2    -2    kio/kio/filejob.cpp
M  +13   -2    kio/kio/filejob.h
M  +18   -10   kio/kio/job.cpp
M  +0    -12   kio/kio/job.h
M  +11   -9    kio/kio/job_p.h
M  +31   -31   kio/kio/scheduler.cpp
M  +9    -9    kio/kio/scheduler.h
M  +1    -1    kio/kio/scheduler_p.h
M  +6    -6    kio/kio/slave.cpp
M  +4    -4    kio/kio/slave.h

http://commits.kde.org/kdelibs/097329a9706698ec3f8774dd27b70b5f54a9f9a6

diff --git a/kio/kio/deletejob.h b/kio/kio/deletejob.h
index 06b0b5d..7d6726a 100644
--- a/kio/kio/deletejob.h
+++ b/kio/kio/deletejob.h
@@ -86,7 +86,7 @@ namespace KIO {
 	 * @param file the URL of the file or directory that is being
 	 *        deleted
 	 */
-        void deleting( KIO::Job *job, const KUrl& file );
+        void deleting(KIO::Job *job, const QUrl& file);
 
     protected Q_SLOTS:
         virtual void slotResult( KJob *job );
diff --git a/kio/kio/directorysizejob.cpp b/kio/kio/directorysizejob.cpp
index 4f3aa23..b7638ab 100644
--- a/kio/kio/directorysizejob.cpp
+++ b/kio/kio/directorysizejob.cpp
@@ -51,13 +51,13 @@ namespace KIO
         int m_currentItem;
         QHash<long, QSet<long> > m_visitedInodes; // device -> set of inodes
 
-        void startNextJob( const KUrl & url );
+        void startNextJob(const QUrl & url);
         void slotEntries( KIO::Job * , const KIO::UDSEntryList &);
         void processNextItem();
 
         Q_DECLARE_PUBLIC(DirectorySizeJob)
 
-        static inline DirectorySizeJob *newJob( const KUrl & directory )
+        static inline DirectorySizeJob *newJob(const QUrl & directory)
         {
             DirectorySizeJobPrivate *d = new DirectorySizeJobPrivate;
             DirectorySizeJob *job = new DirectorySizeJob(*d);
@@ -116,8 +116,7 @@ void DirectorySizeJobPrivate::processNextItem()
             if ( item.isDir() )
             {
                 //kDebug(7007) << "dir -> listing";
-                KUrl url = item.url();
-                startNextJob( url );
+                startNextJob(item.url());
                 return; // we'll come back later, when this one's finished
             }
             else
@@ -134,7 +133,7 @@ void DirectorySizeJobPrivate::processNextItem()
     q->emitResult();
 }
 
-void DirectorySizeJobPrivate::startNextJob( const KUrl & url )
+void DirectorySizeJobPrivate::startNextJob(const QUrl & url)
 {
     Q_Q(DirectorySizeJob);
     //kDebug(7007) << url;
@@ -199,7 +198,7 @@ void DirectorySizeJob::slotResult( KJob * job )
 }
 
 //static
-DirectorySizeJob * KIO::directorySize( const KUrl & directory )
+DirectorySizeJob * KIO::directorySize(const QUrl & directory)
 {
     return DirectorySizeJobPrivate::newJob(directory); // useless - but consistent \
with other jobs  }
diff --git a/kio/kio/directorysizejob.h b/kio/kio/directorysizejob.h
index e754b39..38604ed 100644
--- a/kio/kio/directorysizejob.h
+++ b/kio/kio/directorysizejob.h
@@ -77,7 +77,7 @@ private:
  *
  * This one lists a single directory.
  */
-KIO_EXPORT DirectorySizeJob * directorySize( const KUrl & directory );
+KIO_EXPORT DirectorySizeJob * directorySize(const QUrl & directory);
 
 /**
  * Computes a directory size (by doing a recursive listing).
diff --git a/kio/kio/filejob.cpp b/kio/kio/filejob.cpp
index ece6530..c9824cd 100644
--- a/kio/kio/filejob.cpp
+++ b/kio/kio/filejob.cpp
@@ -33,7 +33,7 @@
 class KIO::FileJobPrivate: public KIO::SimpleJobPrivate
 {
 public:
-    FileJobPrivate(const KUrl& url, const QByteArray &packedArgs)
+    FileJobPrivate(const QUrl& url, const QByteArray &packedArgs)
         : SimpleJobPrivate(url, CMD_OPEN, packedArgs), m_open(false), m_size(0)
         {}
 
@@ -60,7 +60,7 @@ public:
 
     Q_DECLARE_PUBLIC(FileJob)
 
-    static inline FileJob *newJob(const KUrl &url, const QByteArray &packedArgs)
+    static inline FileJob *newJob(const QUrl &url, const QByteArray &packedArgs)
     {
         FileJob *job = new FileJob(*new FileJobPrivate(url, packedArgs));
         job->setUiDelegate(new JobUiDelegate);
diff --git a/kio/kio/filejob.h b/kio/kio/filejob.h
index bff455f..8a32162 100644
--- a/kio/kio/filejob.h
+++ b/kio/kio/filejob.h
@@ -21,7 +21,6 @@
 #ifndef KIO_FILEJOB_H
 #define KIO_FILEJOB_H
 
-#include <kurl.h>
 #include <kio/jobclasses.h>
 
 namespace KIO {
@@ -31,7 +30,7 @@ class FileJobPrivate;
  *  The file-job is an asynchronious version of normal file handling.
  *  It allows block-wise reading and writing, and allows seeking. Results are \
                returned through signals.
  *
- *  Should always be created using KIO::open(KUrl&)
+ *  Should always be created using KIO::open(QUrl)
  */
 
 class KIO_EXPORT FileJob : public SimpleJob
@@ -144,6 +143,18 @@ private:
     Q_DECLARE_PRIVATE(FileJob)
 };
 
+/**
+ * Open ( random access I/O )
+ *
+ * The file-job emits open() when opened
+ * @param url the URL of the file
+ * @param mode the access privileges: see \ref OpenMode
+ *
+ * @return The file-handling job. It will never return 0. Errors are handled \
asynchronously + * (emitted as signals).
+ */
+KIO_EXPORT FileJob *open(const QUrl &url, QIODevice::OpenMode mode);
+
 } // namespace
 
 #endif
diff --git a/kio/kio/job.cpp b/kio/kio/job.cpp
index 4d221af..e88ebf1 100644
--- a/kio/kio/job.cpp
+++ b/kio/kio/job.cpp
@@ -119,39 +119,47 @@ bool Job::removeSubjob( KJob *jobBase )
     return KCompositeJob::removeSubjob( jobBase );
 }
 
-void JobPrivate::emitMoving(KIO::Job * job, const KUrl &src, const KUrl &dest)
+// Porting helpers. Qt 5: remove
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+#define pathOrUrl() toString()
+#define toDisplayString toString
+#else
+#define pathOrUrl() toDisplayString(QUrl::PreferLocalFile)
+#endif
+
+void JobPrivate::emitMoving(KIO::Job * job, const QUrl &src, const QUrl &dest)
 {
     emit job->description(job, i18nc("@title job","Moving"),
                           qMakePair(i18nc("The source of a file operation", \
                "Source"), src.pathOrUrl()),
                           qMakePair(i18nc("The destination of a file operation", \
"Destination"), dest.pathOrUrl()));  }
 
-void JobPrivate::emitCopying(KIO::Job * job, const KUrl &src, const KUrl &dest)
+void JobPrivate::emitCopying(KIO::Job * job, const QUrl &src, const QUrl &dest)
 {
     emit job->description(job, i18nc("@title job","Copying"),
                           qMakePair(i18nc("The source of a file operation", \
                "Source"), src.pathOrUrl()),
                           qMakePair(i18nc("The destination of a file operation", \
"Destination"), dest.pathOrUrl()));  }
 
-void JobPrivate::emitCreatingDir(KIO::Job * job, const KUrl &dir)
+void JobPrivate::emitCreatingDir(KIO::Job * job, const QUrl &dir)
 {
     emit job->description(job, i18nc("@title job","Creating directory"),
                           qMakePair(i18n("Directory"), dir.pathOrUrl()));
 }
 
-void JobPrivate::emitDeleting(KIO::Job *job, const KUrl &url)
+void JobPrivate::emitDeleting(KIO::Job *job, const QUrl &url)
 {
     emit job->description(job, i18nc("@title job","Deleting"),
                           qMakePair(i18n("File"), url.pathOrUrl()));
 }
 
-void JobPrivate::emitStating(KIO::Job *job, const KUrl &url)
+void JobPrivate::emitStating(KIO::Job *job, const QUrl &url)
 {
     emit job->description(job, i18nc("@title job","Examining"),
                           qMakePair(i18n("File"), url.pathOrUrl()));
 }
 
-void JobPrivate::emitTransferring(KIO::Job *job, const KUrl &url)
+void JobPrivate::emitTransferring(KIO::Job *job, const QUrl &url)
 {
     emit job->description(job, i18nc("@title job","Transferring"),
                           qMakePair(i18nc("The source of a file operation", \
"Source"), url.pathOrUrl())); @@ -299,7 +307,7 @@ void \
SimpleJobPrivate::simpleJobInit()  if (!m_url.isValid())
     {
         q->setError( ERR_MALFORMED_URL );
-        q->setErrorText( m_url.url() );
+        q->setErrorText(m_url.toString());
         QTimer::singleShot(0, q, SLOT(slotFinished()) );
         return;
     }
@@ -909,7 +917,7 @@ void TransferJob::slotRedirection(const QUrl &url)
     {
        kDebug(7007) << "CYCLIC REDIRECTION!";
        setError( ERR_CYCLIC_LINK );
-       setErrorText(d->m_url.prettyUrl());
+       setErrorText(d->m_url.toDisplayString());
     }
     else
     {
@@ -2610,7 +2618,7 @@ void ListJobPrivate::start(Slave *slave)
         !(m_extraFlags & EF_ListJobUnrestricted))
     {
         q->setError( ERR_ACCESS_DENIED );
-        q->setErrorText( m_url.url() );
+        q->setErrorText( m_url.toDisplayString() );
         QTimer::singleShot(0, q, SLOT(slotFinished()) );
         return;
     }
@@ -2705,7 +2713,7 @@ void MultiGetJobPrivate::flushQueue(RequestQueue &queue)
       if ((m_url.scheme() == entry.url.scheme()) &&
           (m_url.host() == entry.url.host()) &&
           (m_url.port() == entry.url.port()) &&
-          (m_url.user() == entry.url.user()))
+          (m_url.userName() == entry.url.userName()))
       {
          queue.append( entry );
          wqit = m_waitQueue.erase( wqit );
diff --git a/kio/kio/job.h b/kio/kio/job.h
index b76e4ff..05eda4d 100644
--- a/kio/kio/job.h
+++ b/kio/kio/job.h
@@ -256,18 +256,6 @@ namespace KIO {
     KIO_EXPORT TransferJob *get( const QUrl& url, LoadType reload = NoReload, \
JobFlags flags = DefaultFlags );  
     /**
-     * Open ( random access I/O )
-     *
-     * The file-job emits open() when opened
-     * @param url the URL of the file
-     * @param mode the access privileges: see \ref OpenMode
-     *
-     * @return The file-handling job. It will never return 0. Errors are handled \
                asynchronously
-     * (emitted as signals).
-     */
-    KIO_EXPORT FileJob *open(const QUrl &url, QIODevice::OpenMode mode);
-
-    /**
      * Put (a.k.a. write)
      *
      * @param url Where to write data.
diff --git a/kio/kio/job_p.h b/kio/kio/job_p.h
index a448cf3..9bd48fd 100644
--- a/kio/kio/job_p.h
+++ b/kio/kio/job_p.h
@@ -63,12 +63,12 @@ namespace KIO {
 
         void slotSpeed( KJob *job, unsigned long speed );
 
-        static void emitMoving(KIO::Job*, const KUrl &src, const KUrl &dest);
-        static void emitCopying(KIO::Job*, const KUrl &src, const KUrl &dest);
-        static void emitCreatingDir(KIO::Job*, const KUrl &dir);
-        static void emitDeleting(KIO::Job*, const KUrl &url);
-        static void emitStating(KIO::Job*, const KUrl &url);
-        static void emitTransferring(KIO::Job*, const KUrl &url);
+        static void emitMoving(KIO::Job*, const QUrl &src, const QUrl &dest);
+        static void emitCopying(KIO::Job*, const QUrl &src, const QUrl &dest);
+        static void emitCreatingDir(KIO::Job*, const QUrl &dir);
+        static void emitDeleting(KIO::Job*, const QUrl &url);
+        static void emitStating(KIO::Job*, const QUrl &url);
+        static void emitTransferring(KIO::Job*, const QUrl &url);
         static void emitMounting(KIO::Job*, const QString &dev, const QString \
&point);  static void emitUnmounting(KIO::Job*, const QString &point);
 
@@ -88,6 +88,7 @@ namespace KIO {
             : m_slave(0), m_packedArgs(packedArgs), m_url(url), m_command(command),
               m_checkOnHold(false), m_schedSerial(0), \
m_redirectionHandlingEnabled(true)  {
+#if 0
             if (m_url.hasSubUrl())
             {
                 KUrl::List list = KUrl::split(m_url);
@@ -96,12 +97,13 @@ namespace KIO {
                 //kDebug(7007) << "New URL = "  << m_url.url();
                 //kDebug(7007) << "Sub URL = "  << m_subUrl.url();
             }
+#endif
         }
 
         Slave * m_slave;
         QByteArray m_packedArgs;
-        KUrl m_url;
-        KUrl m_subUrl;
+        QUrl m_url;
+        QUrl m_subUrl;
         int m_command;
 
         // for use in KIO::Scheduler
@@ -220,7 +222,7 @@ namespace KIO {
         bool m_errorPage;
         QByteArray staticData;
         QUrl m_redirectionURL;
-        KUrl::List m_redirectionList;
+        QList<QUrl> m_redirectionList;
         QString m_mimetype;
         bool m_isMimetypeEmitted;
         TransferJob *m_subJob;
diff --git a/kio/kio/scheduler.cpp b/kio/kio/scheduler.cpp
index 8e59333..d8507d3 100644
--- a/kio/kio/scheduler.cpp
+++ b/kio/kio/scheduler.cpp
@@ -60,7 +60,7 @@ static inline void startJob(SimpleJob *job, Slave *slave)
 
 // here be uglies
 // forward declaration to break cross-dependency of SlaveKeeper and SchedulerPrivate
-static void setupSlave(KIO::Slave *slave, const KUrl &url, const QString &protocol,
+static void setupSlave(KIO::Slave *slave, const QUrl &url, const QString &protocol,
                        const QStringList &proxyList, bool newSlave, const \
KIO::MetaData *config = 0);  // same reason as above
 static Scheduler *scheduler();
@@ -97,7 +97,7 @@ Slave *SlaveKeeper::takeSlaveForJob(SimpleJob *job)
         return slave;
     }
 
-    KUrl url = SimpleJobPrivate::get(job)->m_url;
+    QUrl url = SimpleJobPrivate::get(job)->m_url;
     // TODO take port, username and password into account
     QMultiHash<QString, Slave *>::Iterator it = m_idleSlaves.find(url.host());
     if (it == m_idleSlaves.end()) {
@@ -334,18 +334,18 @@ void ConnectedSlaveQueue::startRunnableJobs()
         Q_ASSERT(!jobs.runningJob);
         jobs.runningJob = job;
 
-        const KUrl url = job->url();
+        const QUrl url = job->url();
         // no port is -1 in QUrl, but in kde3 we used 0 and the kioslaves assume \
that.  const int port = url.port() == -1 ? 0 : url.port();
 
         if (slave->host() == "<reset>") {
-            MetaData configData = SlaveConfig::self()->configData(url.protocol(), \
url.host()); +            MetaData configData = \
SlaveConfig::self()->configData(url.scheme(), url.host());  \
                slave->setConfig(configData);
-            slave->setProtocol(url.protocol());
-            slave->setHost(url.host(), port, url.user(), url.pass());
+            slave->setProtocol(url.scheme());
+            slave->setHost(url.host(), port, url.userName(), url.password());
         }
 
-        Q_ASSERT(slave->protocol() == url.protocol());
+        Q_ASSERT(slave->protocol() == url.scheme());
         Q_ASSERT(slave->host() == url.host());
         Q_ASSERT(slave->port() == port);
         startJob(job, slave);
@@ -528,7 +528,7 @@ void ProtoQueue::removeJob(SimpleJob *job)
     ensureNoDuplicates(&m_queuesBySerial);
 }
 
-Slave *ProtoQueue::createSlave(const QString &protocol, SimpleJob *job, const KUrl \
&url) +Slave *ProtoQueue::createSlave(const QString &protocol, SimpleJob *job, const \
QUrl &url)  {
     int error;
     QString errortext;
@@ -674,7 +674,7 @@ public:
     Scheduler *q;
 
     Slave *m_slaveOnHold;
-    KUrl m_urlOnHold;
+    QUrl m_urlOnHold;
     bool m_checkOnHold;
     bool m_ignoreConfigReparse;
 
@@ -688,20 +688,20 @@ public:
     void setJobPriority(SimpleJob *job, int priority);
     void cancelJob(SimpleJob *job);
     void jobFinished(KIO::SimpleJob *job, KIO::Slave *slave);
-    void putSlaveOnHold(KIO::SimpleJob *job, const KUrl &url);
+    void putSlaveOnHold(KIO::SimpleJob *job, const QUrl &url);
     void removeSlaveOnHold();
-    Slave *getConnectedSlave(const KUrl &url, const KIO::MetaData &metaData);
+    Slave *getConnectedSlave(const QUrl &url, const KIO::MetaData &metaData);
     bool assignJobToSlave(KIO::Slave *slave, KIO::SimpleJob *job);
     bool disconnectSlave(KIO::Slave *slave);
     void checkSlaveOnHold(bool b);
     void publishSlaveOnHold();
     Slave *heldSlaveForJob(KIO::SimpleJob *job);
-    bool isSlaveOnHoldFor(const KUrl& url);
+    bool isSlaveOnHoldFor(const QUrl& url);
     void registerWindow(QWidget *wid);
     void updateInternalMetaData(SimpleJob* job);
 
-    MetaData metaDataFor(const QString &protocol, const QStringList &proxyList, \
                const KUrl &url);
-    void setupSlave(KIO::Slave *slave, const KUrl &url, const QString &protocol,
+    MetaData metaDataFor(const QString &protocol, const QStringList &proxyList, \
const QUrl &url); +    void setupSlave(KIO::Slave *slave, const QUrl &url, const \
                QString &protocol,
                     const QStringList &proxyList, bool newSlave, const KIO::MetaData \
*config = 0);  
     void slotSlaveDied(KIO::Slave *slave);
@@ -815,7 +815,7 @@ void Scheduler::jobFinished(KIO::SimpleJob *job, KIO::Slave \
*slave)  schedulerPrivate()->jobFinished(job, slave);
 }
 
-void Scheduler::putSlaveOnHold(KIO::SimpleJob *job, const KUrl &url)
+void Scheduler::putSlaveOnHold(KIO::SimpleJob *job, const QUrl &url)
 {
     schedulerPrivate()->putSlaveOnHold(job, url);
 }
@@ -830,7 +830,7 @@ void Scheduler::publishSlaveOnHold()
     schedulerPrivate()->publishSlaveOnHold();
 }
 
-bool Scheduler::isSlaveOnHoldFor(const KUrl& url)
+bool Scheduler::isSlaveOnHoldFor(const QUrl& url)
 {
     return schedulerPrivate()->isSlaveOnHoldFor(url);
 }
@@ -840,7 +840,7 @@ void Scheduler::updateInternalMetaData(SimpleJob* job)
     schedulerPrivate()->updateInternalMetaData(job);
 }
 
-KIO::Slave *Scheduler::getConnectedSlave(const KUrl &url,
+KIO::Slave *Scheduler::getConnectedSlave(const QUrl &url,
         const KIO::MetaData &config )
 {
     return schedulerPrivate()->getConnectedSlave(url, config);
@@ -1053,13 +1053,13 @@ void SchedulerPrivate::jobFinished(SimpleJob *job, Slave \
*slave)  }
 
 // static
-void setupSlave(KIO::Slave *slave, const KUrl &url, const QString &protocol,
+void setupSlave(KIO::Slave *slave, const QUrl &url, const QString &protocol,
                 const QStringList &proxyList , bool newSlave, const KIO::MetaData \
*config)  {
     schedulerPrivate()->setupSlave(slave, url, protocol, proxyList, newSlave, \
config);  }
 
-MetaData SchedulerPrivate::metaDataFor(const QString &protocol, const QStringList \
&proxyList, const KUrl &url) +MetaData SchedulerPrivate::metaDataFor(const QString \
&protocol, const QStringList &proxyList, const QUrl &url)  {
     const QString host = url.host();
     MetaData configData = SlaveConfig::self()->configData(protocol, host);
@@ -1076,7 +1076,7 @@ MetaData SchedulerPrivate::metaDataFor(const QString &protocol, \
                const QStringLis
          configData.value("EnableAutoLogin").compare("true", Qt::CaseInsensitive) == \
0 )  {
         NetRC::AutoLogin l;
-        l.login = url.user();
+        l.login = url.userName();
         bool usern = (protocol == "ftp");
         if ( NetRC::self()->lookup( url, l, usern) )
         {
@@ -1096,15 +1096,15 @@ MetaData SchedulerPrivate::metaDataFor(const QString \
&protocol, const QStringLis  return configData;
 }
 
-void SchedulerPrivate::setupSlave(KIO::Slave *slave, const KUrl &url, const QString \
&protocol, +void SchedulerPrivate::setupSlave(KIO::Slave *slave, const QUrl &url, \
                const QString &protocol,
                                   const QStringList &proxyList, bool newSlave, const \
KIO::MetaData *config)  {
     int port = url.port();
     if ( port == -1 ) // no port is -1 in QUrl, but in kde3 we used 0 and the \
kioslaves assume that.  port = 0;
     const QString host = url.host();
-    const QString user = url.user();
-    const QString passwd = url.pass();
+    const QString user = url.userName();
+    const QString passwd = url.password();
 
     if (newSlave || slave->host() != host || slave->port() != port ||
         slave->user() != user || slave->passwd() != passwd) {
@@ -1114,7 +1114,7 @@ void SchedulerPrivate::setupSlave(KIO::Slave *slave, const KUrl \
&url, const QStr  configData += *config;
 
         slave->setConfig(configData);
-        slave->setProtocol(url.protocol());
+        slave->setProtocol(url.scheme());
         slave->setHost(host, port, user, passwd);
     }
 }
@@ -1145,13 +1145,13 @@ void SchedulerPrivate::slotSlaveDied(KIO::Slave *slave)
     slave->deref(); // Delete slave
 }
 
-void SchedulerPrivate::putSlaveOnHold(KIO::SimpleJob *job, const KUrl &url)
+void SchedulerPrivate::putSlaveOnHold(KIO::SimpleJob *job, const QUrl &url)
 {
     Slave *slave = jobSlave(job);
     kDebug(7006) << job << url << slave;
     slave->disconnect(job);
     // prevent the fake death of the slave from trying to kill the job again;
-    // cf. Slave::hold(const KUrl &url) called in \
SchedulerPrivate::publishSlaveOnHold(). +    // cf. Slave::hold(const QUrl &url) \
called in SchedulerPrivate::publishSlaveOnHold().  slave->setJob(0);
     SimpleJobPrivate::get(job)->m_slave = 0;
 
@@ -1173,7 +1173,7 @@ void SchedulerPrivate::publishSlaveOnHold()
     emit q->slaveOnHoldListChanged();
 }
 
-bool SchedulerPrivate::isSlaveOnHoldFor(const KUrl& url)
+bool SchedulerPrivate::isSlaveOnHoldFor(const QUrl& url)
 {
     if (url.isValid() && m_urlOnHold.isValid() && url == m_urlOnHold)
         return true;
@@ -1233,7 +1233,7 @@ void SchedulerPrivate::removeSlaveOnHold()
     m_urlOnHold.clear();
 }
 
-Slave *SchedulerPrivate::getConnectedSlave(const KUrl &url, const KIO::MetaData \
&config) +Slave *SchedulerPrivate::getConnectedSlave(const QUrl &url, const \
KIO::MetaData &config)  {
     QStringList proxyList;
     const QString protocol = KProtocolManager::slaveProtocol(url, proxyList);
@@ -1366,15 +1366,15 @@ void SchedulerPrivate::updateInternalMetaData(SimpleJob* job)
     KIO::SimpleJobPrivate *const jobPriv = SimpleJobPrivate::get(job);
     // Preserve all internal meta-data so they can be sent back to the
     // ioslaves as needed...
-    const KUrl jobUrl = job->url();
+    const QUrl jobUrl = job->url();
     kDebug(7006) << job << jobPriv->m_internalMetaData;
     QMapIterator<QString, QString> it (jobPriv->m_internalMetaData);
     while (it.hasNext()) {
         it.next();
         if (it.key().startsWith(QLatin1String("{internal~currenthost}"), \
                Qt::CaseInsensitive)) {
-            SlaveConfig::self()->setConfigData(jobUrl.protocol(), jobUrl.host(), \
it.key().mid(22), it.value()); +            \
SlaveConfig::self()->setConfigData(jobUrl.scheme(), jobUrl.host(), it.key().mid(22), \
                it.value());
         } else if (it.key().startsWith(QLatin1String("{internal~allhosts}"), \
                Qt::CaseInsensitive)) {
-            SlaveConfig::self()->setConfigData(jobUrl.protocol(), QString(), \
it.key().mid(19), it.value()); +            \
SlaveConfig::self()->setConfigData(jobUrl.scheme(), QString(), it.key().mid(19), \
it.value());  }
     }
 }
diff --git a/kio/kio/scheduler.h b/kio/kio/scheduler.h
index 4466759..68daca1 100644
--- a/kio/kio/scheduler.h
+++ b/kio/kio/scheduler.h
@@ -49,7 +49,7 @@ namespace KIO {
      *
      * Example:
      * \code
-     *    TransferJob *job = KIO::get(KUrl("http://www.kde.org"));
+     *    TransferJob *job = KIO::get(QUrl("http://www.kde.org"));
      * \endcode
      *
      *
@@ -62,7 +62,7 @@ namespace KIO {
      *
      * Example:
      * \code
-     *    TransferJob *job = KIO::get(KUrl("http://www.kde.org"));
+     *    TransferJob *job = KIO::get(QUrl("http://www.kde.org"));
      *    KIO::Scheduler::setJobPriority(job, 1);
      * \endcode
      *
@@ -79,15 +79,15 @@ namespace KIO {
      * Example:
      * \code
      *    Slave *slave = KIO::Scheduler::getConnectedSlave(
-     *            KUrl("pop3://bastian:password@mail.kde.org"));
+     *            QUrl("pop3://bastian:password@mail.kde.org"));
      *    TransferJob *job1 = KIO::get(
-     *            KUrl("pop3://bastian:password@mail.kde.org/msg1"));
+     *            QUrl("pop3://bastian:password@mail.kde.org/msg1"));
      *    KIO::Scheduler::assignJobToSlave(slave, job1);
      *    TransferJob *job2 = KIO::get(
-     *            KUrl("pop3://bastian:password@mail.kde.org/msg2"));
+     *            QUrl("pop3://bastian:password@mail.kde.org/msg2"));
      *    KIO::Scheduler::assignJobToSlave(slave, job2);
      *    TransferJob *job3 = KIO::get(
-     *            KUrl("pop3://bastian:password@mail.kde.org/msg3"));
+     *            QUrl("pop3://bastian:password@mail.kde.org/msg3"));
      *    KIO::Scheduler::assignJobToSlave(slave, job3);
      *
      *    // ... Wait for jobs to finish...
@@ -163,7 +163,7 @@ namespace KIO {
          * @param job the job that should be stopped
          * @param url the URL that is handled by the @p url
          */
-        static void putSlaveOnHold(KIO::SimpleJob *job, const KUrl &url);
+        static void putSlaveOnHold(KIO::SimpleJob *job, const QUrl &url);
 
         /**
          * Removes any slave that might have been put on hold. If a slave
@@ -189,7 +189,7 @@ namespace KIO {
          * @see assignJobToSlave()
          * @see disconnectSlave()
          */
-        static KIO::Slave *getConnectedSlave(const KUrl &url,
+        static KIO::Slave *getConnectedSlave(const QUrl &url,
                 const KIO::MetaData &config = MetaData() );
 
         /**
@@ -271,7 +271,7 @@ namespace KIO {
          *
          * @since 4.7
          */
-        static bool isSlaveOnHoldFor(const KUrl& url);
+        static bool isSlaveOnHoldFor(const QUrl& url);
 
         /**
          * Updates the internal metadata from job.
diff --git a/kio/kio/scheduler_p.h b/kio/kio/scheduler_p.h
index d68f645..1246900 100644
--- a/kio/kio/scheduler_p.h
+++ b/kio/kio/scheduler_p.h
@@ -143,7 +143,7 @@ public:
     void queueJob(KIO::SimpleJob *job);
     void changeJobPriority(KIO::SimpleJob *job, int newPriority);
     void removeJob(KIO::SimpleJob *job);
-    KIO::Slave *createSlave(const QString &protocol, KIO::SimpleJob *job, const KUrl \
&url); +    KIO::Slave *createSlave(const QString &protocol, KIO::SimpleJob *job, \
const QUrl &url);  bool removeSlave (KIO::Slave *slave);
     QList<KIO::Slave *> allSlaves() const;
     ConnectedSlaveQueue m_connectedSlaveQueue;
diff --git a/kio/kio/slave.cpp b/kio/kio/slave.cpp
index b8fa3de..14526ae 100644
--- a/kio/kio/slave.cpp
+++ b/kio/kio/slave.cpp
@@ -291,7 +291,7 @@ bool Slave::isAlive()
     return !d->dead;
 }
 
-void Slave::hold(const KUrl &url)
+void Slave::hold(const QUrl &url)
 {
     Q_D(Slave);
     ref();
@@ -407,7 +407,7 @@ void Slave::setConfig(const MetaData &config)
     d->connection->send( CMD_CONFIG, data );
 }
 
-Slave* Slave::createSlave( const QString &protocol, const KUrl& url, int& error, \
QString& error_text ) +Slave* Slave::createSlave( const QString &protocol, const \
QUrl& url, int& error, QString& error_text )  {
     kDebug(7002) << "createSlave" << protocol << "for" << url;
     // Firstly take into account all special slaves
@@ -481,7 +481,7 @@ Slave* Slave::createSlave( const QString &protocol, const KUrl& \
url, int& error,  return slave;
 }
 
-Slave* Slave::holdSlave( const QString &protocol, const KUrl& url )
+Slave* Slave::holdSlave(const QString &protocol, const QUrl& url)
 {
     //kDebug(7002) << "holdSlave" << protocol << "for" << url;
     // Firstly take into account all special slaves
@@ -489,7 +489,7 @@ Slave* Slave::holdSlave( const QString &protocol, const KUrl& url \
)  return 0;
     Slave *slave = new Slave(protocol);
     QUrl slaveAddress = slave->d_func()->slaveconnserver->address();
-    QDBusReply<int> reply = \
KToolInvocation::klauncher()->requestHoldSlave(url.url(), slaveAddress.toString()); + \
QDBusReply<int> reply = \
KToolInvocation::klauncher()->requestHoldSlave(url.toString(), \
slaveAddress.toString());  if (!reply.isValid()) {
         delete slave;
         return 0;
@@ -505,8 +505,8 @@ Slave* Slave::holdSlave( const QString &protocol, const KUrl& url \
)  return slave;
 }
 
-bool Slave::checkForHeldSlave(const KUrl &url)
+bool Slave::checkForHeldSlave(const QUrl &url)
 {
-    return KToolInvocation::klauncher()->checkForHeldSlave(url.url());
+    return KToolInvocation::klauncher()->checkForHeldSlave(url.toString());
 }
 
diff --git a/kio/kio/slave.h b/kio/kio/slave.h
index d9e6441..fb39cd0 100644
--- a/kio/kio/slave.h
+++ b/kio/kio/slave.h
@@ -142,20 +142,20 @@ public:
    *
    * @return 0 on failure, or a pointer to a slave otherwise.
    */
-  static Slave* createSlave( const QString &protocol, const KUrl& url, int& error, \
QString& error_text ); +  static Slave* createSlave( const QString &protocol, const \
QUrl& url, int& error, QString& error_text );  
   /**
    * Requests a slave on hold for ths url, from klauncher, if there is such a job.
    * See hold()
    */
-  static Slave* holdSlave( const QString &protocol, const KUrl& url );
+  static Slave* holdSlave( const QString &protocol, const QUrl& url );
 
   /**
    * Returns true if klauncher is holding a slave for @p url.
    *
    * @since 4.7
    */
-  static bool checkForHeldSlave(const KUrl& url);
+  static bool checkForHeldSlave(const QUrl& url);
 
   // == communication with connected kioslave ==
   // whenever possible prefer these methods over the respective
@@ -192,7 +192,7 @@ public:
    * this method, and the final application can continue the same download by \
                requesting
    * the same URL.
    */
-  virtual void hold(const KUrl &url); // TODO KDE5: no reason to be virtual
+  void hold(const QUrl &url);
 
   /**
    * @return The time this slave has been idle.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic