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)
void ImportFilterInfoGui::addInfoLogEntry(const QString &log)
{
QListWidgetItem *item = new QListWidgetItem(log);
auto *item = new QListWidgetItem(log);
item->setForeground(Qt::blue);
m_parent->mailWidget()->addItem(item);
m_parent->mailWidget()->setLastCurrentItem();
......@@ -67,7 +67,7 @@ void ImportFilterInfoGui::addInfoLogEntry(const QString &log)
void ImportFilterInfoGui::addErrorLogEntry(const QString &log)
{
QListWidgetItem *item = new QListWidgetItem(log);
auto *item = new QListWidgetItem(log);
item->setForeground(Qt::red);
m_parent->mailWidget()->addItem(item);
m_parent->mailWidget()->setLastCurrentItem();
......
......@@ -43,7 +43,7 @@ ImportWizard::ImportWizard(WizardMode mode, QWidget *parent)
setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Help);
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->registerSettingsIf(kernel); //SettingsIf is used in FolderTreeWidget
createAutomaticModePage();
......@@ -332,9 +332,9 @@ void ImportWizard::next()
finishButton()->setEnabled(false);
MailImporter::FilterInfo *info = new MailImporter::FilterInfo();
MailImporter::FilterImporterAkonadi *filterImporter = new MailImporter::FilterImporterAkonadi(info);
ImportWizardFilterInfoGui *infoGui = new ImportWizardFilterInfoGui(mImportpage, this);
auto *info = new MailImporter::FilterInfo();
auto *filterImporter = new MailImporter::FilterImporterAkonadi(info);
auto *infoGui = new ImportWizardFilterInfoGui(mImportpage, this);
info->setFilterInfoGui(infoGui);
info->setStatusMessage(i18n("Import in progress"));
info->setRemoveDupMessage(mSelfilterpage->removeDupMsg_checked());
......
......@@ -73,11 +73,11 @@ void ImportWizardDisplayInfo::filterImportInfo(const QString &log)
void ImportWizardDisplayInfo::initializeFilter(MailImporter::Filter &filter)
{
MailImporter::FilterInfo *info = new MailImporter::FilterInfo();
ImportFilterInfoGui *infoGui = new ImportFilterInfoGui(mImportWizard->importMailPage());
auto *info = new MailImporter::FilterInfo();
auto *infoGui = new ImportFilterInfoGui(mImportWizard->importMailPage());
info->setFilterInfoGui(infoGui);
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());
filter.setFilterImporter(filterImporter);
filter.setFilterInfo(info);
......
......@@ -55,7 +55,7 @@ void AbstractAddressBook::createGroup(const KContacts::ContactGroup &group)
item.setPayload<KContacts::ContactGroup>(group);
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);
}
}
......@@ -76,7 +76,7 @@ void AbstractAddressBook::createContact(const KContacts::Addressee &address)
Akonadi::Item item;
item.setPayload<KContacts::Addressee>(address);
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);
}
}
......
......@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
}
}
ImportWizard *wizard = new ImportWizard(mode);
auto *wizard = new ImportWizard(mode);
wizard->show();
const int ret = app.exec();
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