Commit 742cea84 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

modernize code

parent baa4a9aa
Pipeline #48549 failed with stage
in 11 minutes and 15 seconds
...@@ -93,7 +93,7 @@ Dialog::Dialog(QWidget *parent) ...@@ -93,7 +93,7 @@ Dialog::Dialog(QWidget *parent)
//TODO ? necessary ??? //TODO ? necessary ???
Q_EMIT page->pageEnteredNext(); Q_EMIT page->pageEnteredNext();
connect(button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &Dialog::reject); connect(button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &Dialog::reject);
KHelpMenu *helpMenu = new KHelpMenu(this, KAboutData::applicationData(), true); auto *helpMenu = new KHelpMenu(this, KAboutData::applicationData(), true);
//Initialize menu //Initialize menu
QMenu *menu = helpMenu->menu(); QMenu *menu = helpMenu->menu();
helpMenu->action(KHelpMenu::menuAboutApp)->setIcon(QIcon::fromTheme(QStringLiteral("akonadi"))); helpMenu->action(KHelpMenu::menuAboutApp)->setIcon(QIcon::fromTheme(QStringLiteral("akonadi")));
...@@ -153,7 +153,7 @@ void Dialog::slotBackOk() ...@@ -153,7 +153,7 @@ void Dialog::slotBackOk()
QObject *Dialog::addPage(const QString &uiFile, const QString &title) QObject *Dialog::addPage(const QString &uiFile, const QString &title)
{ {
qCDebug(ACCOUNTWIZARD_LOG) << uiFile; qCDebug(ACCOUNTWIZARD_LOG) << uiFile;
DynamicPage *page = new DynamicPage(Global::assistantBasePath() + uiFile, this); auto *page = new DynamicPage(Global::assistantBasePath() + uiFile, this);
connect(page, &DynamicPage::leavePageNextOk, this, &Dialog::slotNextOk); connect(page, &DynamicPage::leavePageNextOk, this, &Dialog::slotNextOk);
connect(page, &DynamicPage::leavePageBackOk, this, &Dialog::slotBackOk); connect(page, &DynamicPage::leavePageBackOk, this, &Dialog::slotBackOk);
KPageWidgetItem *item = insertPage(mLastPage, page, title); KPageWidgetItem *item = insertPage(mLastPage, page, title);
......
...@@ -160,7 +160,7 @@ void Ldap::edit() ...@@ -160,7 +160,7 @@ void Ldap::edit()
KLDAP::LdapClientSearchConfig clientSearchConfig; KLDAP::LdapClientSearchConfig clientSearchConfig;
KConfigGroup group = clientSearchConfig.config()->group(QStringLiteral("LDAP")); KConfigGroup group = clientSearchConfig.config()->group(QStringLiteral("LDAP"));
KLDAP::LdapClientSearchConfigReadConfigJob *job = new KLDAP::LdapClientSearchConfigReadConfigJob(this); auto *job = new KLDAP::LdapClientSearchConfigReadConfigJob(this);
connect(job, &KLDAP::LdapClientSearchConfigReadConfigJob::configLoaded, this, [this, group](KLDAP::LdapServer server) { connect(job, &KLDAP::LdapClientSearchConfigReadConfigJob::configLoaded, this, [this, group](KLDAP::LdapServer server) {
KLDAP::AddHostDialog dlg(&server, nullptr); KLDAP::AddHostDialog dlg(&server, nullptr);
......
...@@ -43,7 +43,7 @@ void LoadPage::enterPageNext() ...@@ -43,7 +43,7 @@ void LoadPage::enterPageNext()
ui.statusLabel->setText(i18n("Loading script '%1'...", Global::assistantBasePath() + scriptFile)); ui.statusLabel->setText(i18n("Loading script '%1'...", Global::assistantBasePath() + scriptFile));
m_action = new Kross::Action(this, QStringLiteral("AccountWizard")); m_action = new Kross::Action(this, QStringLiteral("AccountWizard"));
typedef QPair<QObject *, QString> ObjectStringPair; using ObjectStringPair = QPair<QObject *, QString>;
for (const ObjectStringPair &exportedObject : qAsConst(m_exportedObjects)) { for (const ObjectStringPair &exportedObject : qAsConst(m_exportedObjects)) {
m_action->addQObject(exportedObject.first, exportedObject.second); m_action->addQObject(exportedObject.first, exportedObject.second);
} }
......
...@@ -69,7 +69,7 @@ void ProviderPage::fillModel(const KNSCore::EntryInternal::List &list) ...@@ -69,7 +69,7 @@ void ProviderPage::fillModel(const KNSCore::EntryInternal::List &list)
for (const KNSCore::EntryInternal &e : list) { for (const KNSCore::EntryInternal &e : list) {
qCDebug(ACCOUNTWIZARD_LOG) << "Found Entry: " << e.name(); qCDebug(ACCOUNTWIZARD_LOG) << "Found Entry: " << e.name();
QStandardItem *item = new QStandardItem(e.name()); auto *item = new QStandardItem(e.name());
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
item->setData(e.name(), Qt::ToolTipRole); item->setData(e.name(), Qt::ToolTipRole);
item->setData(e.uniqueId(), Qt::UserRole); item->setData(e.uniqueId(), Qt::UserRole);
......
...@@ -86,7 +86,7 @@ TypePage::TypePage(KAssistantDialog *parent) ...@@ -86,7 +86,7 @@ TypePage::TypePage(KAssistantDialog *parent)
continue; continue;
} }
} }
QStandardItem *item = new QStandardItem(f.readName()); auto *item = new QStandardItem(f.readName());
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
item->setData(entry, Qt::UserRole); item->setData(entry, Qt::UserRole);
if (!f.readIcon().isEmpty()) { if (!f.readIcon().isEmpty()) {
......
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