VirtualBox

Changeset 70827 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jan 31, 2018 12:26:20 PM (7 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9104: Reworking VBoxVersion stuff: Refactoring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIVersion.h

    r70826 r70827  
    2525
    2626    /** 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    {}
    2830
    2931    /** Constructs object based on parsed @a strVersion. */
     
    3133        : m_x(-1), m_y(-1), m_z(-1)
    3234    {
    33         QStringList versionStack = strVersion.split('.');
     35        const QStringList versionStack = strVersion.split('.');
    3436        if (versionStack.size() > 0)
    3537            m_x = versionStack[0].toInt();
     
    4042    }
    4143
    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    }
    4452
    4553    /** 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); }
    4755
    4856    /** Returns whether this object is equal to @a other. */
     
    5664    bool operator<(const UIVersion &other) const
    5765    {
    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);
    6169    }
    6270    /** Checks whether this object is more than @a other. */
    6371    bool operator>(const UIVersion &other) const
    6472    {
    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);
    6876    }
    6977
    7078    /** 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); }
    7580
    7681    /** Returns the object X value. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette