VirtualBox

Ignore:
Timestamp:
Sep 17, 2018 11:44:43 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: VBoxGlobal todo fix: Make sure url argument list being cleared on return.

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

Legend:

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

    r73953 r74305  
    530530}
    531531
     532QList<QUrl> VBoxGlobal::takeArgumentUrls()
     533{
     534    const QList<QUrl> result = m_listArgUrls;
     535    m_listArgUrls.clear();
     536    return result;
     537}
     538
    532539#ifdef VBOX_WITH_DEBUGGER_GUI
    533540
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r73953 r74305  
    202202        bool processArgs();
    203203
    204         /** Returns the URL arguments list. */
    205         QList<QUrl> &argUrlList() { return m_listArgUrls; }
     204        /** Takes and returns the URL argument list while clearing the source. */
     205        QList<QUrl> takeArgumentUrls();
    206206
    207207        /** Returns the --startvm option value (managed VM id). */
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r74272 r74305  
    310310void UIVirtualBoxManager::sltHandleOpenUrlCall(QList<QUrl> list /* = QList<QUrl>() */)
    311311{
    312     /* If passed list is empty: */
     312    /* If passed list is empty, we take the one from VBoxGlobal: */
    313313    if (list.isEmpty())
    314     {
    315         /* We take the one which stored in VBoxGlobal: */
    316         list = vboxGlobal().argUrlList();
    317         vboxGlobal().argUrlList().clear();
    318         /// @todo Rework this getter to do .clear() as well.
    319     }
     314        list = vboxGlobal().takeArgumentUrls();
    320315
    321316    /* Check if we are can handle the dropped urls: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r74216 r74305  
    364364    qApp->processEvents();
    365365
     366    /* If passed list is empty, we take the one from VBoxGlobal: */
    366367    if (list.isEmpty())
    367     {
    368         list = vboxGlobal().argUrlList();
    369         vboxGlobal().argUrlList().clear();
    370     }
     368        list = vboxGlobal().takeArgumentUrls();
     369
    371370    /* Check if we are can handle the dropped urls. */
    372371    for (int i = 0; i < list.size(); ++i)
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