VirtualBox

Ignore:
Timestamp:
Jan 26, 2011 4:37:16 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69665
Message:

Main: reworked listener objects creation, fixes Win problems with events, few cleanups

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

Legend:

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

    r34527 r35722  
    252252//    RTPrintf("Self add: %RTthrd\n", RTThreadSelf());
    253253    const CVirtualBox &vbox = vboxGlobal().virtualBox();
    254     UIMainEventListenerImpl *pListener = new UIMainEventListenerImpl(this);
     254    ComObjPtr<UIMainEventListenerImpl> pListener;
     255    pListener.createObject();
     256    pListener->init(new UIMainEventListener(), this);
    255257    m_mainEventListener = CEventListener(pListener);
    256258    QVector<KVBoxEventType> events;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp

    r34527 r35722  
    2525//#include <iprt/stream.h>
    2626
    27 UIMainEventListener::UIMainEventListener(QObject * /* pParent */)
    28 //  : QObject(pParent) /* Todo: Not sure if pParent should delete this. Especially on Win there is ref counting implemented. */
     27UIMainEventListener::UIMainEventListener()
    2928  : QObject()
    3029{
     
    4241}
    4342
     43HRESULT UIMainEventListener::init(QObject * /* pParent */)
     44{
     45    return S_OK;
     46}
     47
     48void    UIMainEventListener::uninit()
     49{
     50}
    4451
    4552/**
     
    5057{
    5158    CEvent event(pEvent);
    52 //    RTPrintf("Event received: %d (%RTthrd)\n", event.GetType(), RTThreadSelf());
     59    // printf("Event received: %d\n", event.GetType());
    5360    switch(event.GetType())
    5461    {
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.h

    r34527 r35722  
    4343
    4444public:
    45     UIMainEventListener(QObject *pParent);
     45    UIMainEventListener();
     46
     47
     48    HRESULT init(QObject *pParent);
     49    void    uninit();
    4650
    4751    STDMETHOD(HandleEvent)(VBoxEventType_T aType, IEvent *pEvent);
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r35665 r35722  
    52495249    QApplication::removePostedEvents (this);
    52505250
    5251 #ifdef Q_WS_WIN
    5252     /* COM for the main thread is shutdown in main() */
    5253 #else
    52545251    COMBase::CleanupCOM();
    5255 #endif
    52565252
    52575253    mValid = false;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIConsoleEventHandler.cpp

    r34527 r35722  
    5959
    6060//    RTPrintf("Self add: %RTthrd\n", RTThreadSelf());
    61     UIMainEventListenerImpl *pListener = new UIMainEventListenerImpl(this);
     61    ComObjPtr<UIMainEventListenerImpl> pListener;
     62    pListener.createObject();
     63    pListener->init(new UIMainEventListener(), this);
    6264    m_mainEventListener = CEventListener(pListener);
    6365    QVector<KVBoxEventType> events;
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVirtualBoxEventHandler.cpp

    r34527 r35722  
    5252//    RTPrintf("Self add: %RTthrd\n", RTThreadSelf());
    5353    const CVirtualBox &vbox = vboxGlobal().virtualBox();
    54     UIMainEventListenerImpl *pListener = new UIMainEventListenerImpl(this);
     54    ComObjPtr<UIMainEventListenerImpl> pListener;
     55    pListener.createObject();
     56    pListener->init(new UIMainEventListener(), this);
    5557    m_mainEventListener = CEventListener(pListener);
    5658    QVector<KVBoxEventType> events;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette