Changeset 70827 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 31, 2018 12:26:20 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVersion.h
r70826 r70827 25 25 26 26 /** Constructs default object. */ 27 UIVersion() : m_x(-1), m_y(-1), m_z(-1) {} 27 UIVersion() 28 : m_x(-1), m_y(-1), m_z(-1) 29 {} 28 30 29 31 /** Constructs object based on parsed @a strVersion. */ … … 31 33 : m_x(-1), m_y(-1), m_z(-1) 32 34 { 33 QStringList versionStack = strVersion.split('.');35 const QStringList versionStack = strVersion.split('.'); 34 36 if (versionStack.size() > 0) 35 37 m_x = versionStack[0].toInt(); … … 40 42 } 41 43 42 /** Assigns this object with value of @a other. */ 43 UIVersion& operator=(const UIVersion &other) { m_x = other.x(); m_y = other.y(); m_z = other.z(); return *this; } 44 /** Assigns this object with value of @a another. */ 45 UIVersion &operator=(const UIVersion &another) 46 { 47 m_x = another.x(); 48 m_y = another.y(); 49 m_z = another.z(); 50 return *this; 51 } 44 52 45 53 /** Returns whether this object is valid. */ 46 bool isValid() const { return m_x != -1 && m_y != -1 && m_z != -1; }54 bool isValid() const { return (m_x != -1) && (m_y != -1) && (m_z != -1); } 47 55 48 56 /** Returns whether this object is equal to @a other. */ … … 56 64 bool operator<(const UIVersion &other) const 57 65 { 58 return (m_x < other.m_x) ||59 (m_x == other.m_x && m_y < other.m_y) ||60 (m_x == other.m_x && m_y == other.m_y && m_z < other.m_z);66 return (m_x < other.m_x) 67 || (m_x == other.m_x && m_y < other.m_y) 68 || (m_x == other.m_x && m_y == other.m_y && m_z < other.m_z); 61 69 } 62 70 /** Checks whether this object is more than @a other. */ 63 71 bool operator>(const UIVersion &other) const 64 72 { 65 return (m_x > other.m_x) ||66 (m_x == other.m_x && m_y > other.m_y) ||67 (m_x == other.m_x && m_y == other.m_y && m_z > other.m_z);73 return (m_x > other.m_x) 74 || (m_x == other.m_x && m_y > other.m_y) 75 || (m_x == other.m_x && m_y == other.m_y && m_z > other.m_z); 68 76 } 69 77 70 78 /** Returns object string representation. */ 71 QString toString() const 72 { 73 return QString("%1.%2.%3").arg(m_x).arg(m_y).arg(m_z); 74 } 79 QString toString() const { return QString("%1.%2.%3").arg(m_x).arg(m_y).arg(m_z); } 75 80 76 81 /** Returns the object X value. */
Note:
See TracChangeset
for help on using the changeset viewer.