[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdelibs/frameworks] /: KUrl -> QUrl
From: David Faure <faure () kde ! org>
Date: 2012-04-30 20:34:50
Message-ID: 20120430203450.5482AA60A9 () git ! kde ! org
[Download RAW message or body]
Git commit 0c2b34be7f84efc1051ea614abe644503e5984f6 by David Faure.
Committed on 30/04/2012 at 22:35.
Pushed by dfaure into branch 'frameworks'.
KUrl -> QUrl
M +28 -28 kio/kio/job.cpp
M +10 -10 kio/kio/job_p.h
M +9 -9 kio/kio/jobclasses.h
M +2 -2 kio/kio/kdirlister.cpp
M +1 -1 kio/kio/kdirlister_p.h
M +1 -1 knewstuff/knewstuff3/core/installation.cpp
M +1 -1 plasma/containment.cpp
http://commits.kde.org/kdelibs/0c2b34be7f84efc1051ea614abe644503e5984f6
diff --git a/kio/kio/job.cpp b/kio/kio/job.cpp
index 3f3bfe6..4d221af 100644
--- a/kio/kio/job.cpp
+++ b/kio/kio/job.cpp
@@ -336,7 +336,7 @@ bool SimpleJob::doResume()
return Job::doResume();
}
-const KUrl& SimpleJob::url() const
+const QUrl& SimpleJob::url() const
{
return d_func()->m_url;
}
@@ -542,7 +542,7 @@ void SimpleJobPrivate::slotSpeed( unsigned long speed )
q_func()->emitSpeed( speed );
}
-void SimpleJobPrivate::restartAfterRedirection(KUrl *redirectionUrl)
+void SimpleJobPrivate::restartAfterRedirection(QUrl *redirectionUrl)
{
Q_Q(SimpleJob);
// Return slave to the scheduler while we still have the old URL in place; the \
scheduler @@ -576,7 +576,7 @@ void SimpleJob::slotMetaData( const KIO::MetaData \
&_metaData ) }
}
-void SimpleJob::storeSSLSessionFromJob(const KUrl &redirectionURL)
+void SimpleJob::storeSSLSessionFromJob(const QUrl &redirectionURL)
{
Q_UNUSED(redirectionURL);
}
@@ -634,7 +634,7 @@ SimpleJob *KIO::mount( bool ro, const QByteArray& fstype, const \
QString& dev, co {
KIO_ARGS << int(1) << qint8( ro ? 1 : 0 )
<< QString::fromLatin1(fstype) << dev << point;
- SimpleJob *job = special( KUrl("file:/"), packedArgs, flags );
+ SimpleJob *job = special(QUrl("file:///"), packedArgs, flags);
if (!(flags & HideProgressInfo)) {
KIO::JobPrivate::emitMounting(job, dev, point);
}
@@ -644,7 +644,7 @@ SimpleJob *KIO::mount( bool ro, const QByteArray& fstype, const \
QString& dev, co SimpleJob *KIO::unmount( const QString& point, JobFlags flags )
{
KIO_ARGS << int(2) << point;
- SimpleJob *job = special( KUrl("file:/"), packedArgs, flags );
+ SimpleJob *job = special(QUrl("file:///"), packedArgs, flags);
if (!(flags & HideProgressInfo)) {
KIO::JobPrivate::emitUnmounting(job, point);
}
@@ -658,7 +658,7 @@ SimpleJob *KIO::unmount( const QString& point, JobFlags flags )
class KIO::StatJobPrivate: public SimpleJobPrivate
{
public:
- inline StatJobPrivate(const KUrl& url, int command, const QByteArray \
&packedArgs) + inline StatJobPrivate(const QUrl& url, int command, const \
QByteArray &packedArgs)
: SimpleJobPrivate(url, command, packedArgs), m_bSource(true), m_details(2)
{}
@@ -679,7 +679,7 @@ public:
Q_DECLARE_PUBLIC(StatJob)
- static inline StatJob *newJob(const KUrl& url, int command, const QByteArray \
&packedArgs, + static inline StatJob *newJob(const QUrl& url, int command, const \
QByteArray &packedArgs, JobFlags flags )
{
StatJob *job = new StatJob(*new StatJobPrivate(url, command, packedArgs));
@@ -723,13 +723,13 @@ const UDSEntry & StatJob::statResult() const
return d_func()->m_statResult;
}
-KUrl StatJob::mostLocalUrl() const
+QUrl StatJob::mostLocalUrl() const
{
if (!url().isLocalFile()) {
const UDSEntry& udsEntry = d_func()->m_statResult;
const QString path = udsEntry.stringValue( KIO::UDSEntry::UDS_LOCAL_PATH );
if (!path.isEmpty())
- return KUrl(path);
+ return QUrl::fromLocalFile(path);
}
return url();
}
@@ -1255,13 +1255,13 @@ TransferJob *KIO::get( const QUrl& url, LoadType reload, \
JobFlags flags ) class KIO::StoredTransferJobPrivate: public TransferJobPrivate
{
public:
- StoredTransferJobPrivate(const KUrl& url, int command,
+ StoredTransferJobPrivate(const QUrl& url, int command,
const QByteArray &packedArgs,
const QByteArray &_staticData)
: TransferJobPrivate(url, command, packedArgs, _staticData),
m_uploadOffset( 0 )
{}
- StoredTransferJobPrivate(const KUrl& url, int command,
+ StoredTransferJobPrivate(const QUrl& url, int command,
const QByteArray &packedArgs,
QIODevice* ioDevice)
: TransferJobPrivate(url, command, packedArgs, ioDevice),
@@ -1276,7 +1276,7 @@ public:
Q_DECLARE_PUBLIC(StoredTransferJob)
- static inline StoredTransferJob *newJob(const KUrl &url, int command,
+ static inline StoredTransferJob *newJob(const QUrl &url, int command,
const QByteArray &packedArgs,
const QByteArray &staticData, JobFlags \
flags) {
@@ -1288,7 +1288,7 @@ public:
return job;
}
- static inline StoredTransferJob *newJob(const KUrl &url, int command,
+ static inline StoredTransferJob *newJob(const QUrl &url, int command,
const QByteArray &packedArgs,
QIODevice* ioDevice, JobFlags flags)
{
@@ -1676,13 +1676,13 @@ StoredTransferJob *KIO::storedPut( const QByteArray& arr, \
const QUrl& url, int p class KIO::MimetypeJobPrivate: public KIO::TransferJobPrivate
{
public:
- MimetypeJobPrivate(const KUrl& url, int command, const QByteArray &packedArgs)
+ MimetypeJobPrivate(const QUrl& url, int command, const QByteArray &packedArgs)
: TransferJobPrivate(url, command, packedArgs, QByteArray())
{}
Q_DECLARE_PUBLIC(MimetypeJob)
- static inline MimetypeJob *newJob(const KUrl& url, int command, const QByteArray \
&packedArgs, + static inline MimetypeJob *newJob(const QUrl& url, int command, \
const QByteArray &packedArgs, JobFlags flags)
{
MimetypeJob *job = new MimetypeJob(*new MimetypeJobPrivate(url, command, \
packedArgs)); @@ -1753,7 +1753,7 @@ MimetypeJob *KIO::mimetype(const QUrl& url, \
JobFlags flags) class KIO::DirectCopyJobPrivate: public KIO::SimpleJobPrivate
{
public:
- DirectCopyJobPrivate(const KUrl& url, int command, const QByteArray &packedArgs)
+ DirectCopyJobPrivate(const QUrl& url, int command, const QByteArray &packedArgs)
: SimpleJobPrivate(url, command, packedArgs)
{}
@@ -1768,7 +1768,7 @@ public:
Q_DECLARE_PUBLIC(DirectCopyJob)
};
-DirectCopyJob::DirectCopyJob(const KUrl &url, const QByteArray &packedArgs)
+DirectCopyJob::DirectCopyJob(const QUrl &url, const QByteArray &packedArgs)
: SimpleJob(*new DirectCopyJobPrivate(url, CMD_COPY, packedArgs))
{
setUiDelegate(new JobUiDelegate);
@@ -1797,7 +1797,7 @@ void DirectCopyJob::slotCanResume( KIO::filesize_t offset )
class KIO::FileCopyJobPrivate: public KIO::JobPrivate
{
public:
- FileCopyJobPrivate(const KUrl& src, const KUrl& dest, int permissions,
+ FileCopyJobPrivate(const QUrl& src, const QUrl& dest, int permissions,
bool move, JobFlags flags)
: m_sourceSize(filesize_t(-1)), m_src(src), m_dest(dest), m_moveJob(0), \
m_copyJob(0), m_delJob(0),
m_chmodJob(0), m_getJob(0), m_putJob(0), m_permissions(permissions),
@@ -1860,13 +1860,13 @@ public:
Q_DECLARE_PUBLIC(FileCopyJob)
- static inline FileCopyJob* newJob(const KUrl& src, const KUrl& dest, int \
permissions, bool move, + static inline FileCopyJob* newJob(const QUrl& src, const \
QUrl& dest, int permissions, bool move, JobFlags flags)
{
//kDebug(7007) << src << "->" << dest;
FileCopyJob *job = new FileCopyJob(
*new FileCopyJobPrivate(src, dest, permissions, move, flags));
- job->setProperty("destUrl", dest.url());
+ job->setProperty("destUrl", dest.toString());
job->setUiDelegate(new JobUiDelegate);
if (!(flags & HideProgressInfo))
KIO::getJobTracker()->registerJob(job);
@@ -1968,12 +1968,12 @@ void FileCopyJob::setModificationTime( const QDateTime& mtime \
) d->m_modificationTime = mtime;
}
-KUrl FileCopyJob::srcUrl() const
+QUrl FileCopyJob::srcUrl() const
{
return d_func()->m_src;
}
-KUrl FileCopyJob::destUrl() const
+QUrl FileCopyJob::destUrl() const
{
return d_func()->m_dest;
}
@@ -2376,7 +2376,7 @@ SimpleJob *KIO::file_delete( const QUrl& src, JobFlags flags )
class KIO::ListJobPrivate: public KIO::SimpleJobPrivate
{
public:
- ListJobPrivate(const KUrl& url, bool _recursive, const QString &_prefix, bool \
_includeHidden) + ListJobPrivate(const QUrl& url, bool _recursive, const QString \
&_prefix, bool _includeHidden) : SimpleJobPrivate(url, CMD_LISTDIR, QByteArray()),
recursive(_recursive), includeHidden(_includeHidden),
prefix(_prefix), m_processedEntries(0)
@@ -2401,7 +2401,7 @@ public:
Q_DECLARE_PUBLIC(ListJob)
- static inline ListJob *newJob(const KUrl& u, bool _recursive, const QString \
&_prefix, + static inline ListJob *newJob(const QUrl& u, bool _recursive, const \
QString &_prefix,
bool _includeHidden, JobFlags flags = \
HideProgressInfo) {
ListJob *job = new ListJob(*new ListJobPrivate(u, _recursive, _prefix, \
_includeHidden)); @@ -2410,7 +2410,7 @@ public:
KIO::getJobTracker()->registerJob(job);
return job;
}
- static inline ListJob *newJobNoUi(const KUrl& u, bool _recursive, const QString \
&_prefix, + static inline ListJob *newJobNoUi(const QUrl& u, bool _recursive, \
const QString &_prefix, bool _includeHidden)
{
return new ListJob(*new ListJobPrivate(u, _recursive, _prefix, \
_includeHidden)); @@ -2624,7 +2624,7 @@ void ListJobPrivate::start(Slave *slave)
SimpleJobPrivate::start(slave);
}
-const KUrl& ListJob::redirectionUrl() const
+const QUrl& ListJob::redirectionUrl() const
{
return d_func()->m_redirectionURL;
}
@@ -2685,7 +2685,7 @@ MultiGetJob::~MultiGetJob()
{
}
-void MultiGetJob::get(long id, const KUrl &url, const MetaData &metaData)
+void MultiGetJob::get(long id, const QUrl &url, const MetaData &metaData)
{
Q_D(MultiGetJob);
MultiGetJobPrivate::GetRequest entry(id, url, metaData);
@@ -2870,7 +2870,7 @@ class KIO::SpecialJobPrivate: public TransferJobPrivate
{}
};
-SpecialJob::SpecialJob(const KUrl &url, const QByteArray &packedArgs)
+SpecialJob::SpecialJob(const QUrl &url, const QByteArray &packedArgs)
: TransferJob(*new TransferJobPrivate(url, CMD_SPECIAL, packedArgs, \
QByteArray())) {
}
diff --git a/kio/kio/job_p.h b/kio/kio/job_p.h
index 0bffebb..a448cf3 100644
--- a/kio/kio/job_p.h
+++ b/kio/kio/job_p.h
@@ -84,7 +84,7 @@ namespace KIO {
* @param command the command of the job
* @param packedArgs the arguments
*/
- SimpleJobPrivate(const KUrl& url, int command, const QByteArray &packedArgs)
+ SimpleJobPrivate(const QUrl& url, int command, const QByteArray &packedArgs)
: m_slave(0), m_packedArgs(packedArgs), m_url(url), m_command(command),
m_checkOnHold(false), m_schedSerial(0), \
m_redirectionHandlingEnabled(true) {
@@ -176,18 +176,18 @@ namespace KIO {
* The m_redirectionURL data member can appear in several subclasses, so we \
have it
* passed in. The regular URL will be set to the redirection URL which is \
then cleared.
*/
- void restartAfterRedirection(KUrl *redirectionUrl);
+ void restartAfterRedirection(QUrl *redirectionUrl);
Q_DECLARE_PUBLIC(SimpleJob)
static inline SimpleJobPrivate *get(KIO::SimpleJob *job)
{ return job->d_func(); }
- static inline SimpleJob *newJobNoUi(const KUrl& url, int command, const \
QByteArray &packedArgs) + static inline SimpleJob *newJobNoUi(const QUrl& url, \
int command, const QByteArray &packedArgs) {
SimpleJob *job = new SimpleJob(*new SimpleJobPrivate(url, command, \
packedArgs)); return job;
}
- static inline SimpleJob *newJob(const KUrl& url, int command, const \
QByteArray &packedArgs, + static inline SimpleJob *newJob(const QUrl& url, int \
command, const QByteArray &packedArgs,
JobFlags flags = HideProgressInfo )
{
SimpleJob *job = new SimpleJob(*new SimpleJobPrivate(url, command, \
packedArgs)); @@ -201,14 +201,14 @@ namespace KIO {
class TransferJobPrivate: public SimpleJobPrivate
{
public:
- inline TransferJobPrivate(const KUrl& url, int command, const QByteArray \
&packedArgs, + inline TransferJobPrivate(const QUrl& url, int command, const \
QByteArray &packedArgs, const QByteArray &_staticData)
: SimpleJobPrivate(url, command, packedArgs),
m_internalSuspended(false), m_errorPage(false),
staticData(_staticData), m_isMimetypeEmitted(false), m_subJob(0)
{ }
- inline TransferJobPrivate(const KUrl& url, int command, const QByteArray \
&packedArgs, + inline TransferJobPrivate(const QUrl& url, int command, const \
QByteArray &packedArgs, QIODevice* ioDevice)
: SimpleJobPrivate(url, command, packedArgs),
m_internalSuspended(false), m_errorPage(false),
@@ -219,7 +219,7 @@ namespace KIO {
bool m_internalSuspended;
bool m_errorPage;
QByteArray staticData;
- KUrl m_redirectionURL;
+ QUrl m_redirectionURL;
KUrl::List m_redirectionList;
QString m_mimetype;
bool m_isMimetypeEmitted;
@@ -256,7 +256,7 @@ namespace KIO {
void slotSubUrlData(KIO::Job*, const QByteArray &);
Q_DECLARE_PUBLIC(TransferJob)
- static inline TransferJob *newJob(const KUrl& url, int command,
+ static inline TransferJob *newJob(const QUrl& url, int command,
const QByteArray &packedArgs,
const QByteArray &_staticData,
JobFlags flags)
@@ -268,7 +268,7 @@ namespace KIO {
return job;
}
- static inline TransferJob *newJob(const KUrl& url, int command,
+ static inline TransferJob *newJob(const QUrl& url, int command,
const QByteArray &packedArgs,
QIODevice* ioDevice,
JobFlags flags)
@@ -291,7 +291,7 @@ namespace KIO {
Q_OBJECT
public:
- DirectCopyJob(const KUrl &url, const QByteArray &packedArgs);
+ DirectCopyJob(const QUrl &url, const QByteArray &packedArgs);
~DirectCopyJob();
public Q_SLOTS:
diff --git a/kio/kio/jobclasses.h b/kio/kio/jobclasses.h
index daafb40..607c6ed 100644
--- a/kio/kio/jobclasses.h
+++ b/kio/kio/jobclasses.h
@@ -349,7 +349,7 @@ namespace KIO {
* Returns the SimpleJob's URL
* @return the url
*/
- const KUrl& url() const;
+ const QUrl& url() const;
/**
* Abort job.
@@ -415,7 +415,7 @@ namespace KIO {
* @param m_redirectionURL Reference to redirection URL,
* used instead of m_url if not empty
*/
- void storeSSLSessionFromJob(const KUrl &m_redirectionURL);
+ void storeSSLSessionFromJob(const QUrl &m_redirectionURL);
/**
* Creates a new simple job. You don't need to use this constructor,
@@ -504,14 +504,14 @@ namespace KIO {
* if (job->error()) {
* [...] // doesn't exist
* } else {
- * const KUrl localUrl = job->mostLocalUrl();
+ * const QUrl localUrl = job->mostLocalUrl();
* // localUrl = file:///$HOME/Desktop/foo
* [...]
* }
*
* \since 4.4
*/
- KUrl mostLocalUrl() const;
+ QUrl mostLocalUrl() const;
Q_SIGNALS:
/**
@@ -788,7 +788,7 @@ namespace KIO {
* @param url the url of the file to get
* @param metaData the meta data for this request
*/
- void get(long id, const KUrl &url, const MetaData &metaData);
+ void get(long id, const QUrl &url, const MetaData &metaData);
Q_SIGNALS:
/**
@@ -878,13 +878,13 @@ namespace KIO {
* Returns the source URL.
* @return the source URL
*/
- KUrl srcUrl() const;
+ QUrl srcUrl() const;
/**
* Returns the destination URL.
* @return the destination URL
*/
- KUrl destUrl() const;
+ QUrl destUrl() const;
bool doSuspend();
bool doResume();
@@ -944,7 +944,7 @@ namespace KIO {
* was no redirection.
* @return the redirection url
*/
- const KUrl& redirectionUrl() const;
+ const QUrl& redirectionUrl() const;
/**
* Do not apply any KIOSK restrictions to this job.
@@ -1018,7 +1018,7 @@ namespace KIO {
* @param url the URL to be passed to the ioslave
* @param data the data to be sent to the SlaveBase::special() function.
*/
- explicit SpecialJob(const KUrl &url, const QByteArray &data = QByteArray());
+ explicit SpecialJob(const QUrl &url, const QByteArray &data = QByteArray());
/**
* Sets the QByteArray that is passed to SlaveBase::special() on
diff --git a/kio/kio/kdirlister.cpp b/kio/kio/kdirlister.cpp
index 84c3a02..86033b3 100644
--- a/kio/kio/kdirlister.cpp
+++ b/kio/kio/kdirlister.cpp
@@ -1822,14 +1822,14 @@ KIO::ListJob *KDirListerCache::jobForUrl( const QString& url, \
KIO::ListJob *not_ while ( it != runningListJobs.constEnd() )
{
KIO::ListJob *job = it.key();
- if ( joburl( job ).url(KUrl::RemoveTrailingSlash) == url && job != not_job )
+ if (joburl(job).toString(QUrl::StripTrailingSlash) == url && job != not_job)
return job;
++it;
}
return 0;
}
-const KUrl& KDirListerCache::joburl( KIO::ListJob *job )
+const QUrl& KDirListerCache::joburl( KIO::ListJob *job )
{
if ( job->redirectionUrl().isValid() )
return job->redirectionUrl();
diff --git a/kio/kio/kdirlister_p.h b/kio/kio/kdirlister_p.h
index 267df1c..f2140ac 100644
--- a/kio/kio/kdirlister_p.h
+++ b/kio/kio/kdirlister_p.h
@@ -265,7 +265,7 @@ private:
void stopListJob(const QString& url, bool silent);
KIO::ListJob *jobForUrl( const QString& url, KIO::ListJob *not_job = 0 );
- const KUrl& joburl( KIO::ListJob *job );
+ const QUrl& joburl( KIO::ListJob *job );
void killJob( KIO::ListJob *job );
diff --git a/knewstuff/knewstuff3/core/installation.cpp \
b/knewstuff/knewstuff3/core/installation.cpp index cc2e481..17cc3bb 100644
--- a/knewstuff/knewstuff3/core/installation.cpp
+++ b/knewstuff/knewstuff3/core/installation.cpp
@@ -207,7 +207,7 @@ void Installation::slotPayloadResult(KJob *job)
if (mimeType->is("text/html") || mimeType->is("application/x-php")) \
{ if (KMessageBox::questionYesNo(0, i18n("The downloaded file is a html file. This \
indicates a link to a website instead of the actual download. Would you like to open \
the site with a browser instead?"), i18n("Possibly bad download link")) == \
KMessageBox::Yes) {
- KToolInvocation::invokeBrowser(fcjob->srcUrl().url());
+ KToolInvocation::invokeBrowser(fcjob->srcUrl().toString());
emit signalInstallationFailed(i18n("Downloaded file was a \
HTML file. Opened in browser.")); entry.setStatus(Entry::Invalid);
emit signalEntryChanged(entry);
diff --git a/plasma/containment.cpp b/plasma/containment.cpp
index a93e8b3..627c13c 100644
--- a/plasma/containment.cpp
+++ b/plasma/containment.cpp
@@ -1514,7 +1514,7 @@ void ContainmentPrivate::mimeTypeRetrieved(KIO::Job *job, const \
QString &mimeTyp }
QVariantList args;
- args << tjob->url().url() << mimeType;
+ args << tjob->url().toString() << mimeType;
#ifndef NDEBUG
kDebug() << "Creating menu for:" << mimeType << posi << args;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic