VirtualBox

Changeset 66354 in vbox


Ignore:
Timestamp:
Mar 30, 2017 10:50:51 AM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: Global preferences: Couple of optimizations.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/global
Files:
4 edited

Legend:

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

    r66343 r66354  
    9898
    9999    /* Load old data from cache: */
    100     if ((oldData.m_strMaxGuestResolution.isEmpty()) ||
    101         (oldData.m_strMaxGuestResolution == "auto"))
     100    if (   (oldData.m_strMaxGuestResolution.isEmpty())
     101        || (oldData.m_strMaxGuestResolution == "auto"))
    102102    {
    103103        /* Switch combo-box item: */
     
    114114        m_pMaxResolutionCombo->setCurrentIndex(m_pMaxResolutionCombo->findData("fixed"));
    115115        /* Trying to parse text into 2 sections by ',' symbol: */
    116         int iWidth  = oldData.m_strMaxGuestResolution.section(',', 0, 0).toInt();
    117         int iHeight = oldData.m_strMaxGuestResolution.section(',', 1, 1).toInt();
     116        const int iWidth  = oldData.m_strMaxGuestResolution.section(',', 0, 0).toInt();
     117        const int iHeight = oldData.m_strMaxGuestResolution.section(',', 1, 1).toInt();
    118118        /* And set values if they are present: */
    119119        m_pResolutionWidthSpin->setValue(iWidth);
     
    134134        newData.m_strMaxGuestResolution = QString();
    135135    }
    136     else if (m_pMaxResolutionCombo->itemData(m_pMaxResolutionCombo->currentIndex()).toString() == "any" ||
    137              m_pResolutionWidthSpin->value() == 0 || m_pResolutionHeightSpin->value() == 0)
     136    else if (   m_pMaxResolutionCombo->itemData(m_pMaxResolutionCombo->currentIndex()).toString() == "any"
     137             || m_pResolutionWidthSpin->value() == 0 || m_pResolutionHeightSpin->value() == 0)
    138138    {
    139139        /* Else if resolution current combo item is "any"
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp

    r66343 r66354  
    281281
    282282    /* Gather old data: */
    283     const CExtPackManager &manager = vboxGlobal().virtualBox().GetExtensionPackManager();
    284     const CExtPackVector &packages = manager.GetInstalledExtPacks();
    285     for (int i = 0; i < packages.size(); ++i)
     283    const CExtPackVector &packages = vboxGlobal().virtualBox().
     284                                     GetExtensionPackManager().GetInstalledExtPacks();
     285    foreach (const CExtPack &package, packages)
    286286    {
    287287        UIDataSettingsGlobalExtensionItem item;
    288         loadData(packages[i], item);
     288        loadData(package, item);
    289289        oldData.m_items << item;
    290290    }
     
    303303
    304304    /* Load old data from cache: */
    305     for (int i = 0; i < oldData.m_items.size(); ++i)
    306         new UIExtensionPackageItem(m_pPackagesTree, oldData.m_items.at(i));
     305    foreach (const UIDataSettingsGlobalExtensionItem &item, oldData.m_items)
     306        new UIExtensionPackageItem(m_pPackagesTree, item);
    307307    /* If at least one item present: */
    308308    if (m_pPackagesTree->topLevelItemCount())
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp

    r66343 r66354  
    951951    {
    952952        /* Save host-combo shortcut from cache: */
    953         UIDataShortcutRow fakeHostComboItem(0, UIHostCombo::hostComboCacheKey(), QString(), QString(), QString());
     953        const UIDataShortcutRow fakeHostComboItem(0, UIHostCombo::hostComboCacheKey(), QString(), QString(), QString());
    954954        const int iHostComboItemBase = UIFunctorFindShortcut(UIFunctorFindShortcut::Base)(m_pCache->base().shortcuts(), fakeHostComboItem);
    955955        const int iHostComboItemData = UIFunctorFindShortcut(UIFunctorFindShortcut::Base)(m_pCache->data().shortcuts(), fakeHostComboItem);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.cpp

    r66343 r66354  
    9292
    9393    /* Gather old data: */
    94     VBoxUpdateData updateData(gEDataManager->applicationUpdateData());
     94    const VBoxUpdateData updateData(gEDataManager->applicationUpdateData());
    9595    oldData.m_fCheckEnabled = !updateData.isNoNeedToCheck();
    9696    oldData.m_periodIndex = updateData.periodIndex();
     
    148148    {
    149149        /* Gather corresponding values from internal variables: */
    150         VBoxUpdateData newData(m_pCache->data().m_periodIndex, m_pCache->data().m_branchIndex);
     150        const VBoxUpdateData newData(m_pCache->data().m_periodIndex, m_pCache->data().m_branchIndex);
    151151        gEDataManager->setApplicationUpdateData(newData.data());
    152152    }
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