Commit 797ae67f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Modernize code

parent 952309e8
Pipeline #48555 failed with stage
in 17 minutes and 54 seconds
......@@ -56,7 +56,7 @@ AddArchiveMailDialog::AddArchiveMailDialog(ArchiveMailInfo *info, QWidget *paren
mainLayout->addWidget(mFolderRequester, row, 1);
++row;
QLabel *formatLabel = new QLabel(i18n("Format:"), this);
auto formatLabel = new QLabel(i18n("Format:"), this);
formatLabel->setObjectName(QStringLiteral("label_format"));
mainLayout->addWidget(formatLabel, row, 0);
......@@ -70,7 +70,7 @@ AddArchiveMailDialog::AddArchiveMailDialog(ArchiveMailInfo *info, QWidget *paren
mRecursiveCheckBox->setChecked(true);
++row;
QLabel *pathLabel = new QLabel(i18n("Path:"), this);
auto pathLabel = new QLabel(i18n("Path:"), this);
mainLayout->addWidget(pathLabel, row, 0);
pathLabel->setObjectName(QStringLiteral("path_label"));
mPath = new KUrlRequester(this);
......@@ -80,7 +80,7 @@ AddArchiveMailDialog::AddArchiveMailDialog(ArchiveMailInfo *info, QWidget *paren
mainLayout->addWidget(mPath);
++row;
QLabel *dateLabel = new QLabel(i18n("Backup each:"), this);
auto dateLabel = new QLabel(i18n("Backup each:"), this);
dateLabel->setObjectName(QStringLiteral("date_label"));
mainLayout->addWidget(dateLabel, row, 0);
......@@ -96,7 +96,7 @@ AddArchiveMailDialog::AddArchiveMailDialog(ArchiveMailInfo *info, QWidget *paren
mainLayout->addLayout(hlayout, row, 1);
++row;
QLabel *maxCountlabel = new QLabel(i18n("Maximum number of archive:"), this);
auto maxCountlabel = new QLabel(i18n("Maximum number of archive:"), this);
mainLayout->addWidget(maxCountlabel, row, 0);
mMaximumArchive = new QSpinBox(this);
mMaximumArchive->setMinimum(0);
......
......@@ -19,7 +19,7 @@ ArchiveMailKernel::ArchiveMailKernel(QObject *parent)
: QObject(parent)
{
mIdentityManager = new KIdentityManagement::IdentityManager(true, this);
Akonadi::Session *session = new Akonadi::Session("Archive Mail Kernel ETM", this);
auto session = new Akonadi::Session("Archive Mail Kernel ETM", this);
mFolderCollectionMonitor = new MailCommon::FolderCollectionMonitor(session, this);
mFolderCollectionMonitor->monitor()->setChangeRecordingEnabled(false);
......
......@@ -57,7 +57,7 @@ void ArchiveMailManager::load()
if (info) {
//Store task started
mListArchiveInfo.append(info);
ScheduledArchiveTask *task = new ScheduledArchiveTask(this, info, Akonadi::Collection(info->saveCollectionId()), /*immediate*/ false);
auto task = new ScheduledArchiveTask(this, info, Akonadi::Collection(info->saveCollectionId()), /*immediate*/ false);
mArchiveMailKernel->jobScheduler()->registerTask(task);
}
} else {
......@@ -184,6 +184,6 @@ void ArchiveMailManager::archiveFolder(const QString &path, Akonadi::Collection:
info->setSaveCollectionId(collectionId);
info->setUrl(QUrl::fromLocalFile(path));
mListArchiveInfo.append(info);
ScheduledArchiveTask *task = new ScheduledArchiveTask(this, info, Akonadi::Collection(info->saveCollectionId()), true /*immediat*/);
auto task = new ScheduledArchiveTask(this, info, Akonadi::Collection(info->saveCollectionId()), true /*immediat*/);
mArchiveMailKernel->jobScheduler()->registerTask(task);
}
......@@ -61,7 +61,7 @@ ArchiveMailWidget::ArchiveMailWidget(const KSharedConfigPtr &config, QWidget *pa
CommonKernel->registerKernelIf(archiveMailKernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(archiveMailKernel); //SettingsIf is used in FolderTreeWidget
QWidget *w = new QWidget(parent);
auto w = new QWidget(parent);
mWidget.setupUi(w);
parent->layout()->addWidget(w);
......
......@@ -36,7 +36,7 @@ FollowUpReminderNoAnswerDialog::FollowUpReminderNoAnswerDialog(QWidget *parent)
auto mainLayout = new QVBoxLayout(this);
QLabel *lab = new QLabel(i18n("You still wait an answer about this mail:"), this);
auto lab = new QLabel(i18n("You still wait an answer about this mail:"), this);
mainLayout->addWidget(lab);
mWidget = new FollowUpReminderInfoWidget(this);
mWidget->setObjectName(QStringLiteral("FollowUpReminderInfoWidget"));
......@@ -54,7 +54,7 @@ FollowUpReminderNoAnswerDialog::FollowUpReminderNoAnswerDialog(QWidget *parent)
readConfig();
QDBusConnection dbusConn = QDBusConnection::sessionBus();
if (dbusConn.interface()->isServiceRegistered(QString::fromLatin1(s_fdo_notifications_service))) {
OrgFreedesktopDBusPropertiesInterface *propsIface = new OrgFreedesktopDBusPropertiesInterface(
auto propsIface = new OrgFreedesktopDBusPropertiesInterface(
QString::fromLatin1(s_fdo_notifications_service),
QString::fromLatin1(s_fdo_notifications_path),
dbusConn, this);
......
......@@ -14,7 +14,7 @@ DummyKernel::DummyKernel(QObject *parent)
{
mMessageSender = new MessageComposer::AkonadiSender(this);
mIdentityManager = new KIdentityManagement::IdentityManager(true, this);
Akonadi::Session *session = new Akonadi::Session("MailFilter Kernel ETM", this);
auto session = new Akonadi::Session("MailFilter Kernel ETM", this);
mFolderCollectionMonitor = new MailCommon::FolderCollectionMonitor(session, this);
......
......@@ -54,7 +54,7 @@ FilterLogDialog::FilterLogDialog(QWidget *parent)
buttonBox->button(QDialogButtonBox::Close)->setDefault(true);
KGuiItem::assign(mUser1Button, KStandardGuiItem::clear());
KGuiItem::assign(mUser2Button, KStandardGuiItem::saveAs());
QFrame *page = new QFrame(this);
auto page = new QFrame(this);
auto pageVBoxLayout = new QVBoxLayout;
page->setLayout(pageVBoxLayout);
......@@ -74,7 +74,7 @@ FilterLogDialog::FilterLogDialog(QWidget *parent)
}
auto purposeMenu = new MailfilterPurposeMenuWidget(this, this);
QPushButton *mShareButton = new QPushButton(i18n("Share..."), this);
auto mShareButton = new QPushButton(i18n("Share..."), this);
mShareButton->setMenu(purposeMenu->menu());
mShareButton->setIcon(QIcon::fromTheme(QStringLiteral("document-share")));
purposeMenu->setEditorWidget(mTextEdit->editor());
......@@ -133,12 +133,12 @@ FilterLogDialog::FilterLogDialog(QWidget *parent)
//QWhatsThis::add( mLogFilterActionBox,
// i18n( "" ) );
QWidget *hbox = new QWidget(page);
auto hbox = new QWidget(page);
auto hboxHBoxLayout = new QHBoxLayout;
hbox->setLayout(hboxHBoxLayout);
hboxHBoxLayout->setContentsMargins({});
pageVBoxLayout->addWidget(hbox);
QLabel *logSizeLab = new QLabel(i18n("Log size limit:"), hbox);
auto logSizeLab = new QLabel(i18n("Log size limit:"), hbox);
hboxHBoxLayout->addWidget(logSizeLab);
mLogMemLimitSpin = new QSpinBox(hbox);
hboxHBoxLayout->addWidget(mLogMemLimitSpin);
......
......@@ -208,7 +208,7 @@ void FilterManager::Private::modifyJobResult(KJob *job)
void FilterManager::Private::showNotification(const QString &errorMsg, const QString &jobErrorString)
{
KNotification *notify = new KNotification(QStringLiteral("mailfilterjoberror"));
auto notify = new KNotification(QStringLiteral("mailfilterjoberror"));
notify->setComponentName(QStringLiteral("akonadi_mailfilter_agent"));
notify->setIconName(QStringLiteral("view-filter"));
notify->setText(errorMsg + QLatin1Char('\n') + jobErrorString);
......@@ -453,7 +453,7 @@ bool FilterManager::processContextItem(ItemContext context)
} else {
if (context.moveTargetCollection().isValid() && context.item().storageCollectionId() != context.moveTargetCollection().id()) {
if (itemCanDelete) {
Akonadi::ItemMoveJob *moveJob = new Akonadi::ItemMoveJob(context.item(), context.moveTargetCollection(), this);
auto moveJob = new Akonadi::ItemMoveJob(context.item(), context.moveTargetCollection(), this);
connect(moveJob, &Akonadi::ItemMoveJob::result, this, [this](KJob *job) {
d->moveJobResult(job);
});
......
......@@ -96,7 +96,7 @@ MailFilterAgent::MailFilterAgent(const QString &id)
if (config->hasGroup("FilterLog")) {
KConfigGroup group(config, "FilterLog");
if (group.readEntry("Enabled", false)) {
KNotification *notify = new KNotification(QStringLiteral("mailfilterlogenabled"));
auto notify = new KNotification(QStringLiteral("mailfilterlogenabled"));
notify->setComponentName(QApplication::applicationDisplayName());
notify->setIconName(QStringLiteral("view-filter"));
notify->setText(i18nc("Notification when the filter log was enabled", "Mail Filter Log Enabled"));
......@@ -136,7 +136,7 @@ void MailFilterAgent::initializeCollections()
{
m_filterManager->readConfig();
Akonadi::CollectionFetchJob *job = new Akonadi::CollectionFetchJob(Akonadi::Collection::root(),
auto job = new Akonadi::CollectionFetchJob(Akonadi::Collection::root(),
Akonadi::CollectionFetchJob::Recursive,
this);
job->fetchScope().setContentMimeTypes({ KMime::Message::mimeType() });
......
......@@ -25,7 +25,7 @@ void SendLaterRemoveMessageJob::start()
void SendLaterRemoveMessageJob::deleteItem()
{
if (mIndex < mListItems.count()) {
Akonadi::ItemDeleteJob *job = new Akonadi::ItemDeleteJob(Akonadi::Item(mListItems.at(mIndex)), this);
auto job = new Akonadi::ItemDeleteJob(Akonadi::Item(mListItems.at(mIndex)), this);
connect(job, &Akonadi::ItemDeleteJob::result, this, &SendLaterRemoveMessageJob::slotItemDeleteDone);
} else {
deleteLater();
......
......@@ -22,7 +22,7 @@ MailKernel::MailKernel(const KSharedConfigPtr &config, QObject *parent)
{
mMessageSender = new MessageComposer::AkonadiSender(this);
mIdentityManager = new KIdentityManagement::IdentityManager(true, this);
Akonadi::Session *session = new Akonadi::Session("UnifiedMailbox Kernel ETM", this);
auto session = new Akonadi::Session("UnifiedMailbox Kernel ETM", this);
mFolderCollectionMonitor = new MailCommon::FolderCollectionMonitor(session, this);
......
......@@ -24,7 +24,7 @@ RefreshSettingsAssistant::RefreshSettingsAssistant(QWidget *parent)
resize(640, 480);
Akonadi::ControlGui::widgetNeedsAkonadi(this);
initializePages();
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")));
......
......@@ -17,7 +17,7 @@ RefreshSettingsCleanupPage::RefreshSettingsCleanupPage(QWidget *parent)
auto mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins({});
QPushButton *button = new QPushButton(i18n("Clean"), this);
auto button = new QPushButton(i18n("Clean"), this);
button->setObjectName(QStringLiteral("button"));
mainLayout->addWidget(button);
connect(button, &QPushButton::clicked, this, &RefreshSettingsCleanupPage::cleanSettings);
......
......@@ -15,7 +15,7 @@ RefreshSettingsFirstPage::RefreshSettingsFirstPage(QWidget *parent)
auto mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins({});
QLabel *label = new QLabel(i18n("Please close KMail/Kontact before using it."));
auto label = new QLabel(i18n("Please close KMail/Kontact before using it."));
QFont f = label->font();
f.setBold(true);
f.setPointSize(22);
......
......@@ -156,7 +156,7 @@ void AttachPropertyDialog::formatProperties(const QMap<int, KTNEFProperty *> &pr
void AttachPropertyDialog::formatPropertySet(KTNEFPropertySet *pSet, QTreeWidget *lv)
{
formatProperties(pSet->properties(), lv, nullptr, QStringLiteral("prop"));
QTreeWidgetItem *item
auto *item
= new QTreeWidgetItem(lv,
QStringList(i18nc("@label", "TNEF Attributes")));
item->setExpanded(true);
......
......@@ -500,13 +500,13 @@ void KTNEFMain::slotShowMessageText()
QString rtf = mParser->message()->rtfString();
if (!rtf.isEmpty()) {
QTemporaryFile *tmpFile = new QTemporaryFile(QStandardPaths::writableLocation(QStandardPaths::TempLocation) + QLatin1String("/ktnef/") + QLatin1String("ktnef_XXXXXX.rtf"));
auto tmpFile = new QTemporaryFile(QStandardPaths::writableLocation(QStandardPaths::TempLocation) + QLatin1String("/ktnef/") + QLatin1String("ktnef_XXXXXX.rtf"));
tmpFile->setAutoRemove(false);
tmpFile->open();
tmpFile->setPermissions(QFile::ReadUser);
tmpFile->write(rtf.toLocal8Bit());
tmpFile->close();
KIO::OpenUrlJob *job = new KIO::OpenUrlJob(QUrl::fromLocalFile(tmpFile->fileName()), QStringLiteral("text/rtf"));
auto job = new KIO::OpenUrlJob(QUrl::fromLocalFile(tmpFile->fileName()), QStringLiteral("text/rtf"));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
job->setDeleteTemporaryFile(true);
job->start();
......
......@@ -1208,13 +1208,13 @@ QPainter::CompositionMode QWinMetaFile::winToQtComposition(long parm) const
//-----------------------------------------------------------------------------
bool QWinMetaFile::dibToBmp(QImage &bmp, const char *dib, long size)
{
typedef struct _BMPFILEHEADER {
using BMPFILEHEADER = struct _BMPFILEHEADER {
WORD bmType;
DWORD bmSize;
WORD bmReserved1;
WORD bmReserved2;
DWORD bmOffBits;
} BMPFILEHEADER;
};
int sizeBmp = size + 14;
QByteArray pattern; // BMP header and DIB data
......
......@@ -11,29 +11,29 @@ using DWORD = int;
using LONG = qint32;
using _HANDLE = void *;
typedef struct _RECT {
using RECT = struct _RECT {
WORD left;
WORD top;
WORD right;
WORD bottom;
} RECT;
};
typedef struct _RECTL {
using RECTL = struct _RECTL {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECTL;
};
typedef struct _SIZE {
using SIZE = struct _SIZE {
WORD width;
WORD height;
} SIZE;
};
typedef struct _SIZEL {
using SIZEL = struct _SIZEL {
LONG width;
LONG height;
} SIZEL;
};
struct WmfEnhMetaHeader {
DWORD iType; // Record type EMR_HEADER
......
......@@ -92,7 +92,7 @@ void KMCommandsTest::resetIdentities()
void KMCommandsTest::verifyEncryption(bool encrypt)
{
const KMainWindow *w = mKernel->mainWin();
QLabel *encryption = w->findChild<QLabel *>(QStringLiteral("encryptionindicator"));
auto *encryption = w->findChild<QLabel *>(QStringLiteral("encryptionindicator"));
QVERIFY(encryption);
QCOMPARE(encryption->isVisible(), encrypt);
}
......@@ -100,7 +100,7 @@ void KMCommandsTest::verifyEncryption(bool encrypt)
void KMCommandsTest::verifySignature(bool sign)
{
const KMainWindow *w = mKernel->mainWin();
QLabel *signature = w->findChild<QLabel *>(QStringLiteral("signatureindicator"));
auto *signature = w->findChild<QLabel *>(QStringLiteral("signatureindicator"));
QVERIFY(signature);
QCOMPARE(signature->isVisible(), sign);
}
......@@ -113,7 +113,7 @@ void KMCommandsTest::testMailtoReply()
const KIdentityManagement::Identity &ident = mKernel->identityManager()->defaultIdentity();
Akonadi::Item item(createItem(ident));
KMMailtoReplyCommand *cmd(new KMMailtoReplyCommand(nullptr, QUrl(QStringLiteral("mailto:test@example.com")), item, QString()));
auto *cmd(new KMMailtoReplyCommand(nullptr, QUrl(QStringLiteral("mailto:test@example.com")), item, QString()));
cmd->start();
verifySignature(true);
waitForMainWindowToClose();
......@@ -123,7 +123,7 @@ void KMCommandsTest::testMailtoReply()
const KIdentityManagement::Identity &ident = mKernel->identityManager()->identityForAddress(QStringLiteral("secundus@example.com"));
Akonadi::Item item(createItem(ident));
KMMailtoReplyCommand *cmd(new KMMailtoReplyCommand(nullptr, QUrl(QStringLiteral("mailto:test@example.com")), item, QString()));
auto *cmd(new KMMailtoReplyCommand(nullptr, QUrl(QStringLiteral("mailto:test@example.com")), item, QString()));
cmd->start();
verifySignature(false);
waitForMainWindowToClose();
......@@ -133,7 +133,7 @@ void KMCommandsTest::testMailtoReply()
const KIdentityManagement::Identity &ident = mKernel->identityManager()->identityForAddress(QStringLiteral("drei@example.com"));
Akonadi::Item item(createItem(ident));
KMMailtoReplyCommand *cmd(new KMMailtoReplyCommand(nullptr, QUrl(QStringLiteral("mailto:test@example.com")), item, QString()));
auto *cmd(new KMMailtoReplyCommand(nullptr, QUrl(QStringLiteral("mailto:test@example.com")), item, QString()));
cmd->start();
verifySignature(true);
waitForMainWindowToClose();
......@@ -148,7 +148,7 @@ void KMCommandsTest::testReply()
const KIdentityManagement::Identity &ident = mKernel->identityManager()->defaultIdentity();
Akonadi::Item item(createItem(ident));
KMReplyCommand *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
auto *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
cmd->start();
verifySignature(true);
waitForMainWindowToClose();
......@@ -158,7 +158,7 @@ void KMCommandsTest::testReply()
const KIdentityManagement::Identity &ident = mKernel->identityManager()->identityForAddress(QStringLiteral("secundus@example.com"));
Akonadi::Item item(createItem(ident));
KMReplyCommand *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
auto *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
cmd->start();
verifySignature(false);
waitForMainWindowToClose();
......@@ -168,7 +168,7 @@ void KMCommandsTest::testReply()
const KIdentityManagement::Identity &ident = mKernel->identityManager()->identityForAddress(QStringLiteral("drei@example.com"));
Akonadi::Item item(createItem(ident));
KMReplyCommand *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
auto *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
cmd->start();
verifySignature(true);
waitForMainWindowToClose();
......@@ -187,7 +187,7 @@ void KMCommandsTest::testReplyWithoutDefaultGPGSign()
const KIdentityManagement::Identity &ident = mKernel->identityManager()->defaultIdentity();
Akonadi::Item item(createItem(ident));
KMReplyCommand *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
auto *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
cmd->start();
verifySignature(false);
waitForMainWindowToClose();
......@@ -197,7 +197,7 @@ void KMCommandsTest::testReplyWithoutDefaultGPGSign()
const KIdentityManagement::Identity &ident = mKernel->identityManager()->identityForAddress(QStringLiteral("secundus@example.com"));
Akonadi::Item item(createItem(ident));
KMReplyCommand *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
auto *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
cmd->start();
verifySignature(false);
waitForMainWindowToClose();
......@@ -207,7 +207,7 @@ void KMCommandsTest::testReplyWithoutDefaultGPGSign()
const KIdentityManagement::Identity &ident = mKernel->identityManager()->identityForAddress(QStringLiteral("drei@example.com"));
Akonadi::Item item(createItem(ident));
KMReplyCommand *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
auto *cmd(new KMReplyCommand(nullptr, item, MessageComposer::ReplyAll));
cmd->start();
verifySignature(true);
waitForMainWindowToClose();
......
......@@ -28,10 +28,10 @@ void TagSelectDialogTest::initTestCase()
void TagSelectDialogTest::shouldHaveDefaultValue()
{
TagSelectDialog dlg(nullptr, 1, Akonadi::Item());
QListWidget *listWidget = dlg.findChild<QListWidget *>(QStringLiteral("listtag"));
auto *listWidget = dlg.findChild<QListWidget *>(QStringLiteral("listtag"));
QVERIFY(listWidget);
KListWidgetSearchLine *listWidgetSearchLine = dlg.findChild<KListWidgetSearchLine *>(QStringLiteral("searchline"));
auto *listWidgetSearchLine = dlg.findChild<KListWidgetSearchLine *>(QStringLiteral("searchline"));
QVERIFY(listWidgetSearchLine);
QVERIFY(listWidgetSearchLine->isClearButtonEnabled());
}
......
......@@ -77,7 +77,7 @@ void CollectionMailingListPage::init(const Akonadi::Collection &col)
groupLayout->addItem(new QSpacerItem(0, 10), 3, 0);
QLabel *label = new QLabel(i18n("Mailing list description:"), mGroupWidget);
auto label = new QLabel(i18n("Mailing list description:"), mGroupWidget);
groupLayout->addWidget(label, 4, 0);
mMLId = new KSqueezedTextLabel(QString(), mGroupWidget);
mMLId->setTextElideMode(Qt::ElideRight);
......@@ -102,7 +102,7 @@ void CollectionMailingListPage::init(const Akonadi::Collection &col)
//FIXME: if the mailing list actions have either QAction's or toolbar buttons
// associated with them - remove this button since it's really silly
// here
QPushButton *handleButton = new QPushButton(i18n("Invoke Handler"), mGroupWidget);
auto handleButton = new QPushButton(i18n("Invoke Handler"), mGroupWidget);
if (mFolder) {
connect(handleButton, &QPushButton::clicked, this, &CollectionMailingListPage::slotInvokeHandler);
} else {
......
......@@ -19,14 +19,14 @@ CollectionQuotaWidget::CollectionQuotaWidget(QWidget *parent)
{
auto layout = new QGridLayout(this);
QLabel *lab = new QLabel(i18n("Usage:"), this);
auto lab = new QLabel(i18n("Usage:"), this);
layout->addWidget(lab, 0, 0);
mUsage = new QLabel(this);
mUsage->setTextFormat(Qt::PlainText);
layout->addWidget(mUsage, 0, 1);
QLabel *Status = new QLabel(i18n("Status:"), this);
auto Status = new QLabel(i18n("Status:"), this);
layout->addWidget(Status, 1, 0);
mProgressBar = new QProgressBar(this);
// xgettext: no-c-format
......
......@@ -38,7 +38,7 @@ void CollectionShortcutPage::init(const Akonadi::Collection &col)
auto topLayout = new QVBoxLayout(this);
QLabel *label = new QLabel(i18n("<qt>To choose a key or a combination "
auto label = new QLabel(i18n("<qt>To choose a key or a combination "
"of keys which select the current folder, "
"click the button below and then press the key(s) "
"you wish to associate with this folder.</qt>"), this);
......
......@@ -32,7 +32,7 @@ ColorListBox::ColorListBox(QWidget *parent)
void ColorListBox::addColor(const QString &text, const QColor &color)
{
QTreeWidgetItem *item = new QTreeWidgetItem(QStringList() << text);
auto item = new QTreeWidgetItem(QStringList() << text);
item->setData(0, Qt::DecorationRole, color);
addTopLevelItem(item);
}
......
......@@ -96,7 +96,7 @@ AccountsPageSendingTab::AccountsPageSendingTab(QWidget *parent)
vlay->addWidget(tmw);
// "Common options" groupbox:
QGroupBox *group = new QGroupBox(i18n("Common Options"), this);
auto group = new QGroupBox(i18n("Common Options"), this);
vlay->addWidget(group);
// a grid layout for the contents of the "common options" group box
......@@ -133,7 +133,7 @@ AccountsPageSendingTab::AccountsPageSendingTab(QWidget *parent)
connect(mSendMethodCombo, qOverload<int>(&QComboBox::activated), this, &AccountsPageSendingTab::slotEmitChanged);
// labels:
QLabel *l = new QLabel(i18n("Send &messages in outbox folder:"), group);
auto l = new QLabel(i18n("Send &messages in outbox folder:"), group);
l->setBuddy(mSendOnCheckCombo);
glay->addWidget(l, 2, 0);
......@@ -298,7 +298,7 @@ void AccountsPageReceivingTab::slotShowMailCheckMenu(const QString &ident, const
}
if (!MailCommon::Util::isVirtualCollection(ident)) {
QAction *manualMailCheck = new QAction(i18nc("Label to a checkbox, so is either checked/unchecked", "Include in Manual Mail Check"), &menu);
auto manualMailCheck = new QAction(i18nc("Label to a checkbox, so is either checked/unchecked", "Include in Manual Mail Check"), &menu);
manualMailCheck->setCheckable(true);
manualMailCheck->setChecked(IncludeInManualChecks);
manualMailCheck->setData(ident);
......@@ -306,14 +306,14 @@ void AccountsPageReceivingTab::slotShowMailCheckMenu(const QString &ident, const
connect(manualMailCheck, &QAction::toggled, this, &AccountsPageReceivingTab::slotIncludeInCheckChanged);
}
QAction *switchOffline = new QAction(i18nc("Label to a checkbox, so is either checked/unchecked", "Switch offline on KMail Shutdown"), &menu);
auto switchOffline = new QAction(i18nc("Label to a checkbox, so is either checked/unchecked", "Switch offline on KMail Shutdown"), &menu);
switchOffline->setCheckable(true);
switchOffline->setChecked(OfflineOnShutdown);
switchOffline->setData(ident);
menu.addAction(switchOffline);
connect(switchOffline, &QAction::toggled, this, &AccountsPageReceivingTab::slotOfflineOnShutdownChanged);
QAction *checkOnStartup = new QAction(i18n("Check mail on startup"), &menu);
auto checkOnStartup = new QAction(i18n("Check mail on startup"), &menu);
checkOnStartup->setCheckable(true);
checkOnStartup->setChecked(CheckOnStartup);
checkOnStartup->setData(ident);
......
......@@ -162,7 +162,7 @@ AppearancePageFontsTab::AppearancePageFontsTab(QWidget *parent)
}
mFontLocationCombo->addItems(fontDescriptions);
QLabel *label = new QLabel(i18n("Apply &to:"), this);
auto label = new QLabel(i18n("Apply &to:"), this);
label->setBuddy(mFontLocationCombo);
label->setEnabled(false); // since !mCustomFontCheck->isChecked()
hlay->addWidget(label);
......@@ -355,7 +355,7 @@ AppearancePageColorsTab::AppearancePageColorsTab(QWidget *parent)
// close to quota threshold
auto hbox = new QHBoxLayout();
vlay->addLayout(hbox);
QLabel *l = new QLabel(i18n("Close to quota threshold:"), this);
auto l = new QLabel(i18n("Close to quota threshold:"), this);
hbox->addWidget(l);
mCloseToQuotaThreshold = new QSpinBox(this);
mCloseToQuotaThreshold->setRange(0, 100);
......@@ -494,15 +494,15 @@ AppearancePageLayoutTab::AppearancePageLayoutTab(QWidget *parent)
mFavoriteFoldersViewGroup = new QButtonGroup(this);
connect(mFavoriteFoldersViewGroup, qOverload<QAbstractButton *>(&QButtonGroup::buttonClicked), this, &ConfigModuleTab::slotEmitChanged);
QRadioButton *favoriteFoldersViewHiddenRadio = new QRadioButton(i18n("Never"), mFavoriteFoldersViewGroupBox);
auto favoriteFoldersViewHiddenRadio = new QRadioButton(i18n("Never"), mFavoriteFoldersViewGroupBox);
mFavoriteFoldersViewGroup->addButton(favoriteFoldersViewHiddenRadio, static_cast<int>(MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::HiddenMode));
mFavoriteFoldersViewGroupBox->layout()->addWidget(favoriteFoldersViewHiddenRadio);
QRadioButton *favoriteFoldersViewIconsRadio = new QRadioButton(i18n("As icons"), mFavoriteFoldersViewGroupBox);
auto favoriteFoldersViewIconsRadio = new QRadioButton(i18n("As icons"), mFavoriteFoldersViewGroupBox);
mFavoriteFoldersViewGroup->addButton(favoriteFoldersViewIconsRadio, static_cast<int>(MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::IconMode));
mFavoriteFoldersViewGroupBox->layout()->addWidget(favoriteFoldersViewIconsRadio);
QRadioButton *favoriteFoldersViewListRadio = new QRadioButton(i18n("As list"), mFavoriteFoldersViewGroupBox);
auto favoriteFoldersViewListRadio = new QRadioButton(i18n("As list"), mFavoriteFoldersViewGroupBox);
mFavoriteFoldersViewGroup->addButton(favoriteFoldersViewListRadio, static_cast<int>(MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::ListMode));
mFavoriteFoldersViewGroupBox->layout()->addWidget(favoriteFoldersViewListRadio);
......@@ -515,11 +515,11 @@ AppearancePageLayoutTab::AppearancePageLayoutTab(QWidget *parent)
mFolderToolTipsGroup = new QButtonGroup(this);
connect(mFolderToolTipsGroup, qOverload<QAbstractButton *>(&QButtonGroup::buttonClicked), this, &ConfigModuleTab::slotEmitChanged);
QRadioButton *folderToolTipsAlwaysRadio = new QRadioButton(i18n("Always"), mFolderToolTipsGroupBox);
auto folderToolTipsAlwaysRadio = new QRadioButton(i18n("Always"), mFolderToolTipsGroupBox);
mFolderToolTipsGroup->addButton(folderToolTipsAlwaysRadio, static_cast< int >(FolderTreeWidget::DisplayAlways));