summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-07-10 06:52:15 +0200
committerMontel Laurent <[email protected]>2017-07-10 06:52:15 +0200
commit8b5c2d5c07061c0238b26bd22cba7f2f4932ba3b (patch)
tree536cc8f5c2949adf412b2553264251d3e5210b06
parent8a07e6bcc8f403adf8ce17f437306c7aca8d1676 (diff)
Minor optimization
-rw-r--r--src/aboutdialog.cpp13
-rw-r--r--src/kcmkontact.cpp2
-rw-r--r--src/main.cpp8
3 files changed, 8 insertions, 15 deletions
diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp
index 1664b80..f52bae6 100644
--- a/src/aboutdialog.cpp
+++ b/src/aboutdialog.cpp
@@ -52,7 +52,7 @@ AboutDialog::AboutDialog(KontactInterface::Core *core)
addAboutData(i18n("Kontact Container"), QStringLiteral("kontact"),
KAboutData::applicationData());
QList<KontactInterface::Plugin *> plugins = mCore->pluginList();
- QList<KontactInterface::Plugin *>::ConstIterator end = plugins.constEnd();
+ const QList<KontactInterface::Plugin *>::ConstIterator end = plugins.constEnd();
QList<KontactInterface::Plugin *>::ConstIterator it = plugins.constBegin();
for (; it != end; ++it) {
addAboutPlugin(*it);
@@ -127,10 +127,8 @@ void AboutDialog::addAboutData(const QString &title, const QString &icon,
const QList<KAboutPerson> authors = about.authors();
if (!authors.isEmpty()) {
text += i18n("<p><b>Authors:</b></p>");
-
- QList<KAboutPerson>::ConstIterator it;
const QList<KAboutPerson>::ConstIterator end(authors.end());
- for (it = authors.begin(); it != end; ++it) {
+ for (QList<KAboutPerson>::ConstIterator it = authors.begin(); it != end; ++it) {
text += formatPerson((*it).name(), (*it).emailAddress());
if (!(*it).task().isEmpty()) {
text += QLatin1String("<i>") + (*it).task() + QLatin1String("</i><br>");
@@ -142,9 +140,8 @@ void AboutDialog::addAboutData(const QString &title, const QString &icon,
if (!credits.isEmpty()) {
text += i18n("<p><b>Thanks to:</b></p>");
- QList<KAboutPerson>::ConstIterator it;
const QList<KAboutPerson>::ConstIterator end(credits.end());
- for (it = credits.begin(); it != end; ++it) {
+ for (QList<KAboutPerson>::ConstIterator it = credits.begin(); it != end; ++it) {
text += formatPerson((*it).name(), (*it).emailAddress());
if (!(*it).task().isEmpty()) {
text += QLatin1String("<i>") + (*it).task() + QLatin1String("</i><br>");
@@ -155,10 +152,8 @@ void AboutDialog::addAboutData(const QString &title, const QString &icon,
const QList<KAboutPerson> translators = about.translators();
if (!translators.isEmpty()) {
text += i18n("<p><b>Translators:</b></p>");
-
- QList<KAboutPerson>::ConstIterator it;
const QList<KAboutPerson>::ConstIterator end(translators.end());
- for (it = translators.begin(); it != end; ++it) {
+ for (QList<KAboutPerson>::ConstIterator it = translators.begin(); it != end; ++it) {
text += formatPerson((*it).name(), (*it).emailAddress());
}
}
diff --git a/src/kcmkontact.cpp b/src/kcmkontact.cpp
index cc573a8..1eb3148 100644
--- a/src/kcmkontact.cpp
+++ b/src/kcmkontact.cpp
@@ -126,7 +126,7 @@ void PluginSelection::readConfig()
int activeComponent = 0;
mPluginCombo->clear();
mPluginList.clear();
- KService::List::ConstIterator end(offers.end());
+ const KService::List::ConstIterator end(offers.end());
for (KService::List::ConstIterator it = offers.begin(); it != end; ++it) {
KService::Ptr service = *it;
// skip summary only plugins
diff --git a/src/main.cpp b/src/main.cpp
index 84d4914..3d8d86d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -79,12 +79,10 @@ private:
static void listPlugins()
{
- //KComponentData instance("kontact"); //Can't use KontactApp -- too late for adding cmdline opts
-
const KService::List offers = KServiceTypeTrader::self()->query(
QStringLiteral("Kontact/Plugin"),
QStringLiteral("[X-KDE-KontactPluginVersion] == %1").arg(KONTACT_PLUGIN_VERSION));
- KService::List::ConstIterator end(offers.end());
+ const KService::List::ConstIterator end(offers.end());
for (KService::List::ConstIterator it = offers.begin(); it != end; ++it) {
KService::Ptr service = (*it);
// skip summary only plugins
@@ -92,7 +90,7 @@ static void listPlugins()
if (var.isValid() && var.toBool() == false) {
continue;
}
- cout << service->library().remove(QStringLiteral("kontact_")).toLatin1().data() << endl;
+ cout << "lib name " << qPrintable(service->library().remove(QStringLiteral("kontact_"))) << endl;
}
}
@@ -225,7 +223,7 @@ int main(int argc, char **argv)
}
}
- int ret = app.exec();
+ const int ret = app.exec();
qDeleteAll(KMainWindow::memberList());
return ret;