VirtualBox

Ignore:
Timestamp:
Sep 25, 2015 12:59:15 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Mac OS X: Window menu Manager cleanup/rework (step 4): Hash window related actions by corresponding window pointer, not by title.

File:
1 edited

Legend:

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

    r57892 r57893  
    7878        QAction *pAction = 0;
    7979        if (   pWindow
    80             && !m_windows.contains(pWindow->windowTitle()))
     80            && !m_windows.contains(pWindow))
    8181        {
    8282            if (m_windows.size() < 2)
     
    9696                    this, SLOT(sltRaiseSender()));
    9797            m_pWindowMenu->addAction(pAction);
    98             m_windows[pWindow->windowTitle()] = pAction;
     98            m_windows[pWindow] = pAction;
    9999        }
    100100        return pAction;
     
    104104    void removeWindow(QWidget *pWindow)
    105105    {
    106         if (m_windows.contains(pWindow->windowTitle()))
    107         {
    108             delete m_windows.value(pWindow->windowTitle());
    109             m_windows.remove(pWindow->windowTitle());
     106        if (m_windows.contains(pWindow))
     107        {
     108            delete m_windows.value(pWindow);
     109            m_windows.remove(pWindow);
    110110        }
    111111    }
     
    131131        {
    132132            /* Toggle corresponding action on: */
    133             if (m_windows.contains(pActiveWindow->windowTitle()))
    134                 m_windows.value(pActiveWindow->windowTitle())->setChecked(true);
     133            if (m_windows.contains(pActiveWindow))
     134                m_windows.value(pActiveWindow)->setChecked(true);
    135135        }
    136136        /* If there is no active-window: */
     
    176176    QAction *m_pMinimizeAction;
    177177    /** Holds the hash of the registered menu-helper instances. */
    178     QHash<QString, QAction*> m_windows;
     178    QHash<QWidget*, QAction*> m_windows;
    179179};
    180180
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