Commit 6cdff068 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code (using auto)

parent bbaf3dee
Pipeline #39325 passed with stage
in 10 minutes and 12 seconds
......@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
if (fileName.isEmpty()) {
return 0;
}
MBoxMainWindow *w = new MBoxMainWindow(fileName);
auto *w = new MBoxMainWindow(fileName);
w->show();
const int ret = app.exec();
delete w;
......
......@@ -58,7 +58,7 @@ void MBoxImporterInfoGui::setOverall(int percent)
void MBoxImporterInfoGui::addInfoLogEntry(const QString &log)
{
QListWidgetItem *item = new QListWidgetItem(log);
auto *item = new QListWidgetItem(log);
item->setForeground(Qt::blue);
mParent->mailWidget()->addItem(item);
mParent->mailWidget()->setLastCurrentItem();
......@@ -67,7 +67,7 @@ void MBoxImporterInfoGui::addInfoLogEntry(const QString &log)
void MBoxImporterInfoGui::addErrorLogEntry(const QString &log)
{
QListWidgetItem *item = new QListWidgetItem(log);
auto *item = new QListWidgetItem(log);
item->setForeground(Qt::red);
mParent->mailWidget()->addItem(item);
mParent->mailWidget()->setLastCurrentItem();
......
......@@ -25,9 +25,9 @@ MBoxMainWindow::MBoxMainWindow(const QString &filename, QWidget *parent)
mFileName(filename)
{
setWindowTitle(i18nc("@title:window", "Import mbox file"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto *mainLayout = new QVBoxLayout(this);
MBoxImporterKernel *kernel = new MBoxImporterKernel(this);
auto *kernel = new MBoxImporterKernel(this);
CommonKernel->registerKernelIf(kernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(kernel); //SettingsIf is used in FolderTreeWidget
......@@ -50,9 +50,9 @@ MBoxMainWindow::~MBoxMainWindow()
void MBoxMainWindow::slotImportMBox()
{
MailImporter::FilterInfo *info = new MailImporter::FilterInfo();
MailImporter::FilterImporterAkonadi *filterImporterAkonadi = new MailImporter::FilterImporterAkonadi(info);
MBoxImporterInfoGui *infoGui = new MBoxImporterInfoGui(mImportWidget);
auto *info = new MailImporter::FilterInfo();
auto *filterImporterAkonadi = new MailImporter::FilterImporterAkonadi(info);
auto *infoGui = new MBoxImporterInfoGui(mImportWidget);
info->setFilterInfoGui(infoGui);
filterImporterAkonadi->setRootCollection(mImportWidget->selectedCollection());
info->clear(); // Clear info from last time
......
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