KUrl::List -> QList<QUrl> everywhere. Make KDirNotify API take urls, to avoid conversions in the caller.

DBus, however, needs QList<QUrl> <-> QStringList conversions, which is why
both nepomuk and now KIO have methods for this... => submitted to Qt5's QUrl.
This commit is contained in:
David Faure 2012-07-15 22:28:17 +02:00
parent e3e6489165
commit 68a7db068b
6 changed files with 13 additions and 13 deletions

View File

@ -1481,7 +1481,7 @@ void Applet::setAssociatedApplication(const QString &string)
} }
} }
void Applet::setAssociatedApplicationUrls(const KUrl::List &urls) void Applet::setAssociatedApplicationUrls(const QList<QUrl> &urls)
{ {
AssociatedApplicationManager::self()->setUrls(this, urls); AssociatedApplicationManager::self()->setUrls(this, urls);
@ -1499,7 +1499,7 @@ QString Applet::associatedApplication() const
return AssociatedApplicationManager::self()->application(this); return AssociatedApplicationManager::self()->application(this);
} }
KUrl::List Applet::associatedApplicationUrls() const QList<QUrl> Applet::associatedApplicationUrls() const
{ {
return AssociatedApplicationManager::self()->urls(this); return AssociatedApplicationManager::self()->urls(this);
} }

View File

@ -599,7 +599,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
* *
* @param urls * @param urls
*/ */
void setAssociatedApplicationUrls(const KUrl::List &urls); void setAssociatedApplicationUrls(const QList<QUrl> &urls);
/** /**
* @return the application associated to this applet * @return the application associated to this applet
@ -611,7 +611,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
* @return the urls associated to this applet * @return the urls associated to this applet
* @since 4.4 * @since 4.4
*/ */
KUrl::List associatedApplicationUrls() const; QList<QUrl> associatedApplicationUrls() const;
/** /**
* @return true if the applet has a valid associated application or urls * @return true if the applet has a valid associated application or urls

View File

@ -323,7 +323,7 @@ void ConfigLoaderHandler::addItem()
} else if (m_type == "urllist") { } else if (m_type == "urllist") {
//FIXME: the split() is naive and will break on lists with ,'s in them //FIXME: the split() is naive and will break on lists with ,'s in them
QStringList tmpList = m_default.split(","); QStringList tmpList = m_default.split(",");
KUrl::List defaultList; QList<QUrl> defaultList;
foreach (const QString& tmp, tmpList) { foreach (const QString& tmp, tmpList) {
defaultList.append(KUrl(tmp)); defaultList.append(KUrl(tmp));
} }

View File

@ -58,7 +58,7 @@ public:
} }
QHash<const Plasma::Applet *, QString> applicationNames; QHash<const Plasma::Applet *, QString> applicationNames;
QHash<const Plasma::Applet *, KUrl::List> urlLists; QHash<const Plasma::Applet *, QList<QUrl> > urlLists;
}; };
class AssociatedApplicationManagerSingleton class AssociatedApplicationManagerSingleton
@ -102,12 +102,12 @@ QString AssociatedApplicationManager::application(const Plasma::Applet *applet)
return d->applicationNames.value(applet); return d->applicationNames.value(applet);
} }
void AssociatedApplicationManager::setUrls(Plasma::Applet *applet, const KUrl::List &urls) void AssociatedApplicationManager::setUrls(Plasma::Applet *applet, const QList<QUrl> &urls)
{ {
d->urlLists[applet] = urls; d->urlLists[applet] = urls;
} }
KUrl::List AssociatedApplicationManager::urls(const Plasma::Applet *applet) const QList<QUrl> AssociatedApplicationManager::urls(const Plasma::Applet *applet) const
{ {
return d->urlLists.value(applet); return d->urlLists.value(applet);
} }

View File

@ -43,9 +43,9 @@ public:
QString application(const Plasma::Applet *applet) const; QString application(const Plasma::Applet *applet) const;
//sets the urls associated to an applet //sets the urls associated to an applet
void setUrls(Plasma::Applet *applet, const KUrl::List &urls); void setUrls(Plasma::Applet *applet, const QList<QUrl> &urls);
//returns the urls associated to an applet //returns the urls associated to an applet
KUrl::List urls(const Plasma::Applet *applet) const; QList<QUrl> urls(const Plasma::Applet *applet) const;
//run the associated application or the urls if no app is associated //run the associated application or the urls if no app is associated
void run(Plasma::Applet *applet); void run(Plasma::Applet *applet);

View File

@ -166,9 +166,9 @@ class ConfigLoaderPrivate
return v; return v;
} }
KUrl::List *newUrlList() QList<QUrl> *newUrlList()
{ {
KUrl::List *v = new KUrl::List; QList<QUrl> *v = new QList<QUrl>();
urllists.append(v); urllists.append(v);
return v; return v;
} }
@ -210,7 +210,7 @@ class ConfigLoaderPrivate
QList<QRect *> rects; QList<QRect *> rects;
QList<QSize *> sizes; QList<QSize *> sizes;
QList<quint64 *> ulonglongs; QList<quint64 *> ulonglongs;
QList<KUrl::List *> urllists; QList<QList<QUrl> *> urllists;
QString baseGroup; QString baseGroup;
QStringList groups; QStringList groups;
QHash<QString, QString> keysToNames; QHash<QString, QString> keysToNames;