const & in foreach

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801430
This commit is contained in:
Albert Astals Cid 2008-04-26 16:19:00 +00:00
parent 6d8a1752a7
commit 4068f45cf9
10 changed files with 11 additions and 11 deletions

View File

@ -252,7 +252,7 @@ AbstractRunner::List AbstractRunner::loadAll(QObject* parent, const QStringList&
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Runner");
QString error;
foreach (KService::Ptr service, offers) {
foreach (const KService::Ptr &service, offers) {
if (whitelist.empty() || whitelist.contains(service->name())) {
QString language = service->property("X-Plasma-Language").toString();
AbstractRunner* runner = 0;

View File

@ -1397,7 +1397,7 @@ QStringList Applet::listCategories(const QString &parentApp, bool visibleOnly)
KService::List offers = KServiceTypeTrader::self()->query("Plasma/Applet", constraint);
QStringList categories;
foreach (const KService::Ptr applet, offers) {
foreach (const KService::Ptr &applet, offers) {
QString appletCategory = applet->property("X-KDE-PluginInfo-Category").toString();
if (visibleOnly && applet->noDisplay()) {
// we don't want to show the hidden category

View File

@ -55,7 +55,7 @@ void CustomDragTreeView::startDrag ( Qt::DropActions supportedActions )
QPainter painter(&pixmap);
QRect rect(0, 0, PIX_SIZE, PIX_SIZE);
foreach (QModelIndex index, indexes) {
foreach (const QModelIndex &index, indexes) {
if (index.column() != 0) continue;
KCategorizedItemsViewModels::AbstractItem * item =

View File

@ -181,7 +181,7 @@ AbstractItem * KCategorizedItemsView::getItemByProxyIndex(const QModelIndex & in
QList < AbstractItem * > KCategorizedItemsView::selectedItems() const {
QList < AbstractItem * > items;
foreach (QModelIndex index, itemsView->selectionModel()->selectedIndexes()) {
foreach (const QModelIndex &index, itemsView->selectionModel()->selectedIndexes()) {
if (index.column() == 0) {
items << getItemByProxyIndex(index);
}

View File

@ -105,7 +105,7 @@ void PlasmaAppletItemModel::populateModel()
if (!rx.exactMatch(i.key())) continue;
QString id = rx.cap(1);
foreach (QString plugin, i.value().split(",")) {
foreach (const QString &plugin, i.value().split(",")) {
extraPluginAttrs[plugin]["recommended." + id] = true;
}
}

View File

@ -410,7 +410,7 @@ void ConfigXmlHandler::addItem()
} else if (m_type == "intlist") {
QStringList tmpList = m_default.split(",");
QList<qint32> defaultList;
foreach (QString tmp, tmpList) {
foreach (const QString &tmp, tmpList) {
defaultList.append(tmp.toInt());
}
item = m_config->addItemIntList(m_name, *d->newIntList(), defaultList, m_key);

View File

@ -163,7 +163,7 @@ QStringList DataEngineManager::listAllEngines()
{
QStringList engines;
KService::List offers = KServiceTypeTrader::self()->query("Plasma/DataEngine");
foreach (KService::Ptr service, offers) {
foreach (const KService::Ptr &service, offers) {
engines.append(service->property("X-Plasma-EngineName").toString());
}

View File

@ -306,7 +306,7 @@ void PackageStructure::read(const KConfigBase *config)
d->type = config->group("").readEntry("Type", QString());
QStringList groups = config->groupList();
foreach (QString group, groups) {
foreach (const QString &group, groups) {
QByteArray key = group.toAscii();
KConfigGroup entry = config->group(group);

View File

@ -97,7 +97,7 @@ QStringList knownLanguages(ComponentTypes types)
//kDebug() << "Applet::knownApplets constraint was '" << constraint << "' which got us " << offers.count() << " matches";
QStringList languages;
foreach (KService::Ptr service, offers) {
foreach (const KService::Ptr &service, offers) {
QString language = service->property("X-Plasma-Language").toString();
if (!languages.contains(language)) {
languages.append(language);
@ -155,7 +155,7 @@ ScriptEngine* loadEngine(const QString &language, ComponentType type, QObject *p
QString error;
ScriptEngine *engine = 0;
foreach (KService::Ptr service, offers) {
foreach (const KService::Ptr &service, offers) {
switch (type) {
case AppletComponent:
engine = service->createInstance<Plasma::AppletScript>(parent, args, &error);

View File

@ -231,7 +231,7 @@ void Meter::dataUpdated(const QString &sourceName, const Plasma::DataEngine::Dat
{
Q_UNUSED(sourceName)
foreach (QVariant d, data) {
foreach (const QVariant &d, data) {
if (d.canConvert(QVariant::Int)) {
setValue(d.toInt());
return;