Changeset 39664 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 20, 2011 7:24:29 PM (13 years ago)
- 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 1 1 /* $Id$ */ 2 2 /** @file 3 * 4 * VBox frontends: Qt4 GUI ("VirtualBox"): 5 * UIUpdateManager class implementation 3 * VBox Qt GUI - UIUpdateManager class implementation. 6 4 */ 7 5 … … 272 270 /* Get VirtualBox version: */ 273 271 QString strVBoxVersion(vboxGlobal().vboxVersionStringNormalized()); 272 QByteArray abVBoxVersion = strVBoxVersion.toUtf8(); 274 273 VBoxVersion vboxVersion(strVBoxVersion); 274 275 275 /* 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) 282 287 { 283 288 emit sigStepComplete(); … … 285 290 } 286 291 287 if (strExtPackVersion.contains("ENTERPRISE")) 292 QString strExtPackEdition(extPack.GetEdition()); 293 if (strExtPackEdition.contains("ENTERPRISE")) 288 294 { 289 295 /* Inform the user that he should update the extension pack: */ … … 293 299 return; 294 300 } 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; 303 307 } 304 308 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp
r39373 r39664 1 1 /* $Id$ */ 2 2 /** @file 3 * 4 * VBox frontends: Qt4 GUI ("VirtualBox"): 5 * UIGlobalSettingsExtension class implementation 3 * VBox Qt GUI - UIGlobalSettingsExtension class implementation. 6 4 */ 7 5 8 6 /* 9 * Copyright (C) 2010 Oracle Corporation7 * Copyright (C) 2010-2011 Oracle Corporation 10 8 * 11 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 140 138 QString strPackName = extPackFile.GetName(); 141 139 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()); 148 141 149 142 /* … … 156 149 if (fReplaceIt) 157 150 { 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()); 164 152 if (!msgCenter().confirmReplacePackage(strPackName, strPackVersion, strPackVersionCur, strPackDescription, pParent)) 165 153 return;
Note:
See TracChangeset
for help on using the changeset viewer.