VirtualBox

Changeset 39473 in vbox for trunk


Ignore:
Timestamp:
Nov 30, 2011 12:43:36 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: 5985: Update Manager should check for the new version again the same day after installing other than current VBox version.

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  
    202202public:
    203203
     204    VBoxVersion() : m_x(-1), m_y(-1), m_z(-1) {}
     205
    204206    VBoxVersion(const QString &strVersion)
    205         : m_x(0), m_y(0), m_z(0)
     207        : m_x(-1), m_y(-1), m_z(-1)
    206208    {
    207209        QStringList versionStack = strVersion.split('.');
     
    214216    }
    215217
     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
    216222    bool equal(const VBoxVersion &other) const { return (m_x == other.m_x) && (m_y == other.m_y) && (m_z == other.m_z); }
    217223    bool operator==(const VBoxVersion &other) const { return equal(other); }
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateDefs.cpp

    r38476 r39473  
    2424/* Local includes: */
    2525#include "UIUpdateDefs.h"
     26#include "VBoxGlobal.h"
    2627
    2728/* static: */
     
    8182bool VBoxUpdateData::isNoNeedToCheck() const
    8283{
     84    /* Return 'false' if Period == Never: */
    8385    return m_periodIndex == PeriodNever;
    8486}
     
    8688bool VBoxUpdateData::isNeedToCheck() const
    8789{
    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;
    89104}
    90105
     
    123138}
    124139
     140VBoxVersion VBoxUpdateData::version() const
     141{
     142    return m_version;
     143}
     144
    125145void VBoxUpdateData::decode()
    126146{
     
    155175            m_branchIndex = branch == "withbetas" ? BranchWithBetas :
    156176                            branch == "allrelease" ? BranchAllRelease : BranchStable;
     177        }
     178
     179        /* Parse 'version' value: */
     180        if (parser.size() > 3)
     181        {
     182            m_version = VBoxVersion(parser[3]);
    157183        }
    158184    }
     
    187213                              m_branchIndex == BranchAllRelease ? "allrelease" : "stable";
    188214
     215        /* Encode 'version' value: */
     216        QString versionValue = VBoxVersion(vboxGlobal().vboxVersionStringNormalized()).toString();
     217
    189218        /* 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);
    191220    }
    192221}
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateDefs.h

    r38476 r39473  
    2222/* Global includes: */
    2323#include <QDate>
     24
     25/* Local includes: */
     26#include "VBoxUtils.h"
    2427
    2528/* This structure is used to store retranslated reminder values. */
     
    8285    BranchType branchIndex() const;
    8386    QString branchName() const;
     87    VBoxVersion version() const;
    8488
    8589private:
     
    9599    QDate m_date;
    96100    BranchType m_branchIndex;
     101    VBoxVersion m_version;
    97102};
    98103
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