23 #include "updatechannel.h"
27 #if defined(Q_OS_WIN32)
28 #define UPDATE_PLATFORM "win32"
29 #elif defined(Q_OS_DARWIN)
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;
90 channelName = other.channelName;
94 bool UpdateChannel::isNull()
const
96 return this->channelName.isNull();
99 QString UpdateChannel::name()
const
101 assert(!isNull() &&
"UpdateChannel::name() on a null object");
102 return this->channelName;
105 QString UpdateChannel::translatedDescription()
const
107 assert(!isNull() &&
"UpdateChannel::translatedDescription() on a null object");
108 if (channelName == CHANNEL_BETA)
110 return UpdateChannelTr::tr(
111 "Beta versions have newer features but they "
112 "are untested. Releases on this update channel "
113 "are more often and are suggested for users "
114 "who want newest functionalities and minor bug fixes "
115 "as soon as they become implemented and available."
118 else if (channelName == CHANNEL_STABLE)
120 return UpdateChannelTr::tr(
121 "Stable versions are released rarely. They cover "
122 "many changes at once and these changes are more certain "
123 "to work correctly. Critical bug fixes are also provided "
124 "through this channel."
133 QString UpdateChannel::translatedName()
const
135 assert(!isNull() &&
"UpdateChannel::translatedName() on a null object");
136 if (channelName == CHANNEL_BETA)
138 return UpdateChannelTr::tr(
"Beta");
140 else if (channelName == CHANNEL_STABLE)
142 return UpdateChannelTr::tr(
"Stable");
152 return QString(
"update-info_%1_%2.js").arg(UPDATE_PLATFORM).arg(channelName);