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:
parent
e3e6489165
commit
68a7db068b
@ -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);
|
||||
|
||||
@ -1499,7 +1499,7 @@ QString Applet::associatedApplication() const
|
||||
return AssociatedApplicationManager::self()->application(this);
|
||||
}
|
||||
|
||||
KUrl::List Applet::associatedApplicationUrls() const
|
||||
QList<QUrl> Applet::associatedApplicationUrls() const
|
||||
{
|
||||
return AssociatedApplicationManager::self()->urls(this);
|
||||
}
|
||||
|
4
applet.h
4
applet.h
@ -599,7 +599,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
*
|
||||
* @param urls
|
||||
*/
|
||||
void setAssociatedApplicationUrls(const KUrl::List &urls);
|
||||
void setAssociatedApplicationUrls(const QList<QUrl> &urls);
|
||||
|
||||
/**
|
||||
* @return the application associated to this applet
|
||||
@ -611,7 +611,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
||||
* @return the urls associated to this applet
|
||||
* @since 4.4
|
||||
*/
|
||||
KUrl::List associatedApplicationUrls() const;
|
||||
QList<QUrl> associatedApplicationUrls() const;
|
||||
|
||||
/**
|
||||
* @return true if the applet has a valid associated application or urls
|
||||
|
@ -323,7 +323,7 @@ void ConfigLoaderHandler::addItem()
|
||||
} else if (m_type == "urllist") {
|
||||
//FIXME: the split() is naive and will break on lists with ,'s in them
|
||||
QStringList tmpList = m_default.split(",");
|
||||
KUrl::List defaultList;
|
||||
QList<QUrl> defaultList;
|
||||
foreach (const QString& tmp, tmpList) {
|
||||
defaultList.append(KUrl(tmp));
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
}
|
||||
|
||||
QHash<const Plasma::Applet *, QString> applicationNames;
|
||||
QHash<const Plasma::Applet *, KUrl::List> urlLists;
|
||||
QHash<const Plasma::Applet *, QList<QUrl> > urlLists;
|
||||
};
|
||||
|
||||
class AssociatedApplicationManagerSingleton
|
||||
@ -102,12 +102,12 @@ QString AssociatedApplicationManager::application(const Plasma::Applet *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;
|
||||
}
|
||||
|
||||
KUrl::List AssociatedApplicationManager::urls(const Plasma::Applet *applet) const
|
||||
QList<QUrl> AssociatedApplicationManager::urls(const Plasma::Applet *applet) const
|
||||
{
|
||||
return d->urlLists.value(applet);
|
||||
}
|
||||
|
@ -43,9 +43,9 @@ public:
|
||||
QString application(const Plasma::Applet *applet) const;
|
||||
|
||||
//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
|
||||
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
|
||||
void run(Plasma::Applet *applet);
|
||||
|
@ -166,9 +166,9 @@ class ConfigLoaderPrivate
|
||||
return v;
|
||||
}
|
||||
|
||||
KUrl::List *newUrlList()
|
||||
QList<QUrl> *newUrlList()
|
||||
{
|
||||
KUrl::List *v = new KUrl::List;
|
||||
QList<QUrl> *v = new QList<QUrl>();
|
||||
urllists.append(v);
|
||||
return v;
|
||||
}
|
||||
@ -210,7 +210,7 @@ class ConfigLoaderPrivate
|
||||
QList<QRect *> rects;
|
||||
QList<QSize *> sizes;
|
||||
QList<quint64 *> ulonglongs;
|
||||
QList<KUrl::List *> urllists;
|
||||
QList<QList<QUrl> *> urllists;
|
||||
QString baseGroup;
|
||||
QStringList groups;
|
||||
QHash<QString, QString> keysToNames;
|
||||
|
Loading…
Reference in New Issue
Block a user