VirtualBox

Changeset 46676 in vbox


Ignore:
Timestamp:
Jun 19, 2013 4:15:53 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: UI status-bar indicator-pool interface: Cleanup (part 1).

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r46650 r46676  
    737737    : QObject(pParent)
    738738    , m_session(session)
    739     , m_IndicatorsPool(UIIndicatorIndex_End, 0)
     739    , m_pool(UIIndicatorIndex_End)
    740740{
    741741}
     
    743743UIIndicatorsPool::~UIIndicatorsPool()
    744744{
    745     for (int i = 0; i < m_IndicatorsPool.size(); ++i)
    746     {
    747         delete m_IndicatorsPool[i];
    748         m_IndicatorsPool[i] = 0;
    749     }
    750     m_IndicatorsPool.clear();
     745    for (int i = 0; i < m_pool.size(); ++i)
     746    {
     747        delete m_pool[i];
     748        m_pool[i] = 0;
     749    }
     750    m_pool.clear();
    751751}
    752752
    753753QIStateIndicator* UIIndicatorsPool::indicator(UIIndicatorIndex index)
    754754{
    755     if (!m_IndicatorsPool.at(index))
     755    if (!m_pool.at(index))
    756756    {
    757757        switch (index)
    758758        {
    759             case UIIndicatorIndex_HardDisks:
    760                 m_IndicatorsPool[index] = new UIIndicatorHardDisks(m_session);
    761                 break;
    762             case UIIndicatorIndex_OpticalDisks:
    763                 m_IndicatorsPool[index] = new UIIndicatorOpticalDisks(m_session);
    764                 break;
    765             case UIIndicatorIndex_FloppyDisks:
    766                 m_IndicatorsPool[index] = new UIIndicatorFloppyDisks(m_session);
    767                 break;
    768             case UIIndicatorIndex_NetworkAdapters:
    769                 m_IndicatorsPool[index] = new UIIndicatorNetworkAdapters(m_session);
    770                 break;
    771             case UIIndicatorIndex_USBDevices:
    772                 m_IndicatorsPool[index] = new UIIndicatorUSBDevices(m_session);
    773                 break;
    774             case UIIndicatorIndex_SharedFolders:
    775                 m_IndicatorsPool[index] = new UIIndicatorSharedFolders(m_session);
    776                 break;
    777             case UIIndicatorIndex_VideoCapture:
    778                 m_IndicatorsPool[index] = new UIIndicatorVideoCapture(m_session);
    779                 break;
    780             case UIIndicatorIndex_Virtualization:
    781                 m_IndicatorsPool[index] = new UIIndicatorVirtualization(m_session);
    782                 break;
    783             case UIIndicatorIndex_Mouse:
    784                 m_IndicatorsPool[index] = new UIIndicatorMouse(m_session);
    785                 break;
    786             case UIIndicatorIndex_Hostkey:
    787                 m_IndicatorsPool[index] = new UIIndicatorHostkey(m_session);
    788                 break;
    789             default:
    790                 break;
    791         }
    792     }
    793     return m_IndicatorsPool.at(index);
     759            case UIIndicatorIndex_HardDisks:       m_pool[index] = new UIIndicatorHardDisks(m_session); break;
     760            case UIIndicatorIndex_OpticalDisks:    m_pool[index] = new UIIndicatorOpticalDisks(m_session); break;
     761            case UIIndicatorIndex_FloppyDisks:     m_pool[index] = new UIIndicatorFloppyDisks(m_session); break;
     762            case UIIndicatorIndex_NetworkAdapters: m_pool[index] = new UIIndicatorNetworkAdapters(m_session); break;
     763            case UIIndicatorIndex_USBDevices:      m_pool[index] = new UIIndicatorUSBDevices(m_session); break;
     764            case UIIndicatorIndex_SharedFolders:   m_pool[index] = new UIIndicatorSharedFolders(m_session); break;
     765            case UIIndicatorIndex_VideoCapture:    m_pool[index] = new UIIndicatorVideoCapture(m_session); break;
     766            case UIIndicatorIndex_Virtualization:  m_pool[index] = new UIIndicatorVirtualization(m_session); break;
     767            case UIIndicatorIndex_Mouse:           m_pool[index] = new UIIndicatorMouse(m_session); break;
     768            case UIIndicatorIndex_Hostkey:         m_pool[index] = new UIIndicatorHostkey(m_session); break;
     769            default: break;
     770        }
     771    }
     772    return m_pool.at(index);
    794773}
    795774
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.h

    r46582 r46676  
    66
    77/*
    8  * Copyright (C) 2010 Oracle Corporation
     8 * Copyright (C) 2010-2013 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#define __UIIndicatorsPool_h__
    2121
    22 /* Local includes */
     22/* GUI includes: */
    2323#include "QIStateIndicator.h"
    2424
     25/* Forward declarations: */
    2526class CSession;
    2627
     28/* Indicator types: */
    2729enum UIIndicatorIndex
    2830{
     
    4042};
    4143
     44/* Indicator pool interface/prototype: */
    4245class UIIndicatorsPool : public QObject
    4346{
     
    4649public:
    4750
     51    /* Constructor/destructor: */
    4852    UIIndicatorsPool(CSession &session, QObject *pParent);
    49    ~UIIndicatorsPool();
     53    ~UIIndicatorsPool();
    5054
     55    /* API indicator access stuff: */
    5156    QIStateIndicator* indicator(UIIndicatorIndex index);
    5257
    5358private:
    5459
     60    /* Variables: */
    5561    CSession &m_session;
    56     QVector<QIStateIndicator*> m_IndicatorsPool;
     62    QVector<QIStateIndicator*> m_pool;
    5763};
    5864
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