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

View File

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

View File

@ -981,9 +981,9 @@ KPluginInfo::List Containment::listContainmentsOfType(const QString &type,
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;
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Containment", constraint);
const KService::List offers = KServiceTypeTrader::self()->query("Plasma/Containment", constraint);
return KPluginInfo::fromServices(offers);
}
@ -1091,7 +1091,7 @@ void ContainmentPrivate::dropData(QGraphicsSceneEvent *event)
if (!appletMimetype.isEmpty() && mimeData->hasFormat(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) {
//kDebug() << "doing" << appletName;
@ -1115,7 +1115,7 @@ void ContainmentPrivate::dropData(QGraphicsSceneEvent *event)
} else if (KUrl::List::canDecode(mimeData)) {
//TODO: collect the mimetypes of available script engines and offer
// 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) {
KMimeType::Ptr mime = KMimeType::findByUrl(url);
QString mimeName = mime->name();
@ -1454,8 +1454,8 @@ void Containment::setDrawWallpaper(bool drawWallpaper)
d->drawWallpaper = drawWallpaper;
if (drawWallpaper) {
KConfigGroup cfg = config();
QString wallpaper = cfg.readEntry("wallpaperplugin", defaultWallpaper);
QString mode = cfg.readEntry("wallpaperpluginmode", defaultWallpaperMode);
const QString wallpaper = cfg.readEntry("wallpaperplugin", defaultWallpaper);
const QString mode = cfg.readEntry("wallpaperpluginmode", defaultWallpaperMode);
setWallpaper(wallpaper, mode);
} else {
delete d->wallpaper;

View File

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