Commit 0d9f888f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent 21ea3f02
Pipeline #60629 passed with stage
in 7 minutes and 12 seconds
......@@ -58,7 +58,7 @@ void ImportFilterInfoGui::setOverall(int percent)
void ImportFilterInfoGui::addInfoLogEntry(const QString &log)
{
auto *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)
{
auto *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);
auto *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();
......@@ -70,7 +70,7 @@ ImportWizard::ImportWizard(WizardMode mode, QWidget *parent)
checkModules();
KMessageBox::information(this, i18n("Close KMail before importing data. Some plugins will modify KMail config file."));
}
KHelpMenu *helpMenu = new KHelpMenu(this, KAboutData::applicationData(), true);
auto helpMenu = new KHelpMenu(this, KAboutData::applicationData(), true);
// Initialize menu
QMenu *menu = helpMenu->menu();
helpMenu->action(KHelpMenu::menuAboutApp)->setIcon(QIcon::fromTheme(QStringLiteral("kmail")));
......@@ -332,9 +332,9 @@ void ImportWizard::next()
finishButton()->setEnabled(false);
auto *info = new MailImporter::FilterInfo();
auto *filterImporter = new MailImporter::FilterImporterAkonadi(info);
auto *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)
{
auto *info = new MailImporter::FilterInfo();
auto *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
auto *filterImporter = new MailImporter::FilterImporterAkonadi(info);
auto filterImporter = new MailImporter::FilterImporterAkonadi(info);
filterImporter->setRootCollection(mImportWizard->importMailPage()->selectedCollection());
filter.setFilterImporter(filterImporter);
filter.setFilterInfo(info);
......
......@@ -17,7 +17,7 @@ ImportWizardKernel::ImportWizardKernel(QObject *parent)
: QObject(parent)
{
mIdentityManager = KIdentityManagement::IdentityManager::self();
Akonadi::Session *session = new Akonadi::Session("ImportWizard Kernel ETM", this);
auto session = new Akonadi::Session("ImportWizard Kernel ETM", this);
mFolderCollectionMonitor = new MailCommon::FolderCollectionMonitor(session, this);
mEntityTreeModel = new Akonadi::EntityTreeModel(folderCollectionMonitor(), this);
......
......@@ -55,7 +55,7 @@ void AbstractAddressBook::createGroup(const KContacts::ContactGroup &group)
item.setPayload<KContacts::ContactGroup>(group);
item.setMimeType(KContacts::ContactGroup::mimeType());
auto *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());
auto *job = new Akonadi::ItemCreateJob(item, mCollection);
auto job = new Akonadi::ItemCreateJob(item, mCollection);
connect(job, &Akonadi::ItemCreateJob::result, this, &AbstractAddressBook::slotStoreDone);
}
}
......
......@@ -80,7 +80,7 @@ void ImportWizardUtil::addAkonadiTag(const QVector<tagStruct> &tagList)
void ImportWizardUtil::storePassword(const QString &name, ImportWizardUtil::ResourceType type, const QString &password)
{
auto *job = new ImportWizardSavePasswordJob;
auto job = new ImportWizardSavePasswordJob;
switch (type) {
case Imap:
job->setName(QStringLiteral("imap"));
......
......@@ -66,7 +66,7 @@ int main(int argc, char *argv[])
}
}
auto *wizard = new ImportWizard(mode);
auto wizard = new ImportWizard(mode);
wizard->show();
const int ret = app.exec();
delete wizard;
......
......@@ -15,12 +15,12 @@
class QString;
// Types
typedef QMap<int, QString> MorkDict;
typedef QMap<int, int> MorkCells; // ColumnId : ValueId
typedef QMap<int, MorkCells> MorkRowMap; // Row id
typedef QMap<int, MorkRowMap> RowScopeMap; // Row scope
typedef QMap<int, RowScopeMap> MorkTableMap; // Table id
typedef QMap<int, MorkTableMap> TableScopeMap; // Table Scope
using MorkDict = QMap<int, QString>;
using MorkCells = QMap<int, int>; // ColumnId : ValueId
using MorkRowMap = QMap<int, MorkCells>; // Row id
using RowScopeMap = QMap<int, MorkRowMap>; // Row scope
using MorkTableMap = QMap<int, RowScopeMap>; // Table id
using TableScopeMap = QMap<int, MorkTableMap>; // Table Scope
// Mork header of supported format version
const char MorkMagicHeader[] = "// <!-- <mdb:mork:z v=\"1.4\"/> -->";
......
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