VirtualBox

Changeset 31282 in vbox for trunk


Ignore:
Timestamp:
Aug 2, 2010 11:08:29 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
64309
Message:

Some fixes for Guest Additions version lookup.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

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

    r31241 r31282  
    468468            VBoxGlobal::tr ("Disabled", "details report (Nested Paging)");
    469469        QString addVersionStr = console.GetGuest().GetAdditionsVersion();
     470        if (addVersionStr.isEmpty())
     471        {
     472            /*
     473             * If we got back an empty string from GetAdditionsVersion() we either
     474             * really don't have the Guest Additions version yet or the guest is running
     475             * older Guest Additions (< 3.2.0) which don't provide VMMDevReq_ReportGuestInfo2,
     476             * so get the version + revision from the (hopefully) provided guest properties
     477             * instead.
     478             */
     479            QString addVersion = m.GetGuestPropertyValue("/VirtualBox/GuestAdd/Version");
     480            QString addRevision = m.GetGuestPropertyValue("/VirtualBox/GuestAdd/Revision");
     481            if (!addVersion.isEmpty() && !addRevision.isEmpty())
     482            {
     483                /* Some Guest Additions versions had interchanged version + revision values,
     484                 * so check if the version value at least has a dot to identify it and change
     485                 * both values to reflect the right content. */
     486                if (!addVersion.contains("."))
     487                {
     488                    QString addTemp = addVersion;
     489                    addVersion = addRevision;
     490                    addRevision = addTemp;
     491                }
     492
     493                addVersionStr = addVersion
     494                              + "r"
     495                              + addRevision;
     496            }
     497        }
    470498        if (addVersionStr.isEmpty())
    471499            addVersionStr = tr ("Not Detected", "guest additions");
  • trunk/src/VBox/Main/GuestImpl.cpp

    r31241 r31282  
    14931493    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    14941494
    1495     mData.mAdditionsVersion = aAdditionsVersion;
     1495    if (!aVersionName.isEmpty())
     1496        mData.mAdditionsVersion = aAdditionsVersion + " " + aVersionName;
     1497    else
     1498        mData.mAdditionsVersion = aAdditionsVersion;
    14961499}
    14971500
Note: See TracChangeset for help on using the changeset viewer.

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