VirtualBox

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


Ignore:
Timestamp:
Nov 3, 2011 9:58:30 AM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: handle the edition attribute more general

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp

    r39182 r39184  
    5151
    5252        /* Version, Revision, Edition: */
    53         QString strVersion(m_data.m_strVersion);
    54         QString strEdition;
    55 
    56         if (strVersion.endsWith("-ENTERPRISE"))
    57         {
    58             strEdition = "-ENTERPRISE";
    59             strVersion.chop(strEdition.size());
    60         }
    61 
    62         setText(2, QString("%1r%2%3").arg(strVersion).arg(m_data.m_strRevision).arg(strEdition));
     53        QString strVersion(m_data.m_strVersion.section(QRegExp("[-_]"), 0, 0));
     54        QString strAppend(m_data.m_strVersion.section(QRegExp("[-_]"), 1, -1, QString::SectionIncludeLeadingSep));
     55        setText(2, QString("%1r%2%3").arg(strVersion).arg(m_data.m_strRevision).arg(strAppend));
    6356
    6457        /* Tool-tip: */
     
    144137    QString strPackName = extPackFile.GetName();
    145138    QString strPackDescription = extPackFile.GetDescription();
    146     QString strVersion(extPackFile.GetVersion());
    147     QString strEdition;
    148     if (strVersion.endsWith("-ENTERPRISE"))
    149     {
    150         strEdition = "-ENTERPRISE";
    151         strVersion.chop(strEdition.size());
    152     }
    153     QString strPackVersion = QString("%1r%2%3").arg(strVersion).arg(extPackFile.GetRevision()).arg(strEdition);
     139    QString strVersion(extPackFile.GetVersion().section(QRegExp("[-_]"), 0, 0));
     140    QString strAppend(extPackFile.GetVersion().section(QRegExp("[-_]"), 1, -1, QString::SectionIncludeLeadingSep));
     141    QString strPackVersion = QString("%1r%2%3").arg(strVersion).arg(extPackFile.GetRevision()).arg(strAppend);
    154142
    155143    /*
     
    162150    if (fReplaceIt)
    163151    {
    164         QString strVersionCur(extPackCur.GetVersion());
    165         QString strEditionCur;
    166         if (strVersionCur.endsWith("-ENTERPRISE"))
    167         {
    168             strEditionCur = "-ENTERPRISE";
    169             strVersionCur.chop(strEditionCur.size());
    170         }
    171         QString strPackVersionCur = QString("%1r%2%3").arg(strVersionCur).arg(extPackCur.GetRevision()).arg(strEditionCur);
     152        QString strVersionCur(extPackCur.GetVersion().section(QRegExp("[-_]"), 0, 0));
     153        QString strAppendCur(extPackCur.GetVersion().section(QRegExp("[-_]"), 1, -1, QString::SectionIncludeLeadingSep));
     154        QString strPackVersionCur = QString("%1r%2%3").arg(strVersionCur).arg(extPackCur.GetRevision()).arg(strAppendCur);
    172155        if (!msgCenter().confirmReplacePackage(strPackName, strPackVersion, strPackVersionCur, strPackDescription, pParent))
    173156            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