VirtualBox

Changeset 77919 in vbox


Ignore:
Timestamp:
Mar 27, 2019 1:27:07 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9241: VirtualBox Manager: Chooser pane: Cleanup for UIChooserModel class: Wipe out old search func.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserHandlerKeyboard.cpp

    r77844 r77919  
    278278        case Qt::Key_Space:
    279279        {
    280             /* If model is performing lookup: */
    281             if (model()->isLookupInProgress())
    282             {
    283                 /* Continue lookup: */
    284                 QString strText = pEvent->text();
    285                 if (!strText.isEmpty())
    286                     model()->lookFor(strText);
    287             }
    288280            /* If there is a focus item: */
    289             else if (UIChooserItem *pFocusItem = model()->focusItem())
     281            if (UIChooserItem *pFocusItem = model()->focusItem())
    290282            {
    291283                /* Of the group type: */
     
    314306        {
    315307            /* Start lookup: */
    316             QString strText = pEvent->text();
     308            const QString strText = pEvent->text();
    317309            if (!strText.isEmpty())
    318310                model()->lookFor(strText);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r77918 r77919  
    6666    , m_iScrollingTokenSize(30)
    6767    , m_fIsScrollingInProgress(false)
    68     , m_pLookupTimer(0)
    6968{
    7069    prepare();
     
    565564}
    566565
    567 void UIChooserModel::lookFor(const QString &strLookupSymbol)
     566void UIChooserModel::lookFor(const QString &strLookupText)
    568567{
    569568    if (view())
    570569    {
    571570        view()->setSearchWidgetVisible(true);
    572         view()->appendToSearchString(strLookupSymbol);
    573     }
    574 }
    575 
    576 bool UIChooserModel::isLookupInProgress() const
    577 {
    578     return m_pLookupTimer->isActive();
     571        view()->appendToSearchString(strLookupText);
     572    }
    579573}
    580574
     
    11471141}
    11481142
    1149 void UIChooserModel::sltEraseLookupTimer()
    1150 {
    1151     m_pLookupTimer->stop();
    1152     m_strLookupString = QString();
    1153 }
    1154 
    11551143void UIChooserModel::prepare()
    11561144{
    11571145    prepareScene();
    1158     prepareLookup();
    11591146    prepareContextMenu();
    11601147    prepareHandlers();
     
    11671154    if (m_pScene)
    11681155        m_pScene->installEventFilter(this);
    1169 }
    1170 
    1171 void UIChooserModel::prepareLookup()
    1172 {
    1173     m_pLookupTimer = new QTimer(this);
    1174     if (m_pLookupTimer)
    1175     {
    1176         m_pLookupTimer->setInterval(1000);
    1177         m_pLookupTimer->setSingleShot(true);
    1178         connect(m_pLookupTimer, SIGNAL(timeout()), this, SLOT(sltEraseLookupTimer()));
    1179     }
    11801156}
    11811157
     
    13571333}
    13581334
    1359 void UIChooserModel::cleanupLookup()
    1360 {
    1361     delete m_pLookupTimer;
    1362     m_pLookupTimer = 0;
    1363 }
    1364 
    13651335void UIChooserModel::cleanupScene()
    13661336{
     
    13731343    cleanupHandlers();
    13741344    cleanupContextMenu();
    1375     cleanupLookup();
    13761345    cleanupScene();
    13771346}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r77916 r77919  
    205205        void setCurrentDragObject(QDrag *pDragObject);
    206206
    207         /** Looks for item with certain @a strLookupSymbol. */
    208         void lookFor(const QString &strLookupSymbol);
    209         /** Returns whether looking is in progress. */
    210         bool isLookupInProgress() const;
     207        /** Looks for item with certain @a strLookupText. */
     208        void lookFor(const QString &strLookupText);
    211209    /** @} */
    212210
     
    285283        /** Handles machine search widget show/hide request. */
    286284        void sltShowHideSearchWidget();
    287         /** Handles request to erase lookup timer. */
    288         void sltEraseLookupTimer();
    289285    /** @} */
    290286
     
    297293        /** Prepares scene. */
    298294        void prepareScene();
    299         /** Prepares lookup. */
    300         void prepareLookup();
    301295        /** Prepares context-menu. */
    302296        void prepareContextMenu();
     
    314308        /** Cleanups context-menu. */
    315309        void cleanupContextMenu();
    316         /** Cleanups lookup. */
    317         void cleanupLookup();
    318310        /** Cleanups scene. */
    319311        void cleanupScene();
     
    408400        /** Holds whether drag scrolling is in progress. */
    409401        bool             m_fIsScrollingInProgress;
    410 
    411         /** Holds the item lookup timer instance. */
    412         QTimer  *m_pLookupTimer;
    413         /** Holds the item lookup string. */
    414         QString  m_strLookupString;
    415402    /** @} */
    416403};
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