Make sure all cases are handled

This commit is contained in:
Hannah von Reth 2020-03-05 18:13:09 +01:00 committed by Kevin Ottens
parent 9b0788bdf8
commit 9176afe263
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2
2 changed files with 9 additions and 3 deletions

View file

@ -96,6 +96,7 @@ public:
WithSuffix,
WindowsCfApi,
};
Q_ENUM(Mode)
static QString modeToString(Mode mode);
static Optional<Mode> modeFromString(const QString &str);

View file

@ -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);