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

Use modern enum

parent a1b25580
......@@ -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();
}
......@@ -46,7 +46,7 @@ class LIBIMPORTWIZARD_EXPORT ImportWizard : public KAssistantDialog
{
Q_OBJECT
public:
enum WizardMode {
enum class WizardMode {
AutoDetect = 0,
Manual = 1
};
......
......@@ -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;
}
}
}
......
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