- Timestamp:
- Nov 30, 2011 12:43:36 PM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxUtils.h
r38476 r39473 202 202 public: 203 203 204 VBoxVersion() : m_x(-1), m_y(-1), m_z(-1) {} 205 204 206 VBoxVersion(const QString &strVersion) 205 : m_x( 0), m_y(0), m_z(0)207 : m_x(-1), m_y(-1), m_z(-1) 206 208 { 207 209 QStringList versionStack = strVersion.split('.'); … … 214 216 } 215 217 218 VBoxVersion& operator=(const VBoxVersion &other) { m_x = other.x(); m_y = other.y(); m_z = other.z(); return *this; } 219 220 bool isValid() const { return m_x != -1 && m_y != -1 && m_z != -1; } 221 216 222 bool equal(const VBoxVersion &other) const { return (m_x == other.m_x) && (m_y == other.m_y) && (m_z == other.m_z); } 217 223 bool operator==(const VBoxVersion &other) const { return equal(other); } -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateDefs.cpp
r38476 r39473 24 24 /* Local includes: */ 25 25 #include "UIUpdateDefs.h" 26 #include "VBoxGlobal.h" 26 27 27 28 /* static: */ … … 81 82 bool VBoxUpdateData::isNoNeedToCheck() const 82 83 { 84 /* Return 'false' if Period == Never: */ 83 85 return m_periodIndex == PeriodNever; 84 86 } … … 86 88 bool VBoxUpdateData::isNeedToCheck() const 87 89 { 88 return !isNoNeedToCheck() && QDate::currentDate() >= m_date; 90 /* Return 'false' if Period == Never: */ 91 if (isNoNeedToCheck()) 92 return false; 93 94 /* Return 'true' if date of next check is today or missed: */ 95 if (QDate::currentDate() >= m_date) 96 return true; 97 98 /* Return 'true' if saved version value is NOT valid or NOT equal to current: */ 99 if (!version().isValid() || version() != VBoxVersion(vboxGlobal().vboxVersionStringNormalized())) 100 return true; 101 102 /* Return 'false' in all other cases: */ 103 return false; 89 104 } 90 105 … … 123 138 } 124 139 140 VBoxVersion VBoxUpdateData::version() const 141 { 142 return m_version; 143 } 144 125 145 void VBoxUpdateData::decode() 126 146 { … … 155 175 m_branchIndex = branch == "withbetas" ? BranchWithBetas : 156 176 branch == "allrelease" ? BranchAllRelease : BranchStable; 177 } 178 179 /* Parse 'version' value: */ 180 if (parser.size() > 3) 181 { 182 m_version = VBoxVersion(parser[3]); 157 183 } 158 184 } … … 187 213 m_branchIndex == BranchAllRelease ? "allrelease" : "stable"; 188 214 215 /* Encode 'version' value: */ 216 QString versionValue = VBoxVersion(vboxGlobal().vboxVersionStringNormalized()).toString(); 217 189 218 /* Composite m_strData: */ 190 m_strData = QString("%1, %2, %3 ").arg(remindPeriod, remindDate, branchValue);219 m_strData = QString("%1, %2, %3, %4").arg(remindPeriod, remindDate, branchValue, versionValue); 191 220 } 192 221 } -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateDefs.h
r38476 r39473 22 22 /* Global includes: */ 23 23 #include <QDate> 24 25 /* Local includes: */ 26 #include "VBoxUtils.h" 24 27 25 28 /* This structure is used to store retranslated reminder values. */ … … 82 85 BranchType branchIndex() const; 83 86 QString branchName() const; 87 VBoxVersion version() const; 84 88 85 89 private: … … 95 99 QDate m_date; 96 100 BranchType m_branchIndex; 101 VBoxVersion m_version; 97 102 }; 98 103
Note:
See TracChangeset
for help on using the changeset viewer.