Commit 7784b04b authored by Laurent Montel's avatar Laurent Montel 😁

Modernize code (using auto)

parent 99152321
Pipeline #39253 passed with stage
in 12 minutes and 58 seconds
......@@ -35,17 +35,17 @@ SieveEditorConfigureServerPageTest::~SieveEditorConfigureServerPageTest()
void SieveEditorConfigureServerPageTest::shouldHaveDefaultValue()
{
SieveEditorConfigureServerPage w;
QPushButton *button = w.findChild<QPushButton *>(QStringLiteral("configure_button"));
auto *button = w.findChild<QPushButton *>(QStringLiteral("configure_button"));
QVERIFY(button);
QPushButton *importSieveSettings = w.findChild<QPushButton *>(QStringLiteral("import_sieve_settings_button"));
auto *importSieveSettings = w.findChild<QPushButton *>(QStringLiteral("import_sieve_settings_button"));
QVERIFY(importSieveSettings);
}
void SieveEditorConfigureServerPageTest::shouldEmitSignalWhenClickOnConfigureButton()
{
SieveEditorConfigureServerPage w;
QPushButton *button = w.findChild<QPushButton *>(QStringLiteral("configure_button"));
auto *button = w.findChild<QPushButton *>(QStringLiteral("configure_button"));
QSignalSpy spy(&w, &SieveEditorConfigureServerPage::configureClicked);
QTest::mouseClick(button, Qt::LeftButton);
QCOMPARE(spy.count(), 1);
......@@ -54,7 +54,7 @@ void SieveEditorConfigureServerPageTest::shouldEmitSignalWhenClickOnConfigureBut
void SieveEditorConfigureServerPageTest::shouldEmitSignalWhenClickOnImportSieveButton()
{
SieveEditorConfigureServerPage w;
QPushButton *button = w.findChild<QPushButton *>(QStringLiteral("import_sieve_settings_button"));
auto *button = w.findChild<QPushButton *>(QStringLiteral("import_sieve_settings_button"));
QSignalSpy spy(&w, &SieveEditorConfigureServerPage::importSieveSettings);
QTest::mouseClick(button, Qt::LeftButton);
QCOMPARE(spy.count(), 1);
......
......@@ -36,16 +36,16 @@ ImportImapSettingFinishPageTest::~ImportImapSettingFinishPageTest()
void ImportImapSettingFinishPageTest::shouldHaveDefaultValue()
{
ImportImapSettingFinishPage w;
QLabel *label = w.findChild<QLabel *>(QStringLiteral("label"));
auto *label = w.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
QTextEdit *mTextEdit = w.findChild<QTextEdit *>(QStringLiteral("textedit"));
auto *mTextEdit = w.findChild<QTextEdit *>(QStringLiteral("textedit"));
QVERIFY(mTextEdit);
QVERIFY(mTextEdit->isReadOnly());
QVERIFY(mTextEdit->document()->isEmpty());
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
auto *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
}
......
......@@ -35,11 +35,11 @@ ImportImapSettingNoFoundPageTest::~ImportImapSettingNoFoundPageTest()
void ImportImapSettingNoFoundPageTest::shouldHaveDefaultValue()
{
ImportImapSettingNoFoundPage w;
QLabel *lab = w.findChild<QLabel *>(QStringLiteral("label"));
auto *lab = w.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(lab);
QVERIFY(!lab->text().isEmpty());
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
auto *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
}
......
......@@ -38,12 +38,12 @@ void ImportImapSettingProgressPageTest::shouldHaveDefaultValue()
{
ImportImapSettingProgressPage w;
QTextEdit *mProgressTextEdit = w.findChild<QTextEdit *>(QStringLiteral("textedit"));
auto *mProgressTextEdit = w.findChild<QTextEdit *>(QStringLiteral("textedit"));
QVERIFY(mProgressTextEdit);
QVERIFY(mProgressTextEdit->isReadOnly());
QVERIFY(mProgressTextEdit->document()->isEmpty());
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
auto *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
}
......
......@@ -37,15 +37,15 @@ ImportImapSettingSearchPageTest::~ImportImapSettingSearchPageTest()
void ImportImapSettingSearchPageTest::shouldHaveDefaultValue()
{
ImportImapSettingSearchPage w;
QLabel *label = w.findChild<QLabel *>(QStringLiteral("label"));
auto *label = w.findChild<QLabel *>(QStringLiteral("label"));
QVERIFY(label);
QVERIFY(!label->text().isEmpty());
QListWidget *mFoundProgramList = w.findChild<QListWidget *>(QStringLiteral("foundprogramlist"));
auto *mFoundProgramList = w.findChild<QListWidget *>(QStringLiteral("foundprogramlist"));
QVERIFY(mFoundProgramList);
QCOMPARE(mFoundProgramList->count(), 0);
QVBoxLayout *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
auto *mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainlayout"));
QVERIFY(mainLayout);
}
......@@ -57,7 +57,7 @@ void ImportImapSettingSearchPageTest::shouldAddCheckPrograms()
};
w.setProgramList(lst);
QListWidget *mFoundProgramList = w.findChild<QListWidget *>(QStringLiteral("foundprogramlist"));
auto *mFoundProgramList = w.findChild<QListWidget *>(QStringLiteral("foundprogramlist"));
QCOMPARE(mFoundProgramList->count(), lst.count());
for (int i = 0; i < mFoundProgramList->count(); ++i) {
QCOMPARE(mFoundProgramList->item(i)->checkState(), Qt::Unchecked);
......
......@@ -26,7 +26,7 @@
ImportImapSettingFinishPage::ImportImapSettingFinishPage(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainlayout = new QVBoxLayout(this);
auto *mainlayout = new QVBoxLayout(this);
mainlayout->setObjectName(QStringLiteral("mainlayout"));
QLabel *label = new QLabel(i18n("IMAP settings were imported:"), this);
......
......@@ -25,7 +25,7 @@
ImportImapSettingNoFoundPage::ImportImapSettingNoFoundPage(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
QLabel *lab = new QLabel(i18n("No settings found to import."));
......
......@@ -27,7 +27,7 @@
ImportImapSettingProgressPage::ImportImapSettingProgressPage(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mProgressTextEdit = new QTextEdit(this);
mProgressTextEdit->setObjectName(QStringLiteral("textedit"));
......
......@@ -27,7 +27,7 @@
ImportImapSettingSearchPage::ImportImapSettingSearchPage(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
QLabel *label = new QLabel(i18n("Please select the program from which you like to import IMAP settings:"), this);
label->setObjectName(QStringLiteral("label"));
......@@ -46,7 +46,7 @@ ImportImapSettingSearchPage::~ImportImapSettingSearchPage()
void ImportImapSettingSearchPage::setProgramList(const QStringList &lst)
{
for (const QString &prog : lst) {
QListWidgetItem *item = new QListWidgetItem(prog, mFoundProgramList);
auto *item = new QListWidgetItem(prog, mFoundProgramList);
item->setFlags(item->flags() | Qt::ItemIsUserCheckable);
item->setCheckState(Qt::Unchecked);
}
......
......@@ -71,14 +71,14 @@ ImportImapSettingWizard::~ImportImapSettingWizard()
void ImportImapSettingWizard::initializeWizard()
{
bool hasSettingToImport = false;
ImportImapSettingsThunderbirdCheckJob *thjob = new ImportImapSettingsThunderbirdCheckJob(this);
auto *thjob = new ImportImapSettingsThunderbirdCheckJob(this);
if (thjob->settingsCanBeImported()) {
mListCheckJob.insert(thjob->name(), thjob);
hasSettingToImport = true;
} else {
delete thjob;
}
ImportImapSettingsAkonadiCheckJob *akonadiJob = new ImportImapSettingsAkonadiCheckJob(this);
auto *akonadiJob = new ImportImapSettingsAkonadiCheckJob(this);
akonadiJob->setImapSettingsPassword(new ImportImapSettingsAkonadiPassword);
if (akonadiJob->settingsCanBeImported()) {
mListCheckJob.insert(akonadiJob->name(), akonadiJob);
......
......@@ -75,7 +75,7 @@ int main(int argc, char **argv)
KDBusService service(KDBusService::Unique);
SieveEditorMainWindow *mw = new SieveEditorMainWindow();
auto *mw = new SieveEditorMainWindow();
mw->show();
const int val = app.exec();
return val;
......
......@@ -39,7 +39,7 @@ void ServerSieveListWidget::readConfig()
{
const QVector<SieveEditorUtil::SieveServerConfig> lstServer = SieveEditorUtil::readServerSieveConfig();
for (const SieveEditorUtil::SieveServerConfig &conf : lstServer) {
ServerSieveListWidgetItem *item = new ServerSieveListWidgetItem(this);
auto *item = new ServerSieveListWidgetItem(this);
item->setServerConfig(conf);
}
}
......@@ -48,7 +48,7 @@ void ServerSieveListWidget::writeConfig()
{
QVector<SieveEditorUtil::SieveServerConfig> lstServerConfig;
for (int i = 0; i < count(); ++i) {
ServerSieveListWidgetItem *serverSieveItem = static_cast<ServerSieveListWidgetItem *>(item(i));
auto *serverSieveItem = static_cast<ServerSieveListWidgetItem *>(item(i));
if (serverSieveItem) {
SieveEditorUtil::SieveServerConfig config = serverSieveItem->serverConfig();
config.enabled = (serverSieveItem->checkState() == Qt::Checked);
......@@ -66,7 +66,7 @@ void ServerSieveListWidget::modifyServerConfig()
return;
}
ServerSieveListWidgetItem *serverSieveListItem = static_cast<ServerSieveListWidgetItem *>(item);
auto *serverSieveListItem = static_cast<ServerSieveListWidgetItem *>(item);
QPointer<ServerSieveSettingsDialog> dlg = new ServerSieveSettingsDialog(this);
dlg->setWindowTitle(i18nc("@title:window", "Modify Settings"));
......@@ -79,7 +79,7 @@ void ServerSieveListWidget::modifyServerConfig()
void ServerSieveListWidget::deleteServerConfig(QListWidgetItem *item)
{
ServerSieveListWidgetItem *serverSieveListItem = static_cast<ServerSieveListWidgetItem *>(item);
auto *serverSieveListItem = static_cast<ServerSieveListWidgetItem *>(item);
SieveEditorUtil::SieveServerConfig conf = serverSieveListItem->serverConfig();
mNeedToRemovePasswordInWallet.append(SieveEditorUtil::sievePasswordIdentifier(conf.sieveSettings.userName, conf.sieveSettings.serverName));
......@@ -93,7 +93,7 @@ void ServerSieveListWidget::addServerConfig()
{
QPointer<ServerSieveSettingsDialog> dlg = new ServerSieveSettingsDialog(this);
if (dlg->exec()) {
ServerSieveListWidgetItem *item = new ServerSieveListWidgetItem(this);
auto *item = new ServerSieveListWidgetItem(this);
item->setServerConfig(dlg->serverSieveConfig());
}
delete dlg;
......
......@@ -31,13 +31,13 @@ ServerSieveSettingsDialog::ServerSieveSettingsDialog(QWidget *parent)
setWindowTitle(i18nc("@title:window", "Add Sieve Server"));
QWidget *w = new QWidget;
QVBoxLayout *lay = new QVBoxLayout;
auto *lay = new QVBoxLayout;
mServerSieveSettings = new ServerSieveSettings;
connect(mServerSieveSettings, &ServerSieveSettings::enableOkButton, this, &ServerSieveSettingsDialog::slotEnableButtonOk);
lay->addWidget(mServerSieveSettings);
lay->setContentsMargins({});
w->setLayout(lay);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto *mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(w);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
......
......@@ -51,7 +51,7 @@ SieveEditorConfigureDialog::SieveEditorConfigureDialog(QWidget *parent)
//Server page
QWidget *serverConfigureWiget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout(serverConfigureWiget);
auto *layout = new QVBoxLayout(serverConfigureWiget);
mServerWidget = new SieveEditorConfigureServerWidget;
layout->addWidget(mServerWidget);
......@@ -83,7 +83,7 @@ SieveEditorConfigureDialog::SieveEditorConfigureDialog(QWidget *parent)
mUserFeedbackWidget = new KUserFeedback::FeedbackConfigWidget(this);
QHBoxLayout *userFeedBackLayout = new QHBoxLayout(userFeedBackWidget);
auto *userFeedBackLayout = new QHBoxLayout(userFeedBackWidget);
userFeedBackLayout->setContentsMargins({});
userFeedBackLayout->addWidget(mUserFeedbackWidget);
......
......@@ -27,7 +27,7 @@
SieveEditorConfigureServerPage::SieveEditorConfigureServerPage(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *hbox = new QHBoxLayout(this);
auto *hbox = new QHBoxLayout(this);
hbox->addStretch(1);
QPushButton *button = new QPushButton(i18n("Configure..."));
button->setObjectName(QStringLiteral("configure_button"));
......
......@@ -78,7 +78,7 @@ SieveEditorMainWidget::~SieveEditorMainWidget()
QWidget *SieveEditorMainWidget::hasExistingPage(const QUrl &url)
{
for (int i = 0; i < mTabWidget->count(); ++i) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(mTabWidget->widget(i));
auto *page = qobject_cast<SieveEditorPageWidget *>(mTabWidget->widget(i));
if (page) {
if (page->currentUrl() == url) {
return page;
......@@ -111,7 +111,7 @@ void SieveEditorMainWidget::slotScriptRenamed(const QUrl &oldUrl, const QUrl &ne
{
QWidget *page = hasExistingPage(oldUrl);
if (page) {
if (SieveEditorPageWidget *editor = qobject_cast<SieveEditorPageWidget *>(page)) {
if (auto *editor = qobject_cast<SieveEditorPageWidget *>(page)) {
editor->setCurrentUrl(newUrl);
const QString newScriptName = newUrl.fileName();
mTabWidget->setTabText(mTabWidget->indexOf(page), newScriptName);
......@@ -127,7 +127,7 @@ void SieveEditorMainWidget::slotCreateScriptPage(const KSieveUi::ManageSieveWidg
if (page) {
mTabWidget->setCurrentWidget(page);
} else {
SieveEditorPageWidget *editor = new SieveEditorPageWidget;
auto *editor = new SieveEditorPageWidget;
connect(editor, &SieveEditorPageWidget::refreshList, this, &SieveEditorMainWidget::updateScriptList);
connect(editor, &SieveEditorPageWidget::scriptModified, this, &SieveEditorMainWidget::slotScriptModified);
connect(editor, &SieveEditorPageWidget::modeEditorChanged, this, &SieveEditorMainWidget::modeEditorChanged);
......@@ -181,7 +181,7 @@ void SieveEditorMainWidget::uploadScript()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->uploadScript();
}
......@@ -192,7 +192,7 @@ bool SieveEditorMainWidget::needToSaveScript()
{
bool scriptSaved = false;
for (int i = 0; i < mTabWidget->count(); ++i) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(mTabWidget->widget(i));
auto *page = qobject_cast<SieveEditorPageWidget *>(mTabWidget->widget(i));
if (page) {
const bool result = page->needToSaveScript();
if (result) {
......@@ -212,7 +212,7 @@ bool SieveEditorMainWidget::isUndoAvailable() const
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
return page->isUndoAvailable();
}
......@@ -224,7 +224,7 @@ bool SieveEditorMainWidget::isRedoAvailable() const
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
return page->isRedoAvailable();
}
......@@ -236,7 +236,7 @@ bool SieveEditorMainWidget::isWordWrap() const
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
return page->isWordWrap();
}
......@@ -248,7 +248,7 @@ bool SieveEditorMainWidget::hasSelection() const
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
return page->hasSelection();
}
......@@ -260,7 +260,7 @@ void SieveEditorMainWidget::slotSelectAll()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->selectAll();
}
......@@ -271,7 +271,7 @@ void SieveEditorMainWidget::slotCopy()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->copy();
}
......@@ -282,7 +282,7 @@ void SieveEditorMainWidget::slotPaste()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->paste();
}
......@@ -293,7 +293,7 @@ void SieveEditorMainWidget::slotCut()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->cut();
}
......@@ -304,7 +304,7 @@ void SieveEditorMainWidget::slotUndo()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->undo();
}
......@@ -315,7 +315,7 @@ void SieveEditorMainWidget::slotRedo()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->redo();
}
......@@ -326,7 +326,7 @@ void SieveEditorMainWidget::slotGoToLine()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->goToLine();
}
......@@ -337,7 +337,7 @@ void SieveEditorMainWidget::slotFind()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->find();
}
......@@ -348,7 +348,7 @@ void SieveEditorMainWidget::slotReplace()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->replace();
}
......@@ -359,7 +359,7 @@ void SieveEditorMainWidget::slotShareScript()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->shareScript();
}
......@@ -370,7 +370,7 @@ QString SieveEditorMainWidget::currentText() const
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
return page->currentText();
}
......@@ -382,7 +382,7 @@ void SieveEditorMainWidget::slotCreateRulesGraphically()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->createRulesGraphically();
}
......@@ -393,7 +393,7 @@ void SieveEditorMainWidget::slotCheckSyntax()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->checkSyntax();
}
......@@ -404,7 +404,7 @@ void SieveEditorMainWidget::slotComment()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->comment();
}
......@@ -415,7 +415,7 @@ void SieveEditorMainWidget::slotUncomment()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->uncomment();
}
......@@ -426,7 +426,7 @@ void SieveEditorMainWidget::slotImport()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->import();
}
......@@ -437,7 +437,7 @@ void SieveEditorMainWidget::slotCheckSpelling()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->checkSpelling();
}
......@@ -448,7 +448,7 @@ void SieveEditorMainWidget::slotSaveAs()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->saveAs();
}
......@@ -459,7 +459,7 @@ void SieveEditorMainWidget::slotReverseCase()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->reverseCase();
}
......@@ -470,7 +470,7 @@ void SieveEditorMainWidget::slotDebugSieveScript()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->debugSieveScript();
}
......@@ -481,7 +481,7 @@ void SieveEditorMainWidget::slotUpperCase()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->upperCase();
}
......@@ -492,7 +492,7 @@ void SieveEditorMainWidget::slotSentenceCase()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->sentenceCase();
}
......@@ -503,7 +503,7 @@ void SieveEditorMainWidget::slotLowerCase()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->lowerCase();
}
......@@ -525,7 +525,7 @@ void SieveEditorMainWidget::slotZoomIn()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->zoomIn();
}
......@@ -536,7 +536,7 @@ void SieveEditorMainWidget::slotZoomOut()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->zoomOut();
}
......@@ -547,7 +547,7 @@ void SieveEditorMainWidget::slotZoomReset()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->zoomReset();
}
......@@ -558,7 +558,7 @@ void SieveEditorMainWidget::slotWordWrap(bool state)
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->wordWrap(state);
}
......@@ -569,7 +569,7 @@ void SieveEditorMainWidget::slotPrintPreview()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast<SieveEditorPageWidget *>(w);
if (page) {
page->printPreview();
}
......@@ -580,7 +580,7 @@ void SieveEditorMainWidget::slotPrint()
{
QWidget *w = mTabWidget->currentWidget();
if (w) {
SieveEditorPageWidget *page = qobject_cast<SieveEditorPageWidget *>(w);
auto *page = qobject_cast