From: Hannah von Reth Date: Thu, 5 Mar 2020 17:13:09 +0000 (+0100) Subject: Make sure all cases are handled X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~127 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9176afe2631b87d6fe08f71c49aab66d786bd2fa;p=nextcloud-desktop.git Make sure all cases are handled --- diff --git a/src/common/vfs.h b/src/common/vfs.h index 669e3f5b6..ab39ea8fc 100644 --- a/src/common/vfs.h +++ b/src/common/vfs.h @@ -96,6 +96,7 @@ public: WithSuffix, WindowsCfApi, }; + Q_ENUM(Mode) static QString modeToString(Mode mode); static Optional modeFromString(const QString &str); diff --git a/src/gui/wizard/owncloudwizard.cpp b/src/gui/wizard/owncloudwizard.cpp index 951cc7036..0bd3b67f5 100644 --- a/src/gui/wizard/owncloudwizard.cpp +++ b/src/gui/wizard/owncloudwizard.cpp @@ -334,7 +334,9 @@ void OwncloudWizard::askExperimentalVirtualFilesFeature(QWidget *receiver, const { const auto bestVfsMode = bestAvailableVfsMode(); QMessageBox *msgBox = nullptr; - if (bestVfsMode == Vfs::WindowsCfApi) { + switch (bestVfsMode) + { + case Vfs::WindowsCfApi: msgBox = new QMessageBox( QMessageBox::Warning, tr("Enable technical preview feature?"), @@ -348,8 +350,8 @@ void OwncloudWizard::askExperimentalVirtualFilesFeature(QWidget *receiver, const "and your selective sync settings will be reset."), QMessageBox::NoButton, receiver); msgBox->addButton(tr("Enable virtual files"), QMessageBox::AcceptRole); msgBox->addButton(tr("Continue to use selective sync"), QMessageBox::RejectRole); - } else { - ASSERT(bestVfsMode == Vfs::WithSuffix) + break; + case Vfs::WithSuffix: msgBox = new QMessageBox( QMessageBox::Warning, tr("Enable experimental feature?"), @@ -368,6 +370,9 @@ void OwncloudWizard::askExperimentalVirtualFilesFeature(QWidget *receiver, const .arg(APPLICATION_DOTVIRTUALFILE_SUFFIX), QMessageBox::NoButton, receiver); msgBox->addButton(tr("Enable experimental placeholder mode"), QMessageBox::AcceptRole); msgBox->addButton(tr("Stay safe"), QMessageBox::RejectRole); + break; + case Vfs::Off: + Q_UNREACHABLE(); } connect(msgBox, &QMessageBox::finished, receiver, [callback, msgBox](int result) { callback(result == QMessageBox::AcceptRole);