Commit c44ef08d authored by Laurent Montel's avatar Laurent Montel 😁

use new connect api + port some foreach

parent 966329eb
......@@ -72,7 +72,7 @@ void ArchiveMailManager::load()
ArchiveMailInfo *info = new ArchiveMailInfo(group);
if (ArchiveMailAgentUtil::needToArchive(info)) {
Q_FOREACH (ArchiveMailInfo *oldInfo, mListArchiveInfo) {
for (ArchiveMailInfo *oldInfo : qAsConst(mListArchiveInfo)) {
if (oldInfo->saveCollectionId() == info->saveCollectionId()) {
//already in jobscheduler
delete info;
......
......@@ -552,7 +552,7 @@ QString FilterManager::createUniqueName(const QString &name) const
while (found) {
found = false;
foreach (const MailCommon::MailFilter *filter, d->mFilters) {
for (const MailCommon::MailFilter *filter : qAsConst(d->mFilters)) {
if (!filter->name().compare(uniqueName)) {
found = true;
++counter;
......
......@@ -497,8 +497,7 @@ AppearancePageLayoutTab::AppearancePageLayoutTab(QWidget *parent)
mFolderListGroup = new QButtonGroup(this),
Qt::Vertical, KMailSettings::self()->folderListItem());
vlay->addWidget(mFolderListGroupBox);
connect(mFolderListGroup, SIGNAL(buttonClicked(int)),
this, SLOT(slotEmitChanged()));
connect(mFolderListGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &ConfigModuleTab::slotEmitChanged);
QHBoxLayout *folderCBHLayout = new QHBoxLayout;
mFolderQuickSearchCB = new QCheckBox(i18n("Show folder quick search field"), this);
......@@ -511,8 +510,7 @@ AppearancePageLayoutTab::AppearancePageLayoutTab(QWidget *parent)
mFavoriteFoldersViewGroupBox->setTitle(i18n("Show Favorite Folders View"));
mFavoriteFoldersViewGroupBox->setLayout(new QVBoxLayout());
mFavoriteFoldersViewGroup = new QButtonGroup(this);
connect(mFavoriteFoldersViewGroup, SIGNAL(buttonClicked(int)),
this, SLOT(slotEmitChanged()));
connect(mFavoriteFoldersViewGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &ConfigModuleTab::slotEmitChanged);
QRadioButton *favoriteFoldersViewHiddenRadio = new QRadioButton(i18n("Never"), mFavoriteFoldersViewGroupBox);
mFavoriteFoldersViewGroup->addButton(favoriteFoldersViewHiddenRadio, static_cast<int>(MailCommon::MailCommonSettings::EnumFavoriteCollectionViewMode::HiddenMode));
......@@ -533,8 +531,8 @@ AppearancePageLayoutTab::AppearancePageLayoutTab(QWidget *parent)
mFolderToolTipsGroupBox->setTitle(i18n("Folder Tooltips"));
mFolderToolTipsGroupBox->setLayout(new QVBoxLayout());
mFolderToolTipsGroup = new QButtonGroup(this);
connect(mFolderToolTipsGroup, SIGNAL(buttonClicked(int)),
this, SLOT(slotEmitChanged()));
connect(mFolderToolTipsGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &ConfigModuleTab::slotEmitChanged);
QRadioButton *folderToolTipsAlwaysRadio = new QRadioButton(i18n("Always"), mFolderToolTipsGroupBox);
mFolderToolTipsGroup->addButton(folderToolTipsAlwaysRadio, static_cast< int >(FolderTreeWidget::DisplayAlways));
......@@ -551,8 +549,8 @@ AppearancePageLayoutTab::AppearancePageLayoutTab(QWidget *parent)
mReaderWindowModeGroup = new QButtonGroup(this),
Qt::Vertical, KMailSettings::self()->readerWindowModeItem());
vlay->addWidget(mReaderWindowModeGroupBox);
connect(mReaderWindowModeGroup, SIGNAL(buttonClicked(int)),
this, SLOT(slotEmitChanged()));
connect(mReaderWindowModeGroup, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &ConfigModuleTab::slotEmitChanged);
vlay->addStretch(10); // spacer
}
......@@ -744,7 +742,7 @@ AppearancePageHeadersTab::AppearancePageHeadersTab(QWidget *parent)
} // end for loop populating mDateDisplay
vlay->addWidget(mDateDisplayBox);
connect(mDateDisplay, SIGNAL(buttonClicked(int)), this, SLOT(slotEmitChanged()));
connect(mDateDisplay, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &ConfigModuleTab::slotEmitChanged);
vlay->addStretch(10); // spacer
}
......
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