VirtualBox

Changeset 57894 in vbox


Ignore:
Timestamp:
Sep 25, 2015 1:04:05 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: Window menu Manager cleanup/rework (step 5): Simplify hash enumeration routines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UIWindowMenuManager.cpp

    r57893 r57894  
    253253    m_windows.append(pWindow);
    254254    /* Add window to all menus we have: */
    255     QHash<QWidget*, UIMenuHelper*>::const_iterator i = m_helpers.constBegin();
    256     while (i != m_helpers.constEnd())
    257     {
    258         i.value()->addWindow(pWindow);
    259         ++i;
    260     }
     255    foreach (UIMenuHelper *pHelper, m_helpers.values())
     256        pHelper->addWindow(pWindow);
    261257}
    262258
     
    264260{
    265261    /* Remove window from all menus we have: */
    266     QHash<QWidget*, UIMenuHelper*>::const_iterator i = m_helpers.constBegin();
    267     while (i != m_helpers.constEnd())
    268     {
    269         i.value()->removeWindow(pWindow);
    270         ++i;
    271     }
     262    foreach (UIMenuHelper *pHelper, m_helpers.values())
     263        pHelper->removeWindow(pWindow);
    272264    /* Unregister window: */
    273265    m_windows.removeAll(pWindow);
     
    277269{
    278270    /* Translate all the helpers: */
    279     QHash<QWidget*, UIMenuHelper*>::const_iterator i = m_helpers.constBegin();
    280     while (i != m_helpers.constEnd())
    281     {
    282         i.value()->retranslateUi();
    283         ++i;
    284     }
     271    foreach (UIMenuHelper *pHelper, m_helpers.values())
     272        pHelper->retranslateUi();
    285273}
    286274
     
    321309    {
    322310        QWidget *pActiveWindow = qApp->activeWindow();
    323         QHash<QWidget*, UIMenuHelper*>::const_iterator i = m_helpers.constBegin();
    324         while (i != m_helpers.constEnd())
    325         {
    326             i.value()->updateStatus(pActiveWindow);
    327             ++i;
    328         }
     311        foreach (UIMenuHelper *pHelper, m_helpers.values())
     312            pHelper->updateStatus(pActiveWindow);
    329313    }
    330314
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