Commit 8a857804 authored by Laurent Montel's avatar Laurent Montel 😁

Modernize code

parent 994a8112
Pipeline #39277 passed with stage
in 33 minutes and 16 seconds
......@@ -64,9 +64,9 @@ static bool waitForPopulation(const QModelIndex &idx, EntityTreeModel *model, in
EntityTreeModel *FavoriteProxyTest::createETM()
{
ChangeRecorder *changeRecorder = new ChangeRecorder(this);
auto *changeRecorder = new ChangeRecorder(this);
changeRecorder->setCollectionMonitored(Collection::root());
EntityTreeModel *model = new EntityTreeModel(changeRecorder, this);
auto *model = new EntityTreeModel(changeRecorder, this);
model->setItemPopulationStrategy(Akonadi::EntityTreeModel::LazyPopulation);
return model;
}
......@@ -97,10 +97,10 @@ void FavoriteProxyTest::testReordering()
configGroup.writeEntry("FavoriteCollectionLabels", labels);
configGroup.writeEntry("0", order);
FavoriteCollectionsModel *favoriteModel = new FavoriteCollectionsModel(model, configGroup, this);
auto *favoriteModel = new FavoriteCollectionsModel(model, configGroup, this);
QTRY_COMPARE(favoriteModel->rowCount(), 2);
FavoriteCollectionOrderProxyModel *orderProxy = new FavoriteCollectionOrderProxyModel(this);
auto *orderProxy = new FavoriteCollectionOrderProxyModel(this);
orderProxy->setOrderConfig(configGroup);
orderProxy->setSourceModel(favoriteModel);
orderProxy->sort(0, Qt::AscendingOrder);
......
......@@ -49,7 +49,7 @@ private Q_SLOTS:
{
AkonadiTest::checkTestIsIsolated();
DummyKernel *kernel = new DummyKernel(nullptr);
auto *kernel = new DummyKernel(nullptr);
CommonKernel->registerKernelIf(kernel);
CommonKernel->registerSettingsIf(kernel);
......@@ -106,7 +106,7 @@ private Q_SLOTS:
QSignalSpy rATBRSpy_TopModel(mTopModel, &QAbstractItemModel::rowsAboutToBeRemoved);
// Now delete it
Akonadi::CollectionDeleteJob *delJob = new Akonadi::CollectionDeleteJob(searchCol);
auto *delJob = new Akonadi::CollectionDeleteJob(searchCol);
AKVERIFYEXEC(delJob);
// Check it disappeared from the tree, as well as the toplevel item
......@@ -142,7 +142,7 @@ private Q_SLOTS:
// Create resources
const int numResources = numFolders.count();
for (int i = 1 /*first one already created*/; i < numResources; ++i) {
AgentInstanceCreateJob *agentCreateJob = new AgentInstanceCreateJob(agentType);
auto *agentCreateJob = new AgentInstanceCreateJob(agentType);
AKVERIFYEXEC(agentCreateJob);
const QString identifier = agentCreateJob->instance().identifier();
......@@ -158,7 +158,7 @@ private Q_SLOTS:
Collection mailCollection;
mailCollection.setParentCollection(topLevelCollection);
mailCollection.setName(QStringLiteral("mailCollection_%1_%2").arg(i).arg(number));
CollectionCreateJob *collCreateJob = new CollectionCreateJob(mailCollection);
auto *collCreateJob = new CollectionCreateJob(mailCollection);
AKVERIFYEXEC(collCreateJob);
}
const int resourceRow = collectNames(mTopModel).indexOf("res" + QString::number(i + 1));
......@@ -183,7 +183,7 @@ private Q_SLOTS:
Collection mailCollection;
mailCollection.setParentCollection(currentColl);
mailCollection.setName(QStringLiteral("sub%1").arg(number+1));
CollectionCreateJob *collCreateJob = new CollectionCreateJob(mailCollection);
auto *collCreateJob = new CollectionCreateJob(mailCollection);
AKVERIFYEXEC(collCreateJob);
currentColl = collCreateJob->collection();
}
......@@ -198,7 +198,7 @@ private Q_SLOTS:
QTest::qWait(100); // #### akonadi bug? Without this, a warning "Only resources can modify remote identifiers" appears
// When moving the source folder (sub2) to the dest folder
CollectionMoveJob *collMoveJob = new CollectionMoveJob(currentColl, newParentCollection);
auto *collMoveJob = new CollectionMoveJob(currentColl, newParentCollection);
AKVERIFYEXEC(collMoveJob);
// wait for Akonadi::Monitor::collectionMoved
......
......@@ -25,7 +25,7 @@ QByteArray ExpireCollectionAttribute::type() const
ExpireCollectionAttribute *ExpireCollectionAttribute::clone() const
{
ExpireCollectionAttribute *expireAttr = new ExpireCollectionAttribute();
auto *expireAttr = new ExpireCollectionAttribute();
expireAttr->setAutoExpire(mExpireMessages);
expireAttr->setUnreadExpireAge(mUnreadExpireAge);
expireAttr->setUnreadExpireUnits(mUnreadExpireUnits);
......
......@@ -24,7 +24,7 @@ CollectionExpiryJob::~CollectionExpiryJob()
void CollectionExpiryJob::start()
{
if (mCollection.isValid()) {
Akonadi::CollectionModifyJob *job = new Akonadi::CollectionModifyJob(mCollection, this);
auto *job = new Akonadi::CollectionModifyJob(mCollection, this);
connect(job, &Akonadi::CollectionModifyJob::result, this, &CollectionExpiryJob::slotCollectionModified);
} else {
qCWarning(MAILCOMMON_LOG) << "Collection is not valid";
......@@ -52,7 +52,7 @@ void CollectionExpiryJob::slotCollectionModified(KJob *job)
// trigger immediate expiry if there is something to do
if (mExpireNow) {
Akonadi::CollectionModifyJob *modifiedJob = qobject_cast<Akonadi::CollectionModifyJob *>(job);
auto *modifiedJob = qobject_cast<Akonadi::CollectionModifyJob *>(job);
if (modifiedJob) {
MailCommon::Util::expireOldMessages(modifiedJob->collection(), true /*immediate*/);
} else {
......
......@@ -38,7 +38,7 @@ bool CollectionExpiryPage::canHandle(const Akonadi::Collection &col) const
void CollectionExpiryPage::init()
{
QVBoxLayout *globalVBox = new QVBoxLayout(this);
auto *globalVBox = new QVBoxLayout(this);
mCollectionExpiryWidget = new CollectionExpiryWidget(this);
connect(mCollectionExpiryWidget, &CollectionExpiryWidget::saveAndExpireRequested, this, &CollectionExpiryPage::slotSaveAndExpire);
connect(mCollectionExpiryWidget, &CollectionExpiryWidget::configChanged, this, &CollectionExpiryPage::slotConfigChanged);
......@@ -56,7 +56,7 @@ void CollectionExpiryPage::load(const Akonadi::Collection &collection)
{
mCollection = collection;
init();
const MailCommon::ExpireCollectionAttribute *attr = collection.attribute<MailCommon::ExpireCollectionAttribute>();
const auto *attr = collection.attribute<MailCommon::ExpireCollectionAttribute>();
if (attr) {
int daysToExpireRead, daysToExpireUnread;
attr->daysToExpire(daysToExpireUnread, daysToExpireRead);
......
......@@ -28,10 +28,10 @@ using namespace MailCommon;
CollectionExpiryWidget::CollectionExpiryWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *globalVBox = new QVBoxLayout(this);
auto *globalVBox = new QVBoxLayout(this);
globalVBox->setContentsMargins({});
QGridLayout *daysBox = new QGridLayout;
auto *daysBox = new QGridLayout;
mExpireReadMailCB = new QCheckBox(i18n("Expire read messages after"), this);
connect(mExpireReadMailCB, &QCheckBox::toggled, this, &CollectionExpiryWidget::slotUpdateControls);
......@@ -64,11 +64,11 @@ CollectionExpiryWidget::CollectionExpiryWidget(QWidget *parent)
globalVBox->addSpacing(30);
QGroupBox *actionsGroup = new QGroupBox(this);
auto *actionsGroup = new QGroupBox(this);
actionsGroup->setFlat(true); // for mutual exclusion of the radio buttons
globalVBox->addWidget(actionsGroup);
QHBoxLayout *moveToHBox = new QHBoxLayout();
auto *moveToHBox = new QHBoxLayout();
moveToHBox->setContentsMargins(0, 0, 0, 0);
moveToHBox->setSpacing(6);
......@@ -233,7 +233,7 @@ void CollectionExpiryWidget::save(const CollectionExpirySettings &collectionExpi
attribute->setExpireAction(collectionExpirySettings.mExpireAction);
if (saveSettings) {
CollectionExpiryJob *job = new CollectionExpiryJob;
auto *job = new CollectionExpiryJob;
job->setExpireNow(expireNow);
job->setCollection(collection);
job->start();
......
......@@ -58,12 +58,12 @@ void CollectionGeneralPage::init(const Akonadi::Collection &collection)
mIsResourceFolder = (collection.parentCollection() == Akonadi::Collection::root());
QLabel *label = nullptr;
QVBoxLayout *topLayout = new QVBoxLayout(this);
auto *topLayout = new QVBoxLayout(this);
// Musn't be able to edit details for a non-resource, system folder.
if ((!mIsLocalSystemFolder || mIsResourceFolder)
&& !mFolderCollection->isReadOnly()) {
QHBoxLayout *hl = new QHBoxLayout();
auto *hl = new QHBoxLayout();
topLayout->addItem(hl);
label = new QLabel(i18nc("@label:textbox Name of the folder.", "&Name:"), this);
hl->addWidget(label);
......@@ -84,7 +84,7 @@ void CollectionGeneralPage::init(const Akonadi::Collection &collection)
if (CommonKernel->imapResourceManager()->hasAnnotationSupport(collectionResource)) {
PimCommon::CollectionTypeUtil::FolderContentsType contentsType = PimCommon::CollectionTypeUtil::ContentsTypeMail;
const PimCommon::CollectionAnnotationsAttribute *annotationAttribute
const auto *annotationAttribute
= collection.attribute<PimCommon::CollectionAnnotationsAttribute>();
const QMap<QByteArray, QByteArray> annotations
......@@ -101,7 +101,7 @@ void CollectionGeneralPage::init(const Akonadi::Collection &collection)
const PimCommon::CollectionTypeUtil::FolderContentsType folderType = collectionUtil.typeFromKolabName(annotations.value(PimCommon::CollectionTypeUtil::kolabFolderType()));
int row = 0;
QGridLayout *gl = new QGridLayout();
auto *gl = new QGridLayout();
topLayout->addItem(gl);
mContentsComboBox = new PimCommon::ContentTypeWidget(this);
gl->addWidget(mContentsComboBox, row, 0, 1, 2);
......@@ -154,7 +154,7 @@ void CollectionGeneralPage::load(const Akonadi::Collection &collection)
}
if (mContentsComboBox) {
const PimCommon::CollectionAnnotationsAttribute *annotationsAttribute
const auto *annotationsAttribute
= collection.attribute<PimCommon::CollectionAnnotationsAttribute>();
if (annotationsAttribute) {
......@@ -196,7 +196,7 @@ void CollectionGeneralPage::save(Collection &collection)
}
mCollectionGeneralWidget->save(collection);
PimCommon::CollectionAnnotationsAttribute *annotationsAttribute
auto *annotationsAttribute
= collection.attribute<PimCommon::CollectionAnnotationsAttribute>(Collection::AddIfMissing);
QMap<QByteArray, QByteArray> annotations = annotationsAttribute->annotations();
......@@ -218,7 +218,7 @@ void CollectionGeneralPage::save(Collection &collection)
const QByteArray kolabName = collectionUtil.kolabNameFromType(type);
if (!kolabName.isEmpty()) {
const QString iconName = collectionUtil.iconNameFromContentsType(type);
Akonadi::EntityDisplayAttribute *attribute
auto *attribute
= collection.attribute<Akonadi::EntityDisplayAttribute>(Akonadi::Collection::AddIfMissing);
attribute->setIconName(iconName);
new Akonadi::CollectionModifyJob(collection);
......
......@@ -20,11 +20,11 @@ using namespace MailCommon;
CollectionGeneralWidget::CollectionGeneralWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *topLayout = new QVBoxLayout(this);
auto *topLayout = new QVBoxLayout(this);
topLayout->setObjectName(QStringLiteral("topLayout"));
topLayout->setContentsMargins({});
// should new mail in this folder be ignored?
QHBoxLayout *hbl = new QHBoxLayout();
auto *hbl = new QHBoxLayout();
topLayout->addItem(hbl);
mNotifyOnNewMailCheckBox
= new QCheckBox(i18n("Act on new/unread mail in this folder"), this);
......@@ -65,7 +65,7 @@ CollectionGeneralWidget::CollectionGeneralWidget(QWidget *parent)
addLine(this, topLayout);
// use grid layout for the following combobox settings
QGridLayout *gl = new QGridLayout();
auto *gl = new QGridLayout();
topLayout->addItem(gl);
gl->setColumnStretch(1, 100); // make the second column use all available space
int row = -1;
......@@ -118,7 +118,7 @@ void CollectionGeneralWidget::save(Akonadi::Collection &collection)
mFolderCollection = FolderSettings::forCollection(collection);
}
if (!mNotifyOnNewMailCheckBox->isChecked()) {
Akonadi::NewMailNotifierAttribute *newMailNotifierAttr = collection.attribute<Akonadi::NewMailNotifierAttribute>(Akonadi::Collection::AddIfMissing);
auto *newMailNotifierAttr = collection.attribute<Akonadi::NewMailNotifierAttribute>(Akonadi::Collection::AddIfMissing);
newMailNotifierAttr->setIgnoreNewMail(true);
} else {
collection.removeAttribute<Akonadi::NewMailNotifierAttribute>();
......
......@@ -18,8 +18,8 @@ using namespace MailCommon;
CollectionTemplatesWidget::CollectionTemplatesWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *topLayout = new QVBoxLayout(this);
QHBoxLayout *topItems = new QHBoxLayout;
auto *topLayout = new QVBoxLayout(this);
auto *topItems = new QHBoxLayout;
topItems->setContentsMargins(0, 0, 0, 0);
topLayout->addLayout(topItems);
......@@ -38,7 +38,7 @@ CollectionTemplatesWidget::CollectionTemplatesWidget(QWidget *parent)
topLayout->addWidget(mWidget);
QHBoxLayout *btns = new QHBoxLayout();
auto *btns = new QHBoxLayout();
QPushButton *copyGlobal = new QPushButton(i18n("&Copy Global Templates"), this);
copyGlobal->setEnabled(false);
btns->addWidget(copyGlobal);
......
......@@ -26,7 +26,7 @@ using namespace MailCommon;
CollectionViewWidget::CollectionViewWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *topLayout = new QVBoxLayout(this);
auto *topLayout = new QVBoxLayout(this);
topLayout->setObjectName(QStringLiteral("topLayout"));
topLayout->setContentsMargins({});
......@@ -41,14 +41,14 @@ CollectionViewWidget::CollectionViewWidget(QWidget *parent)
mShowSenderReceiverComboBox->insertItem(1, i18nc("@item:inlistbox Show sender.", "Sender"));
mShowSenderReceiverComboBox->insertItem(2, i18nc("@item:inlistbox Show receiver.", "Receiver"));
QHBoxLayout *senderReceiverColumnHLayout = new QHBoxLayout();
auto *senderReceiverColumnHLayout = new QHBoxLayout();
senderReceiverColumnHLayout->addWidget(senderReceiverColumnLabel);
senderReceiverColumnHLayout->addWidget(mShowSenderReceiverComboBox);
topLayout->addLayout(senderReceiverColumnHLayout);
// message list
QGroupBox *messageListGroup = new QGroupBox(i18n("Message List"), this);
QVBoxLayout *messageListGroupLayout = new QVBoxLayout(messageListGroup);
auto *messageListGroupLayout = new QVBoxLayout(messageListGroup);
topLayout->addWidget(messageListGroup);
// message list aggregation
......@@ -62,11 +62,11 @@ CollectionViewWidget::CollectionViewWidget(QWidget *parent)
aggregationLabel->setBuddy(mAggregationComboBox);
using MessageList::Utils::AggregationConfigButton;
AggregationConfigButton *aggregationConfigButton = new AggregationConfigButton(messageListGroup, mAggregationComboBox);
auto *aggregationConfigButton = new AggregationConfigButton(messageListGroup, mAggregationComboBox);
// Make sure any changes made in the aggregations configure dialog are reflected in the combo.
connect(aggregationConfigButton, &AggregationConfigButton::configureDialogCompleted, this, &CollectionViewWidget::slotSelectFolderAggregation);
QHBoxLayout *aggregationLayout = new QHBoxLayout();
auto *aggregationLayout = new QHBoxLayout();
aggregationLayout->addWidget(aggregationLabel, 1);
aggregationLayout->addWidget(mAggregationComboBox, 1);
aggregationLayout->addWidget(aggregationConfigButton, 0);
......@@ -83,11 +83,11 @@ CollectionViewWidget::CollectionViewWidget(QWidget *parent)
themeLabel->setBuddy(mThemeComboBox);
using MessageList::Utils::ThemeConfigButton;
ThemeConfigButton *themeConfigButton = new ThemeConfigButton(messageListGroup, mThemeComboBox);
auto *themeConfigButton = new ThemeConfigButton(messageListGroup, mThemeComboBox);
// Make sure any changes made in the themes configure dialog are reflected in the combo.
connect(themeConfigButton, &ThemeConfigButton::configureDialogCompleted, this, &CollectionViewWidget::slotSelectFolderTheme);
QHBoxLayout *themeLayout = new QHBoxLayout();
auto *themeLayout = new QHBoxLayout();
themeLayout->addWidget(themeLabel, 1);
themeLayout->addWidget(mThemeComboBox, 1);
themeLayout->addWidget(themeConfigButton, 0);
......@@ -95,7 +95,7 @@ CollectionViewWidget::CollectionViewWidget(QWidget *parent)
// Message Default Format
QGroupBox *messageFormatGroup = new QGroupBox(i18n("Message Default Format"), this);
QVBoxLayout *messageFormatGroupLayout = new QVBoxLayout(messageFormatGroup);
auto *messageFormatGroupLayout = new QVBoxLayout(messageFormatGroup);
mPreferHtmlToText = new QRadioButton(i18n("Prefer HTML to text"), this);
messageFormatGroupLayout->addWidget(mPreferHtmlToText);
mPreferTextToHtml = new QRadioButton(i18n("Prefer text to HTML"), this);
......@@ -158,10 +158,10 @@ void CollectionViewWidget::save(Akonadi::Collection &col)
const int currentIndex = mShowSenderReceiverComboBox->currentIndex();
if (mShowSenderReceiverValue != currentIndex) {
if (currentIndex == 1) {
Akonadi::MessageFolderAttribute *messageFolder = col.attribute<Akonadi::MessageFolderAttribute>(Akonadi::Collection::AddIfMissing);
auto *messageFolder = col.attribute<Akonadi::MessageFolderAttribute>(Akonadi::Collection::AddIfMissing);
messageFolder->setOutboundFolder(false);
} else if (currentIndex == 2) {
Akonadi::MessageFolderAttribute *messageFolder = col.attribute<Akonadi::MessageFolderAttribute>(Akonadi::Collection::AddIfMissing);
auto *messageFolder = col.attribute<Akonadi::MessageFolderAttribute>(Akonadi::Collection::AddIfMissing);
messageFolder->setOutboundFolder(true);
} else {
col.removeAttribute<Akonadi::MessageFolderAttribute>();
......
......@@ -30,9 +30,9 @@ void FilterActionAddHeaderTest::shouldCreateWidget()
auto comboBox = widget->findChild<QComboBox *>(QStringLiteral("combo"));
QVERIFY(comboBox);
QVERIFY(comboBox->isEditable());
QLabel *label = widget->findChild<QLabel *>(QStringLiteral("label_value"));
auto *label = widget->findChild<QLabel *>(QStringLiteral("label_value"));
QVERIFY(label);
KLineEdit *lineEdit = widget->findChild<KLineEdit *>(QStringLiteral("ledit"));
auto *lineEdit = widget->findChild<KLineEdit *>(QStringLiteral("ledit"));
QVERIFY(lineEdit);
QVERIFY(lineEdit->text().isEmpty());
}
......@@ -52,7 +52,7 @@ void FilterActionAddHeaderTest::shouldClearWidget()
MailCommon::FilterActionAddHeader filter;
QWidget *widget = filter.createParamWidget(nullptr);
auto comboBox = widget->findChild<QComboBox *>(QStringLiteral("combo"));
KLineEdit *lineEdit = widget->findChild<KLineEdit *>(QStringLiteral("ledit"));
auto *lineEdit = widget->findChild<KLineEdit *>(QStringLiteral("ledit"));
comboBox->lineEdit()->setText(QStringLiteral("test"));
lineEdit->setText(QStringLiteral("blo"));
filter.clearParamWidget(widget);
......@@ -188,7 +188,7 @@ void FilterActionAddHeaderTest::shouldAddValue()
filter.argsFromString(argsinput);
filter.setParamWidgetValue(widget);
auto comboBox = widget->findChild<QComboBox *>(QStringLiteral("combo"));
KLineEdit *lineEdit = widget->findChild<KLineEdit *>(QStringLiteral("ledit"));
auto *lineEdit = widget->findChild<KLineEdit *>(QStringLiteral("ledit"));
QCOMPARE(comboBox->lineEdit()->text(), resultheader);
QCOMPARE(lineEdit->text(), resultvalue);
}
......
......@@ -31,7 +31,7 @@ void FilterActionAddToAddressBookTest::shouldHaveDefaultValue()
auto headerCombo = w->findChild<QComboBox *>(QStringLiteral("HeaderComboBox"));
QVERIFY(headerCombo);
QLabel *label = w->findChild<QLabel *>(QStringLiteral("label_with_category"));
auto *label = w->findChild<QLabel *>(QStringLiteral("label_with_category"));
QVERIFY(label);
auto categoryEdit = w->findChild<Akonadi::TagWidget *>(QStringLiteral("CategoryEdit"));
......@@ -40,7 +40,7 @@ void FilterActionAddToAddressBookTest::shouldHaveDefaultValue()
label = w->findChild<QLabel *>(QStringLiteral("label_in_addressbook"));
QVERIFY(label);
Akonadi::CollectionComboBox *collectionComboBox = w->findChild<Akonadi::CollectionComboBox *>(QStringLiteral("AddressBookComboBox"));
auto *collectionComboBox = w->findChild<Akonadi::CollectionComboBox *>(QStringLiteral("AddressBookComboBox"));
QVERIFY(collectionComboBox);
}
......
......@@ -23,7 +23,7 @@ void FilterActionDeleteTest::shouldHaveDefaultValue()
QWidget *w = filter.createParamWidget(nullptr);
QVERIFY(w);
QLabel *lab = dynamic_cast<QLabel *>(w);
auto *lab = dynamic_cast<QLabel *>(w);
QVERIFY(lab);
QCOMPARE(lab->objectName(), QStringLiteral("label_delete"));
}
......
......@@ -24,10 +24,10 @@ void FilterActionExecTest::shouldHaveDefaultValue()
{
MailCommon::FilterActionExec filter;
QWidget *w = filter.createParamWidget(nullptr);
KUrlRequester *requester = w->findChild<KUrlRequester *>(QStringLiteral("requester"));
auto *requester = w->findChild<KUrlRequester *>(QStringLiteral("requester"));
QVERIFY(requester);
MailCommon::FilterActionWithUrlHelpButton *helpButton = w->findChild<MailCommon::FilterActionWithUrlHelpButton *>(QStringLiteral("helpbutton"));
auto *helpButton = w->findChild<MailCommon::FilterActionWithUrlHelpButton *>(QStringLiteral("helpbutton"));
QVERIFY(helpButton);
}
......
......@@ -28,14 +28,14 @@ void FilterActionMissingAccountDialogTest::shouldHaveDefaultValue()
QVERIFY(!dlg.windowTitle().isEmpty());
QVERIFY(dlg.isModal());
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
auto *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
QLabel *label = dlg.findChild<QLabel *>(QStringLiteral("label"));
auto *label = dlg.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
MailCommon::KMFilterAccountList *mAccountList = dlg.findChild<MailCommon::KMFilterAccountList *>(QStringLiteral("accountlist"));
auto *mAccountList = dlg.findChild<MailCommon::KMFilterAccountList *>(QStringLiteral("accountlist"));
QVERIFY(mAccountList);
}
......
......@@ -26,7 +26,7 @@ FilterActionMissingIdentityDialogTest::~FilterActionMissingIdentityDialogTest()
void FilterActionMissingIdentityDialogTest::initTestCase()
{
DummyKernel *kernel = new DummyKernel(nullptr);
auto *kernel = new DummyKernel(nullptr);
CommonKernel->registerKernelIf(kernel); //register KernelIf early, it is used by the Filter classes
CommonKernel->registerSettingsIf(kernel); //SettingsIf is used in FolderTreeWidget
}
......@@ -37,14 +37,14 @@ void FilterActionMissingIdentityDialogTest::shouldHaveDefaultValue()
QVERIFY(dlg.isModal());
QVERIFY(!dlg.windowTitle().isEmpty());
QLabel *label = dlg.findChild<QLabel *>(QStringLiteral("label"));
auto *label = dlg.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
KIdentityManagement::IdentityCombo *mComboBoxIdentity = dlg.findChild<KIdentityManagement::IdentityCombo *>(QStringLiteral("comboboxidentity"));
auto *mComboBoxIdentity = dlg.findChild<KIdentityManagement::IdentityCombo *>(QStringLiteral("comboboxidentity"));
QVERIFY(mComboBoxIdentity);
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
auto *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
}
......
......@@ -27,10 +27,10 @@ void FilterActionMissingSoundUrlDialogTest::shouldHaveDefaultValue()
MailCommon::FilterActionMissingSoundUrlDialog dlg(QStringLiteral("filename"), QStringLiteral("arg"));
QVERIFY(!dlg.windowTitle().isEmpty());
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
auto *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
QLabel *label = dlg.findChild<QLabel *>(QStringLiteral("oldlabel"));
auto *label = dlg.findChild<QLabel *>(QStringLiteral("oldlabel"));
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
......@@ -38,7 +38,7 @@ void FilterActionMissingSoundUrlDialogTest::shouldHaveDefaultValue()
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
KUrlRequester *mUrlWidget = dlg.findChild<KUrlRequester *>(QStringLiteral("urlwidget"));
auto *mUrlWidget = dlg.findChild<KUrlRequester *>(QStringLiteral("urlwidget"));
QVERIFY(mUrlWidget);
}
......
......@@ -30,7 +30,7 @@ void FilterActionMissingTagDialogTest::shouldHaveDefaultValue()
QVERIFY(dlg.isModal());
QVERIFY(!dlg.windowTitle().isEmpty());
QLabel *label = dlg.findChild<QLabel *>(QStringLiteral("tagnamelabel"));
auto *label = dlg.findChild<QLabel *>(QStringLiteral("tagnamelabel"));
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
......@@ -38,13 +38,13 @@ void FilterActionMissingTagDialogTest::shouldHaveDefaultValue()
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
QListWidget *mTagList = dlg.findChild<QListWidget *>(QStringLiteral("taglist"));
auto *mTagList = dlg.findChild<QListWidget *>(QStringLiteral("taglist"));
QVERIFY(mTagList);
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
auto *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
QPushButton *user1Button = dlg.findChild<QPushButton *>(QStringLiteral("addtag"));
auto *user1Button = dlg.findChild<QPushButton *>(QStringLiteral("addtag"));
QVERIFY(user1Button);
QVERIFY(!user1Button->text().isEmpty());
}
......
......@@ -27,14 +27,14 @@ void FilterActionMissingTemplateDialogTest::shouldHaveDefaultValue()
MailCommon::FilterActionMissingTemplateDialog dlg(QStringList(), QStringLiteral("filename"));
QVERIFY(!dlg.windowTitle().isEmpty());
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
auto *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
QLabel *label = dlg.findChild<QLabel *>(QStringLiteral("label"));
auto *label = dlg.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
QComboBox *mComboBoxTemplate = dlg.findChild<QComboBox *>(QStringLiteral("comboboxtemplate"));
auto *mComboBoxTemplate = dlg.findChild<QComboBox *>(QStringLiteral("comboboxtemplate"));
QVERIFY(mComboBoxTemplate);
}
......