}
#endif
- // Channel selection
- _ui->updateChannel->setCurrentIndex(ConfigFile().updateChannel() == "beta" ? 1 : 0);
+ // stable, beta, daily
+ ConfigFile config;
+ const auto validUpdateChannels = config.validUpdateChannels();
+ const auto currentUpdateChannelIndex = validUpdateChannels.indexOf(config.updateChannel());
+ _ui->updateChannel->addItems(validUpdateChannels);
+ _ui->updateChannel->setCurrentIndex(currentUpdateChannelIndex);
connect(_ui->updateChannel, &QComboBox::currentTextChanged,
this, &GeneralSettings::slotUpdateChannelChanged, Qt::UniqueConnection);
}
decodedTranslatedChannel = tr("stable");
} else if (channel == QStringLiteral("beta")) {
decodedTranslatedChannel = tr("beta");
+ } else if (channel == QStringLiteral("daily")) {
+ decodedTranslatedChannel = tr("daily");
}
return decodedTranslatedChannel;
};
const auto updateChannelFromLocalized = [](const int index) {
- if (index == 1) {
+ switch(index) {
+ case 1:
return QStringLiteral("beta");
+ break;
+ case 2:
+ return QStringLiteral("daily");
+ break;
+ default:
+ return QStringLiteral("stable");
}
-
- return QStringLiteral("stable");
};
const auto channel = updateChannelFromLocalized(_ui->updateChannel->currentIndex());
<rect>
<x>0</x>
<y>0</y>
- <width>601</width>
+ <width>667</width>
<height>663</height>
</rect>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
+ <enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
+ <enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
+ <enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <item>
- <property name="text">
- <string>stable</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>beta</string>
- </property>
- </item>
</widget>
</item>
<item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
- <enum>Qt::Horizontal</enum>
+ <enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
static constexpr char certPath[] = "http_certificatePath";
static constexpr char certPasswd[] = "http_certificatePasswd";
-
-static const QSet validUpdateChannels { QStringLiteral("stable"), QStringLiteral("beta") };
}
namespace OCC {
QSettings settings(configFile(), QSettings::IniFormat);
const auto channel = settings.value(QLatin1String(updateChannelC), defaultUpdateChannel).toString();
- if (!validUpdateChannels.contains(channel)) {
+ if (!validUpdateChannels().contains(channel)) {
qCWarning(lcConfigFile()) << "Received invalid update channel from confog:"
<< channel
<< "defaulting to:"
return channel;
}
+QStringList ConfigFile::validUpdateChannels() const
+{
+ return { QStringLiteral("stable"), QStringLiteral("beta"), QStringLiteral("daily") };
+}
+
void ConfigFile::setUpdateChannel(const QString &channel)
{
- if (!validUpdateChannels.contains(channel)) {
+ if (!validUpdateChannels().contains(channel)) {
qCWarning(lcConfigFile()) << "Received invalid update channel:"
<< channel
- << "can only accept 'stable' or 'beta'. Ignoring.";
+ << "can only accept 'stable', 'beta' or 'daily'. Ignoring.";
return;
}