summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-04-18 07:37:59 +0200
committerMontel Laurent <[email protected]>2017-04-18 07:37:59 +0200
commit8c1262e1771c59e34544980b58c987ec69a5db1a (patch)
tree1bd873ac92a90e64c0d9d461cade8a35a645becd
parenta1b255801c6b45db107970243f0cc5680acdeced (diff)
Use modern enum
-rw-r--r--src/importwizard.cpp6
-rw-r--r--src/importwizard.h2
-rw-r--r--src/main.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/importwizard.cpp b/src/importwizard.cpp
index 146f07e..e5ced65 100644
--- a/src/importwizard.cpp
+++ b/src/importwizard.cpp
@@ -78,7 +78,7 @@ ImportWizard::ImportWizard(WizardMode mode, QWidget *parent)
resize(640, 480);
Akonadi::ControlGui::widgetNeedsAkonadi(this);
- if (mode == AutoDetect) {
+ if (mode == WizardMode::AutoDetect) {
checkModules();
KMessageBox::information(this, i18n("Close KMail before importing data. Some plugins will modify KMail config file."));
}
@@ -113,7 +113,7 @@ void ImportWizard::writeConfig()
void ImportWizard::updatePagesFromMode()
{
- const bool autodetectMode = (mMode == AutoDetect);
+ const bool autodetectMode = (mMode == WizardMode::AutoDetect);
setAppropriate(mSelectProgramPageItem, autodetectMode);
setAppropriate(mSelectComponentPageItem, autodetectMode);
setAppropriate(mImportMailPageItem, autodetectMode);
@@ -427,6 +427,6 @@ void ImportWizard::addFinishError(const QString &log)
void ImportWizard::slotSelectManualSelectionChanged(bool b)
{
- mMode = b ? Manual : AutoDetect;
+ mMode = b ? WizardMode::Manual : WizardMode::AutoDetect;
updatePagesFromMode();
}
diff --git a/src/importwizard.h b/src/importwizard.h
index c0cee9e..d7cb1d3 100644
--- a/src/importwizard.h
+++ b/src/importwizard.h
@@ -46,7 +46,7 @@ class LIBIMPORTWIZARD_EXPORT ImportWizard : public KAssistantDialog
{
Q_OBJECT
public:
- enum WizardMode {
+ enum class WizardMode {
AutoDetect = 0,
Manual = 1
};
diff --git a/src/main.cpp b/src/main.cpp
index a90e4a4..e71f6f0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -67,12 +67,12 @@ int main(int argc, char *argv[])
KDBusService service(KDBusService::Unique);
- ImportWizard::WizardMode mode = ImportWizard::AutoDetect;
+ ImportWizard::WizardMode mode = ImportWizard::WizardMode::AutoDetect;
if (parser.isSet(QStringLiteral("mode"))) {
if (!parser.positionalArguments().isEmpty()) {
const QString modeStr = parser.positionalArguments().at(0);
if (modeStr == QLatin1String("manual")) {
- mode = ImportWizard::Manual;
+ mode = ImportWizard::WizardMode::Manual;
}
}
}