VirtualBox

Changeset 26705 in vbox


Ignore:
Timestamp:
Feb 23, 2010 2:07:15 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
57943
Message:

FE/Qt4: small optimizations

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

Legend:

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

    r26691 r26705  
    786786UIActionsPool::UIActionsPool(QObject *pParent)
    787787    : QObject(pParent)
    788 {
    789     /* Resize & clean actions vector */
    790     m_actionsPool.resize(UIActionIndex_Max);
    791     for (int i = 0; i < m_actionsPool.size(); ++ i)
    792         m_actionsPool[i] = 0;
    793 
     788    , m_actionsPool(UIActionIndex_End, 0)
     789{
    794790    /* Common actions: */
    795791    m_actionsPool[UIActionIndex_Separator] = new SeparatorAction(this);
     
    835831
    836832    /* Test all actions were initialized */
    837     for (int i = 0; i < m_actionsPool.size(); ++ i)
    838     {
    839         if (!m_actionsPool[i])
    840         {
     833    for (int i = 0; i < m_actionsPool.size(); ++i)
     834        if (!m_actionsPool.at(i))
    841835            AssertMsgFailed(("Action #%d is not created!\n", i));
    842         }
    843     }
    844836}
    845837
    846838UIActionsPool::~UIActionsPool()
    847839{
    848     for (int i = 0; i < m_actionsPool.size(); ++ i)
    849         delete m_actionsPool[i];
     840    for (int i = 0; i < m_actionsPool.size(); ++i)
     841        delete m_actionsPool.at(i);
    850842    m_actionsPool.clear();
    851843}
     
    853845UIAction* UIActionsPool::action(UIActionIndex index) const
    854846{
    855     return m_actionsPool[index];
     847    return m_actionsPool.at(index);
    856848}
    857849
    858850#include "UIActionsPool.moc"
     851
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionsPool.h

    r26691 r26705  
    9797#endif
    9898
    99     UIActionIndex_Max
     99    UIActionIndex_End,
     100    /** The usual 32-bit type hack. */
     101    UIActionIndex_32Bit_Hack = 0x7fffffff
    100102};
    101103
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