VirtualBox

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


Ignore:
Timestamp:
Dec 20, 2011 7:24:29 PM (13 years ago)
Author:
vboxsync
Message:

GUI: Use the 'edition' property of the extension packs.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp

    r39379 r39664  
    11/* $Id$ */
    22/** @file
    3  *
    4  * VBox frontends: Qt4 GUI ("VirtualBox"):
    5  * UIUpdateManager class implementation
     3 * VBox Qt GUI - UIUpdateManager class implementation.
    64 */
    75
     
    272270        /* Get VirtualBox version: */
    273271        QString strVBoxVersion(vboxGlobal().vboxVersionStringNormalized());
     272        QByteArray abVBoxVersion = strVBoxVersion.toUtf8();
    274273        VBoxVersion vboxVersion(strVBoxVersion);
     274
    275275        /* Get extension pack version: */
    276         QString strExtPackVersion(extPack.GetVersion().remove(VBOX_BUILD_PUBLISHER));
    277         QStringList strExtPackVersionParts = strExtPackVersion.split(QRegExp("[-_]"), QString::SkipEmptyParts);
    278         VBoxVersion extPackVersion(strExtPackVersionParts[0]);
    279         /* Check if extension pack version less than required: */
    280         if ((vboxVersion.z() % 2 != 0) /* Skip unstable VBox version */ ||
    281             !(extPackVersion < vboxVersion) /* Ext Pack version more or equal to VBox version */)
     276        QString strExtPackVersion(extPack.GetVersion());
     277        QByteArray abExtPackVersion = strExtPackVersion.toUtf8();
     278
     279        /* Skip the check in unstable VBox version and if the extension pack
     280           is equal to or newer than VBox.
     281
     282           Note! Use RTStrVersionCompare for the comparison here as it takes
     283                 the beta/alpha/preview/whatever tags into consideration when
     284                 comparing versions. */
     285        if (   vboxVersion.z() % 2 != 0
     286            || RTStrVersionCompare(abExtPackVersion.constData(), abVBoxVersion.constData()) >= 0)
    282287        {
    283288            emit sigStepComplete();
     
    285290        }
    286291
    287         if (strExtPackVersion.contains("ENTERPRISE"))
     292        QString strExtPackEdition(extPack.GetEdition());
     293        if (strExtPackEdition.contains("ENTERPRISE"))
    288294        {
    289295            /* Inform the user that he should update the extension pack: */
     
    293299            return;
    294300        }
    295         else
    296         {
    297             /* Ask the user about extension pack downloading: */
    298             if (!msgCenter().proposeDownloadExtensionPack(UI_ExtPackName, strExtPackVersion))
    299             {
    300                 emit sigStepComplete();
    301                 return;
    302             }
     301
     302        /* Ask the user about extension pack downloading: */
     303        if (!msgCenter().proposeDownloadExtensionPack(UI_ExtPackName, strExtPackVersion))
     304        {
     305            emit sigStepComplete();
     306            return;
    303307        }
    304308
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp

    r39373 r39664  
    11/* $Id$ */
    22/** @file
    3  *
    4  * VBox frontends: Qt4 GUI ("VirtualBox"):
    5  * UIGlobalSettingsExtension class implementation
     3 * VBox Qt GUI - UIGlobalSettingsExtension class implementation.
    64 */
    75
    86/*
    9  * Copyright (C) 2010 Oracle Corporation
     7 * Copyright (C) 2010-2011 Oracle Corporation
    108 *
    119 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    140138    QString strPackName = extPackFile.GetName();
    141139    QString strPackDescription = extPackFile.GetDescription();
    142     QString strVersion(extPackFile.GetVersion().section(QRegExp("[-_]"), 0, 0));
    143     QString strAppend;
    144     /* workaround for http://qt.gitorious.org/qt/qt/commit/7fc63dd0ff368a637dcd17e692b9d6b26278b538 */
    145     if (extPackFile.GetVersion().contains(QRegExp("[-_]")))
    146         strAppend = extPackFile.GetVersion().section(QRegExp("[-_]"), 1, -1, QString::SectionIncludeLeadingSep);
    147     QString strPackVersion = QString("%1r%2%3").arg(strVersion).arg(extPackFile.GetRevision()).arg(strAppend);
     140    QString strPackVersion = QString("%1r%2%3").arg(extPackFile.GetVersion()).arg(extPackFile.GetRevision()).arg(extPackFile.GetEdition());
    148141
    149142    /*
     
    156149    if (fReplaceIt)
    157150    {
    158         QString strVersionCur(extPackCur.GetVersion().section(QRegExp("[-_]"), 0, 0));
    159         QString strAppendCur;
    160         /* workaround for http://qt.gitorious.org/qt/qt/commit/7fc63dd0ff368a637dcd17e692b9d6b26278b538 */
    161         if (extPackCur.GetVersion().contains(QRegExp("[-_]")))
    162             strAppendCur = extPackCur.GetVersion().section(QRegExp("[-_]"), 1, -1, QString::SectionIncludeLeadingSep);
    163         QString strPackVersionCur = QString("%1r%2%3").arg(strVersionCur).arg(extPackCur.GetRevision()).arg(strAppendCur);
     151        QString strPackVersionCur = QString("%1r%2%3").arg(extPackCur.GetVersion()).arg(extPackCur.GetRevision()).arg(extPackCur.GetEdition());
    164152        if (!msgCenter().confirmReplacePackage(strPackName, strPackVersion, strPackVersionCur, strPackDescription, pParent))
    165153            return;
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