23 #include "updatechannel.h" 27 #if defined(Q_OS_WIN32) 28 #define UPDATE_PLATFORM "win32" 29 #elif defined(Q_OS_MAC) 30 #define UPDATE_PLATFORM "macosx" 32 #ifdef WITH_AUTOUPDATES 33 #error "No platform for updater!" 35 #define UPDATE_PLATFORM "none" 39 const QString CHANNEL_BETA =
"beta";
40 const QString CHANNEL_STABLE =
"stable";
44 this->channelName = name;
49 this->channelName = other.channelName;
54 QList<UpdateChannel> list;
65 if (channel.name() == name)
83 bool UpdateChannel::operator==(
const UpdateChannel& other)
const 85 return this->channelName == other.channelName;
88 bool UpdateChannel::isNull()
const 90 return this->channelName.isNull();
93 QString UpdateChannel::name()
const 95 assert(!isNull() &&
"UpdateChannel::name() on a null object");
96 return this->channelName;
99 QString UpdateChannel::translatedDescription()
const 101 assert(!isNull() &&
"UpdateChannel::translatedDescription() on a null object");
102 if (channelName == CHANNEL_BETA)
104 return UpdateChannelTr::tr(
105 "Beta versions have newer features but they " 106 "are untested. Releases on this update channel " 107 "are more often and are suggested for users " 108 "who want newest functionalities and minor bug fixes " 109 "as soon as they become implemented and available." 112 else if (channelName == CHANNEL_STABLE)
114 return UpdateChannelTr::tr(
115 "Stable versions are released rarely. They cover " 116 "many changes at once and these changes are more certain " 117 "to work correctly. Critical bug fixes are also provided " 118 "through this channel." 127 QString UpdateChannel::translatedName()
const 129 assert(!isNull() &&
"UpdateChannel::translatedName() on a null object");
130 if (channelName == CHANNEL_BETA)
132 return UpdateChannelTr::tr(
"Beta");
134 else if (channelName == CHANNEL_STABLE)
136 return UpdateChannelTr::tr(
"Stable");
146 return QString(
"update-info_%1_%2.js").arg(UPDATE_PLATFORM).arg(channelName);
static UpdateChannel fromName(const QString &name)
Creates object from its internal name.
static QList< UpdateChannel > allChannels()
List of all available channels.
QString versionDataFileName() const
Full name of "update-info*.js" file for given channel and platform.
UpdateChannel()
Creates a null object.
static UpdateChannel mkStable()
Creates "stable" channel object.
static UpdateChannel mkBeta()
Creates "beta" channel object.