Commit 76a2c7a3 authored by Laurent Montel's avatar Laurent Montel 😁

Modernize code

parent ab8521ba
Pipeline #39510 passed with stage
in 16 minutes and 28 seconds
...@@ -58,7 +58,7 @@ void ImportFilterInfoGui::setOverall(int percent) ...@@ -58,7 +58,7 @@ void ImportFilterInfoGui::setOverall(int percent)
void ImportFilterInfoGui::addInfoLogEntry(const QString &log) void ImportFilterInfoGui::addInfoLogEntry(const QString &log)
{ {
QListWidgetItem *item = new QListWidgetItem(log); auto *item = new QListWidgetItem(log);
item->setForeground(Qt::blue); item->setForeground(Qt::blue);
m_parent->mailWidget()->addItem(item); m_parent->mailWidget()->addItem(item);
m_parent->mailWidget()->setLastCurrentItem(); m_parent->mailWidget()->setLastCurrentItem();
...@@ -67,7 +67,7 @@ void ImportFilterInfoGui::addInfoLogEntry(const QString &log) ...@@ -67,7 +67,7 @@ void ImportFilterInfoGui::addInfoLogEntry(const QString &log)
void ImportFilterInfoGui::addErrorLogEntry(const QString &log) void ImportFilterInfoGui::addErrorLogEntry(const QString &log)
{ {
QListWidgetItem *item = new QListWidgetItem(log); auto *item = new QListWidgetItem(log);
item->setForeground(Qt::red); item->setForeground(Qt::red);
m_parent->mailWidget()->addItem(item); m_parent->mailWidget()->addItem(item);
m_parent->mailWidget()->setLastCurrentItem(); m_parent->mailWidget()->setLastCurrentItem();
......
...@@ -43,7 +43,7 @@ ImportWizard::ImportWizard(WizardMode mode, QWidget *parent) ...@@ -43,7 +43,7 @@ ImportWizard::ImportWizard(WizardMode mode, QWidget *parent)
setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Help); setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Help);
mAbstractDisplayInfo = new ImportWizardDisplayInfo(this); mAbstractDisplayInfo = new ImportWizardDisplayInfo(this);
ImportWizardKernel *kernel = new ImportWizardKernel(this); auto *kernel = new ImportWizardKernel(this);
CommonKernel->registerKernelIf(kernel); //register KernelIf early, it is used by the Filter classes CommonKernel->registerKernelIf(kernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(kernel); //SettingsIf is used in FolderTreeWidget CommonKernel->registerSettingsIf(kernel); //SettingsIf is used in FolderTreeWidget
createAutomaticModePage(); createAutomaticModePage();
...@@ -332,9 +332,9 @@ void ImportWizard::next() ...@@ -332,9 +332,9 @@ void ImportWizard::next()
finishButton()->setEnabled(false); finishButton()->setEnabled(false);
MailImporter::FilterInfo *info = new MailImporter::FilterInfo(); auto *info = new MailImporter::FilterInfo();
MailImporter::FilterImporterAkonadi *filterImporter = new MailImporter::FilterImporterAkonadi(info); auto *filterImporter = new MailImporter::FilterImporterAkonadi(info);
ImportWizardFilterInfoGui *infoGui = new ImportWizardFilterInfoGui(mImportpage, this); auto *infoGui = new ImportWizardFilterInfoGui(mImportpage, this);
info->setFilterInfoGui(infoGui); info->setFilterInfoGui(infoGui);
info->setStatusMessage(i18n("Import in progress")); info->setStatusMessage(i18n("Import in progress"));
info->setRemoveDupMessage(mSelfilterpage->removeDupMsg_checked()); info->setRemoveDupMessage(mSelfilterpage->removeDupMsg_checked());
......
...@@ -73,11 +73,11 @@ void ImportWizardDisplayInfo::filterImportInfo(const QString &log) ...@@ -73,11 +73,11 @@ void ImportWizardDisplayInfo::filterImportInfo(const QString &log)
void ImportWizardDisplayInfo::initializeFilter(MailImporter::Filter &filter) void ImportWizardDisplayInfo::initializeFilter(MailImporter::Filter &filter)
{ {
MailImporter::FilterInfo *info = new MailImporter::FilterInfo(); auto *info = new MailImporter::FilterInfo();
ImportFilterInfoGui *infoGui = new ImportFilterInfoGui(mImportWizard->importMailPage()); auto *infoGui = new ImportFilterInfoGui(mImportWizard->importMailPage());
info->setFilterInfoGui(infoGui); info->setFilterInfoGui(infoGui);
info->clear(); // Clear info from last time info->clear(); // Clear info from last time
MailImporter::FilterImporterAkonadi *filterImporter = new MailImporter::FilterImporterAkonadi(info); auto *filterImporter = new MailImporter::FilterImporterAkonadi(info);
filterImporter->setRootCollection(mImportWizard->importMailPage()->selectedCollection()); filterImporter->setRootCollection(mImportWizard->importMailPage()->selectedCollection());
filter.setFilterImporter(filterImporter); filter.setFilterImporter(filterImporter);
filter.setFilterInfo(info); filter.setFilterInfo(info);
......
...@@ -55,7 +55,7 @@ void AbstractAddressBook::createGroup(const KContacts::ContactGroup &group) ...@@ -55,7 +55,7 @@ void AbstractAddressBook::createGroup(const KContacts::ContactGroup &group)
item.setPayload<KContacts::ContactGroup>(group); item.setPayload<KContacts::ContactGroup>(group);
item.setMimeType(KContacts::ContactGroup::mimeType()); item.setMimeType(KContacts::ContactGroup::mimeType());
Akonadi::ItemCreateJob *job = new Akonadi::ItemCreateJob(item, mCollection); auto *job = new Akonadi::ItemCreateJob(item, mCollection);
connect(job, &Akonadi::ItemCreateJob::result, this, &AbstractAddressBook::slotStoreDone); connect(job, &Akonadi::ItemCreateJob::result, this, &AbstractAddressBook::slotStoreDone);
} }
} }
...@@ -76,7 +76,7 @@ void AbstractAddressBook::createContact(const KContacts::Addressee &address) ...@@ -76,7 +76,7 @@ void AbstractAddressBook::createContact(const KContacts::Addressee &address)
Akonadi::Item item; Akonadi::Item item;
item.setPayload<KContacts::Addressee>(address); item.setPayload<KContacts::Addressee>(address);
item.setMimeType(KContacts::Addressee::mimeType()); item.setMimeType(KContacts::Addressee::mimeType());
Akonadi::ItemCreateJob *job = new Akonadi::ItemCreateJob(item, mCollection); auto *job = new Akonadi::ItemCreateJob(item, mCollection);
connect(job, &Akonadi::ItemCreateJob::result, this, &AbstractAddressBook::slotStoreDone); connect(job, &Akonadi::ItemCreateJob::result, this, &AbstractAddressBook::slotStoreDone);
} }
} }
......
...@@ -62,7 +62,7 @@ int main(int argc, char *argv[]) ...@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
} }
} }
ImportWizard *wizard = new ImportWizard(mode); auto *wizard = new ImportWizard(mode);
wizard->show(); wizard->show();
const int ret = app.exec(); const int ret = app.exec();
delete wizard; delete wizard;
......
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