mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Handle conversion from input QComboBox index to update channel string more safely
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
71fde8876e
commit
e30188d8e4
@ -329,21 +329,11 @@ void GeneralSettings::slotUpdateChannelChanged(const QString &translatedChannel)
|
||||
};
|
||||
|
||||
const auto updateChannelFromLocalized = [](const int index) {
|
||||
auto channel = QString{};
|
||||
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
channel = QStringLiteral("stable");
|
||||
break;
|
||||
case 1:
|
||||
channel = QStringLiteral("beta");
|
||||
break;
|
||||
default:
|
||||
channel = QString{};
|
||||
if (index == 1) {
|
||||
return QStringLiteral("beta");
|
||||
}
|
||||
|
||||
return channel;
|
||||
return QStringLiteral("stable");
|
||||
};
|
||||
|
||||
const auto channel = updateChannelFromLocalized(_ui->updateChannel->currentIndex());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user