const'ify

svn path=/trunk/KDE/kdelibs/; revision=992163
This commit is contained in:
Laurent Montel 2009-07-06 11:49:01 +00:00
parent 5c1bd9571b
commit 22a3d92cdc
4 changed files with 13 additions and 13 deletions

View File

@ -777,8 +777,8 @@ QString Applet::category(const QString &appletName)
return QString(); return QString();
} }
QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName); const QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName);
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); const KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint);
if (offers.isEmpty()) { if (offers.isEmpty()) {
return QString(); return QString();
@ -1818,12 +1818,12 @@ QStringList Applet::listCategories(const QString &parentApp, bool visibleOnly)
} }
KConfigGroup group(KGlobal::config(), "General"); KConfigGroup group(KGlobal::config(), "General");
QStringList excluded = group.readEntry("ExcludeCategories", QStringList()); const QStringList excluded = group.readEntry("ExcludeCategories", QStringList());
foreach (const QString &category, excluded) { foreach (const QString &category, excluded) {
constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'"); constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'");
} }
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); const KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint);
QStringList categories; QStringList categories;
QSet<QString> known = AppletPrivate::knownCategories(); QSet<QString> known = AppletPrivate::knownCategories();
foreach (const KService::Ptr &applet, offers) { foreach (const KService::Ptr &applet, offers) {
@ -1886,7 +1886,7 @@ Applet *Applet::load(const QString &appletName, uint appletId, const QVariantLis
return 0; return 0;
} }
QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName); const QString constraint = QString("[X-KDE-PluginInfo-Name] == '%1'").arg(appletName);
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint); KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint);
bool isContainment = false; bool isContainment = false;

View File

@ -148,7 +148,7 @@ bool ConfigLoaderHandler::endElement(const QString &namespaceURI,
Q_UNUSED(qName) Q_UNUSED(qName)
// kDebug() << "ConfigLoaderHandler::endElement(" << localName << qName; // kDebug() << "ConfigLoaderHandler::endElement(" << localName << qName;
QString tag = localName.toLower(); const QString tag = localName.toLower();
if (tag == "entry") { if (tag == "entry") {
addItem(); addItem();
resetState(); resetState();

View File

@ -981,9 +981,9 @@ KPluginInfo::List Containment::listContainmentsOfType(const QString &type,
KPluginInfo::List Containment::listContainmentsForMimetype(const QString &mimetype) KPluginInfo::List Containment::listContainmentsForMimetype(const QString &mimetype)
{ {
QString constraint = QString("'%1' in [X-Plasma-DropMimeTypes]").arg(mimetype); const QString constraint = QString("'%1' in [X-Plasma-DropMimeTypes]").arg(mimetype);
//kDebug() << mimetype << constraint; //kDebug() << mimetype << constraint;
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Containment", constraint); const KService::List offers = KServiceTypeTrader::self()->query("Plasma/Containment", constraint);
return KPluginInfo::fromServices(offers); return KPluginInfo::fromServices(offers);
} }
@ -1091,7 +1091,7 @@ void ContainmentPrivate::dropData(QGraphicsSceneEvent *event)
if (!appletMimetype.isEmpty() && mimeData->hasFormat(appletMimetype)) { if (!appletMimetype.isEmpty() && mimeData->hasFormat(appletMimetype)) {
QString data = mimeData->data(appletMimetype); QString data = mimeData->data(appletMimetype);
QStringList appletNames = data.split('\n', QString::SkipEmptyParts); const QStringList appletNames = data.split('\n', QString::SkipEmptyParts);
foreach (const QString &appletName, appletNames) { foreach (const QString &appletName, appletNames) {
//kDebug() << "doing" << appletName; //kDebug() << "doing" << appletName;
@ -1115,7 +1115,7 @@ void ContainmentPrivate::dropData(QGraphicsSceneEvent *event)
} else if (KUrl::List::canDecode(mimeData)) { } else if (KUrl::List::canDecode(mimeData)) {
//TODO: collect the mimetypes of available script engines and offer //TODO: collect the mimetypes of available script engines and offer
// to create widgets out of the matching URLs, if any // to create widgets out of the matching URLs, if any
KUrl::List urls = KUrl::List::fromMimeData(mimeData); const KUrl::List urls = KUrl::List::fromMimeData(mimeData);
foreach (const KUrl &url, urls) { foreach (const KUrl &url, urls) {
KMimeType::Ptr mime = KMimeType::findByUrl(url); KMimeType::Ptr mime = KMimeType::findByUrl(url);
QString mimeName = mime->name(); QString mimeName = mime->name();
@ -1454,8 +1454,8 @@ void Containment::setDrawWallpaper(bool drawWallpaper)
d->drawWallpaper = drawWallpaper; d->drawWallpaper = drawWallpaper;
if (drawWallpaper) { if (drawWallpaper) {
KConfigGroup cfg = config(); KConfigGroup cfg = config();
QString wallpaper = cfg.readEntry("wallpaperplugin", defaultWallpaper); const QString wallpaper = cfg.readEntry("wallpaperplugin", defaultWallpaper);
QString mode = cfg.readEntry("wallpaperpluginmode", defaultWallpaperMode); const QString mode = cfg.readEntry("wallpaperpluginmode", defaultWallpaperMode);
setWallpaper(wallpaper, mode); setWallpaper(wallpaper, mode);
} else { } else {
delete d->wallpaper; delete d->wallpaper;

View File

@ -59,7 +59,7 @@ void Context::setCurrentActivity(const QString &name)
emit activityChanged(this); emit activityChanged(this);
emit changed(this); emit changed(this);
QStringList activities = listActivities(); const QStringList activities = listActivities();
if (!activities.contains(name)) { if (!activities.contains(name)) {
createActivity(name); createActivity(name);
} }