VirtualBox

Ignore:
Timestamp:
Sep 18, 2019 11:13:38 AM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:8938. Refactoring connections that include casted parameters.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
7 edited

Legend:

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

    r80445 r80881  
    8080    m_pMainLayout->addWidget(m_pTextEdit);
    8181
    82     connect(qobject_cast<UIVMLogViewerTextEdit*>(m_pTextEdit), &UIVMLogViewerTextEdit::sigAddBookmark,
     82    connect(m_pTextEdit, &UIVMLogViewerTextEdit::sigAddBookmark,
    8383            this, &UIVMLogPage::sltAddBookmark);
    84     connect(qobject_cast<UIVMLogViewerTextEdit*>(m_pTextEdit), &UIVMLogViewerTextEdit::sigDeleteBookmark,
     84    connect(m_pTextEdit, &UIVMLogViewerTextEdit::sigDeleteBookmark,
    8585            this, &UIVMLogPage::sltDeleteBookmark);
    8686}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserAbstractModel.cpp

    r80760 r80881  
    712712    m_oldLists = oldLists;
    713713    m_newLists = newLists;
    714     connect(this, &UIThreadGroupDefinitionSave::sigComplete,
    715             qobject_cast<UIChooserAbstractModel*>(pParent), &UIChooserAbstractModel::sltGroupDefinitionsSaveComplete);
     714    UIChooserAbstractModel* pChooserAbstractModel = qobject_cast<UIChooserAbstractModel*>(pParent);
     715    AssertPtrReturnVoid(pChooserAbstractModel);
     716    {
     717        connect(this, &UIThreadGroupDefinitionSave::sigComplete,
     718                pChooserAbstractModel, &UIChooserAbstractModel::sltGroupDefinitionsSaveComplete);
     719    }
    716720}
    717721
     
    838842{
    839843    m_groups = groups;
    840     connect(this, &UIThreadGroupOrderSave::sigComplete,
    841             qobject_cast<UIChooserAbstractModel*>(pParent), &UIChooserAbstractModel::sltGroupOrdersSaveComplete);
     844    UIChooserAbstractModel *pChooserAbstractModel = qobject_cast<UIChooserAbstractModel*>(pParent);
     845    AssertPtrReturnVoid(pChooserAbstractModel);
     846    {
     847        connect(this, &UIThreadGroupOrderSave::sigComplete,
     848                pChooserAbstractModel, &UIChooserAbstractModel::sltGroupOrdersSaveComplete);
     849    }
    842850}
    843851
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r80802 r80881  
    12411241void UIChooserModel::prepareConnections()
    12421242{
    1243     /* Setup parent connections: */
    1244     connect(this, &UIChooserModel::sigSelectionChanged,
    1245             qobject_cast<UIChooser*>(parent()), &UIChooser::sigSelectionChanged);
    1246     connect(this, &UIChooserModel::sigSelectionInvalidated,
    1247             qobject_cast<UIChooser*>(parent()), &UIChooser::sigSelectionInvalidated);
    1248     connect(this, &UIChooserModel::sigToggleStarted,
    1249             qobject_cast<UIChooser*>(parent()), &UIChooser::sigToggleStarted);
    1250     connect(this, &UIChooserModel::sigToggleFinished,
    1251             qobject_cast<UIChooser*>(parent()), &UIChooser::sigToggleFinished);
     1243    UIChooser* pChooser = qobject_cast<UIChooser*>(parent());
     1244    AssertPtrReturnVoid(pChooser);
     1245    {
     1246        /* Setup parent connections: */
     1247        connect(this, &UIChooserModel::sigSelectionChanged,
     1248                pChooser, &UIChooser::sigSelectionChanged);
     1249        connect(this, &UIChooserModel::sigSelectionInvalidated,
     1250                pChooser, &UIChooser::sigSelectionInvalidated);
     1251        connect(this, &UIChooserModel::sigToggleStarted,
     1252                pChooser, &UIChooser::sigToggleStarted);
     1253        connect(this, &UIChooserModel::sigToggleFinished,
     1254                pChooser, &UIChooser::sigToggleFinished);
     1255    }
    12521256
    12531257    /* Setup action connections: */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsItem.cpp

    r80795 r80881  
    284284            this, &UIPrepareStep::sltStepDone,
    285285            Qt::QueuedConnection);
    286     connect(this, &UIPrepareStep::sigStepDone,
    287             qobject_cast<UIDetailsItem*>(pParent), &UIDetailsItem::sltBuildStep,
    288             Qt::QueuedConnection);
     286
     287    UIDetailsItem *pDetailsItem = qobject_cast<UIDetailsItem*>(pParent);
     288    AssertPtrReturnVoid(pDetailsItem);
     289    {
     290        connect(this, &UIPrepareStep::sigStepDone,
     291                pDetailsItem, &UIDetailsItem::sltBuildStep,
     292                Qt::QueuedConnection);
     293    }
    289294}
    290295
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp

    r80802 r80881  
    495495void UIToolsModel::prepareConnections()
    496496{
    497     /* Setup parent connections: */
    498     connect(this, &UIToolsModel::sigSelectionChanged,
    499             qobject_cast<UITools*>(parent()), &UITools::sigSelectionChanged);
    500     connect(this, &UIToolsModel::sigExpandingStarted,
    501             qobject_cast<UITools*>(parent()), &UITools::sigExpandingStarted);
    502     connect(this, &UIToolsModel::sigExpandingFinished,
    503             qobject_cast<UITools*>(parent()), &UITools::sigExpandingFinished);
     497    UITools* pTools = qobject_cast<UITools*>(parent());
     498    AssertPtrReturnVoid(pTools);
     499    {
     500        /* Setup parent connections: */
     501        connect(this, &UIToolsModel::sigSelectionChanged,
     502                pTools, &UITools::sigSelectionChanged);
     503        connect(this, &UIToolsModel::sigExpandingStarted,
     504                pTools, &UITools::sigExpandingStarted);
     505        connect(this, &UIToolsModel::sigExpandingFinished,
     506                pTools, &UITools::sigExpandingFinished);
     507    }
    504508}
    505509
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineLogicNormal.cpp

    r80617 r80881  
    296296    connect(actionPool()->action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility), &UIAction::triggered,
    297297            this, &UIMachineLogicNormal::sltToggleStatusBar);
    298     connect(qobject_cast<UIActionPoolRuntime*>(actionPool()), &UIActionPoolRuntime::sigNotifyAboutTriggeringViewScreenToggle,
    299             this, &UIMachineLogicNormal::sltHandleActionTriggerViewScreenToggle);
    300     connect(qobject_cast<UIActionPoolRuntime*>(actionPool()), &UIActionPoolRuntime::sigNotifyAboutTriggeringViewScreenResize,
    301             this, &UIMachineLogicNormal::sltHandleActionTriggerViewScreenResize);
     298    UIActionPoolRuntime* pActionPoolRuntime = qobject_cast<UIActionPoolRuntime*>(actionPool());
     299    AssertPtrReturnVoid(pActionPoolRuntime);
     300    {
     301        connect(pActionPoolRuntime, &UIActionPoolRuntime::sigNotifyAboutTriggeringViewScreenToggle,
     302                this, &UIMachineLogicNormal::sltHandleActionTriggerViewScreenToggle);
     303        connect(pActionPoolRuntime, &UIActionPoolRuntime::sigNotifyAboutTriggeringViewScreenResize,
     304                this, &UIMachineLogicNormal::sltHandleActionTriggerViewScreenResize);
     305    }
    302306}
    303307
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp

    r80678 r80881  
    842842
    843843    /* Connect model: */
    844     connect(qobject_cast<UIHotKeyTableModel*>(model()), &UIHotKeyTableModel::sigShortcutsLoaded,
    845             this, &UIHotKeyTable::sltHandleShortcutsLoaded);
     844    UIHotKeyTableModel *pHotKeyTableModel = qobject_cast<UIHotKeyTableModel*>(model());
     845    AssertPtrReturnVoid(pHotKeyTableModel);
     846    {
     847        connect(pHotKeyTableModel, &UIHotKeyTableModel::sigShortcutsLoaded,
     848                this, &UIHotKeyTable::sltHandleShortcutsLoaded);
     849    }
    846850
    847851    /* Check if we do have proper item delegate: */
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