Commit 8b5c2d5c authored by Laurent Montel's avatar Laurent Montel 😁

Minor optimization

parent 8a07e6bc
......@@ -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());
}
}
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment