From kde-commits Mon Apr 30 23:22:56 2012 From: David Faure Date: Mon, 30 Apr 2012 23:22:56 +0000 To: kde-commits Subject: [kdelibs/frameworks] kio/kio: KUrl -> QUrl Message-Id: <20120430232256.B730CA60A9 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=133582831511222 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 > m_visitedInodes; // device -> set of inod= es = - 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 =3D new DirectorySizeJobPrivate; DirectorySizeJob *job =3D new DirectorySizeJob(*d); @@ -116,8 +116,7 @@ void DirectorySizeJobPrivate::processNextItem() if ( item.isDir() ) { //kDebug(7007) << "dir -> listing"; - KUrl url =3D 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 co= nsistent 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_si= ze(0) {} = @@ -60,7 +60,7 @@ public: = Q_DECLARE_PUBLIC(FileJob) = - static inline FileJob *newJob(const KUrl &url, const QByteArray &packe= dArgs) + static inline FileJob *newJob(const QUrl &url, const QByteArray &packe= dArgs) { FileJob *job =3D 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 #include = 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 handl= ed 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 &d= est) +// 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 &d= est) { 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 opera= tion", "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 opera= tion", "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 &que= ue) if ((m_url.scheme() =3D=3D entry.url.scheme()) && (m_url.host() =3D=3D entry.url.host()) && (m_url.port() =3D=3D entry.url.port()) && - (m_url.user() =3D=3D entry.url.user())) + (m_url.userName() =3D=3D entry.url.userName())) { queue.append( entry ); wqit =3D 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 =3D NoRe= load, JobFlags flags =3D 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 h= andled 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 &des= t); - static void emitCopying(KIO::Job*, const KUrl &src, const KUrl &de= st); - 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 &des= t); + static void emitCopying(KIO::Job*, const QUrl &src, const QUrl &de= st); + 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 QStr= ing &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_redirectionHandlin= gEnabled(true) { +#if 0 if (m_url.hasSubUrl()) { KUrl::List list =3D KUrl::split(m_url); @@ -96,12 +97,13 @@ namespace KIO { //kDebug(7007) << "New URL =3D " << m_url.url(); //kDebug(7007) << "Sub URL =3D " << 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 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 Schedu= lerPrivate -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 =3D 0); // same reason as above static Scheduler *scheduler(); @@ -97,7 +97,7 @@ Slave *SlaveKeeper::takeSlaveForJob(SimpleJob *job) return slave; } = - KUrl url =3D SimpleJobPrivate::get(job)->m_url; + QUrl url =3D SimpleJobPrivate::get(job)->m_url; // TODO take port, username and password into account QMultiHash::Iterator it =3D m_idleSlaves.find(url.ho= st()); if (it =3D=3D m_idleSlaves.end()) { @@ -334,18 +334,18 @@ void ConnectedSlaveQueue::startRunnableJobs() Q_ASSERT(!jobs.runningJob); jobs.runningJob =3D job; = - const KUrl url =3D job->url(); + const QUrl url =3D job->url(); // no port is -1 in QUrl, but in kde3 we used 0 and the kioslaves = assume that. const int port =3D url.port() =3D=3D -1 ? 0 : url.port(); = if (slave->host() =3D=3D "") { - MetaData configData =3D SlaveConfig::self()->configData(url.pr= otocol(), url.host()); + MetaData configData =3D SlaveConfig::self()->configData(url.sc= heme(), 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() =3D=3D url.protocol()); + Q_ASSERT(slave->protocol() =3D=3D url.scheme()); Q_ASSERT(slave->host() =3D=3D url.host()); Q_ASSERT(slave->port() =3D=3D port); startJob(job, slave); @@ -528,7 +528,7 @@ void ProtoQueue::removeJob(SimpleJob *job) ensureNoDuplicates(&m_queuesBySerial); } = -Slave *ProtoQueue::createSlave(const QString &protocol, SimpleJob *job, co= nst KUrl &url) +Slave *ProtoQueue::createSlave(const QString &protocol, SimpleJob *job, co= nst 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 &metaDat= a); + Slave *getConnectedSlave(const QUrl &url, const KIO::MetaData &metaDat= a); 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 &proxy= List, const KUrl &url); - void setupSlave(KIO::Slave *slave, const KUrl &url, const QString &pro= tocol, + MetaData metaDataFor(const QString &protocol, const QStringList &proxy= List, const QUrl &url); + void setupSlave(KIO::Slave *slave, const QUrl &url, const QString &pro= tocol, const QStringList &proxyList, bool newSlave, const KIO= ::MetaData *config =3D 0); = void slotSlaveDied(KIO::Slave *slave); @@ -815,7 +815,7 @@ void Scheduler::jobFinished(KIO::SimpleJob *job, KIO::S= lave *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 &protoco= l, +void setupSlave(KIO::Slave *slave, const QUrl &url, const QString &protoco= l, const QStringList &proxyList , bool newSlave, const KIO::M= etaData *config) { schedulerPrivate()->setupSlave(slave, url, protocol, proxyList, newSla= ve, config); } = -MetaData SchedulerPrivate::metaDataFor(const QString &protocol, const QStr= ingList &proxyList, const KUrl &url) +MetaData SchedulerPrivate::metaDataFor(const QString &protocol, const QStr= ingList &proxyList, const QUrl &url) { const QString host =3D url.host(); MetaData configData =3D SlaveConfig::self()->configData(protocol, host= ); @@ -1076,7 +1076,7 @@ MetaData SchedulerPrivate::metaDataFor(const QString = &protocol, const QStringLis configData.value("EnableAutoLogin").compare("true", Qt::CaseInsen= sitive) =3D=3D 0 ) { NetRC::AutoLogin l; - l.login =3D url.user(); + l.login =3D url.userName(); bool usern =3D (protocol =3D=3D "ftp"); if ( NetRC::self()->lookup( url, l, usern) ) { @@ -1096,15 +1096,15 @@ MetaData SchedulerPrivate::metaDataFor(const QStrin= g &protocol, const QStringLis return configData; } = -void SchedulerPrivate::setupSlave(KIO::Slave *slave, const KUrl &url, cons= t QString &protocol, +void SchedulerPrivate::setupSlave(KIO::Slave *slave, const QUrl &url, cons= t QString &protocol, const QStringList &proxyList, bool newSl= ave, const KIO::MetaData *config) { int port =3D url.port(); if ( port =3D=3D -1 ) // no port is -1 in QUrl, but in kde3 we used 0 = and the kioslaves assume that. port =3D 0; const QString host =3D url.host(); - const QString user =3D url.user(); - const QString passwd =3D url.pass(); + const QString user =3D url.userName(); + const QString passwd =3D url.password(); = if (newSlave || slave->host() !=3D host || slave->port() !=3D port || slave->user() !=3D user || slave->passwd() !=3D passwd) { @@ -1114,7 +1114,7 @@ void SchedulerPrivate::setupSlave(KIO::Slave *slave, = const KUrl &url, const QStr configData +=3D *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 *sl= ave) slave->deref(); // Delete slave } = -void SchedulerPrivate::putSlaveOnHold(KIO::SimpleJob *job, const KUrl &url) +void SchedulerPrivate::putSlaveOnHold(KIO::SimpleJob *job, const QUrl &url) { Slave *slave =3D jobSlave(job); kDebug(7006) << job << url << slave; slave->disconnect(job); // prevent the fake death of the slave from trying to kill the job aga= in; - // cf. Slave::hold(const KUrl &url) called in SchedulerPrivate::publis= hSlaveOnHold(). + // cf. Slave::hold(const QUrl &url) called in SchedulerPrivate::publis= hSlaveOnHold(). slave->setJob(0); SimpleJobPrivate::get(job)->m_slave =3D 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 =3D=3D m_urlOnHold) return true; @@ -1233,7 +1233,7 @@ void SchedulerPrivate::removeSlaveOnHold() m_urlOnHold.clear(); } = -Slave *SchedulerPrivate::getConnectedSlave(const KUrl &url, const KIO::Met= aData &config) +Slave *SchedulerPrivate::getConnectedSlave(const QUrl &url, const KIO::Met= aData &config) { QStringList proxyList; const QString protocol =3D KProtocolManager::slaveProtocol(url, proxyL= ist); @@ -1366,15 +1366,15 @@ void SchedulerPrivate::updateInternalMetaData(Simpl= eJob* job) KIO::SimpleJobPrivate *const jobPriv =3D SimpleJobPrivate::get(job); // Preserve all internal meta-data so they can be sent back to the // ioslaves as needed... - const KUrl jobUrl =3D job->url(); + const QUrl jobUrl =3D job->url(); kDebug(7006) << job << jobPriv->m_internalMetaData; QMapIterator it (jobPriv->m_internalMetaData); while (it.hasNext()) { it.next(); if (it.key().startsWith(QLatin1String("{internal~currenthost}"), Q= t::CaseInsensitive)) { - SlaveConfig::self()->setConfigData(jobUrl.protocol(), jobUrl.h= ost(), it.key().mid(22), it.value()); + SlaveConfig::self()->setConfigData(jobUrl.scheme(), jobUrl.hos= t(), 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 =3D KIO::get(KUrl("http://www.kde.org")); + * TransferJob *job =3D KIO::get(QUrl("http://www.kde.org")); * \endcode * * @@ -62,7 +62,7 @@ namespace KIO { * * Example: * \code - * TransferJob *job =3D KIO::get(KUrl("http://www.kde.org")); + * TransferJob *job =3D KIO::get(QUrl("http://www.kde.org")); * KIO::Scheduler::setJobPriority(job, 1); * \endcode * @@ -79,15 +79,15 @@ namespace KIO { * Example: * \code * Slave *slave =3D KIO::Scheduler::getConnectedSlave( - * KUrl("pop3://bastian:password@mail.kde.org")); + * QUrl("pop3://bastian:password@mail.kde.org")); * TransferJob *job1 =3D 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 =3D 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 =3D 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 =3D 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 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, con= st 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 =3D new Slave(protocol); QUrl slaveAddress =3D slave->d_func()->slaveconnserver->address(); - QDBusReply reply =3D KToolInvocation::klauncher()->requestHoldSla= ve(url.url(), slaveAddress.toString()); + QDBusReply reply =3D KToolInvocation::klauncher()->requestHoldSla= ve(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 suc= h 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); = // =3D=3D communication with connected kioslave =3D=3D // 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.