VirtualBox

Changeset 62999 in vbox


Ignore:
Timestamp:
Aug 4, 2016 3:32:26 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8422: Desktop-widget watchdog rework (part 07): Do not cache desktop-widget itself.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/globals
Files:
2 edited

Legend:

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

    r62998 r62999  
    108108UIDesktopWidgetWatchdog::UIDesktopWidgetWatchdog(QObject *pParent)
    109109    : QObject(pParent)
    110     , m_pDesktopWidget(QApplication::desktop())
    111110{
    112111    /* Prepare: */
     
    130129    /* Make sure index is valid: */
    131130    if (iHostScreenIndex < 0 || iHostScreenIndex >= screenCount())
    132         iHostScreenIndex = m_pDesktopWidget->primaryScreen();
     131        iHostScreenIndex = QApplication::desktop()->primaryScreen();
    133132    AssertReturn(iHostScreenIndex >= 0 && iHostScreenIndex < screenCount(), QRect());
    134133
    135134    /* Redirect call to desktop-widget: */
    136     return m_pDesktopWidget->screenGeometry(iHostScreenIndex);
     135    return QApplication::desktop()->screenGeometry(iHostScreenIndex);
    137136}
    138137
     
    141140    /* Make sure index is valid: */
    142141    if (iHostScreenIndex < 0 || iHostScreenIndex >= screenCount())
    143         iHostScreenIndex = m_pDesktopWidget->primaryScreen();
     142        iHostScreenIndex = QApplication::desktop()->primaryScreen();
    144143    AssertReturn(iHostScreenIndex >= 0 && iHostScreenIndex < screenCount(), QRect());
    145144
     
    204203    /* Prepare connections: */
    205204#if QT_VERSION < 0x050000
    206     connect(m_pDesktopWidget, SIGNAL(screenCountChanged(int)), this, SLOT(sltHandleHostScreenCountChanged(int)));
     205    connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(sltHandleHostScreenCountChanged(int)));
    207206#else /* QT_VERSION >= 0x050000 */
    208207    connect(qApp, SIGNAL(screenAdded(QScreen *)), this, SLOT(sltHostScreenAdded(QScreen *)));
    209208    connect(qApp, SIGNAL(screenRemoved(QScreen *)), this, SLOT(sltHostScreenRemoved(QScreen *)));
    210209#endif /* QT_VERSION >= 0x050000 */
    211     connect(m_pDesktopWidget, SIGNAL(resized(int)), this, SLOT(sltHandleHostScreenResized(int)));
     210    connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(sltHandleHostScreenResized(int)));
    212211
    213212    /* Update host-screen configuration: */
     
    219218    /* Cleanup connections: */
    220219#if QT_VERSION < 0x050000
    221     disconnect(m_pDesktopWidget, SIGNAL(screenCountChanged(int)), this, SLOT(sltHandleHostScreenCountChanged(int)));
     220    disconnect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(sltHandleHostScreenCountChanged(int)));
    222221#else /* QT_VERSION >= 0x050000 */
    223222    disconnect(qApp, SIGNAL(screenAdded(QScreen *)), this, SLOT(sltHostScreenAdded(QScreen *)));
    224223    disconnect(qApp, SIGNAL(screenRemoved(QScreen *)), this, SLOT(sltHostScreenRemoved(QScreen *)));
    225224#endif /* QT_VERSION >= 0x050000 */
    226     disconnect(m_pDesktopWidget, SIGNAL(resized(int)), this, SLOT(sltHandleHostScreenResized(int)));
     225    disconnect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(sltHandleHostScreenResized(int)));
    227226
    228227    /* Cleanup existing workers finally: */
     
    252251    /* Make sure index is valid: */
    253252    if (iHostScreenIndex < 0 || iHostScreenIndex >= screenCount())
    254         iHostScreenIndex = m_pDesktopWidget->primaryScreen();
     253        iHostScreenIndex = QApplication::desktop()->primaryScreen();
    255254    AssertReturnVoid(iHostScreenIndex >= 0 && iHostScreenIndex < screenCount());
    256255
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.h

    r62998 r62999  
    8989    void cleanupExistingWorkers();
    9090
    91     /** Holds the desktop-widget reference pointer. */
    92     QDesktopWidget *m_pDesktopWidget;
    93 
    9491    /** Holds current host-screen available-geometries. */
    9592    QVector<QRect> m_availableGeometryData;
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