VirtualBox

Changeset 25045 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 27, 2009 10:50:46 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55378
Message:

FE/Qt4: -Wshadow fixes

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h

    r23899 r25045  
    9090{
    9191public:
    92     VBoxRepaintEvent (int x, int y, int w, int h) :
     92    VBoxRepaintEvent (int iX, int iY, int iW, int iH) :
    9393        QEvent ((QEvent::Type) VBoxDefs::RepaintEventType),
    94         ex (x), ey (y), ew (w), eh (h)
     94        ex (iX), ey (iY), ew (iW), eh (iH)
    9595    {}
    9696    int x() { return ex; }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxMedium.cpp

    r24752 r25045  
    135135
    136136        /* Adjust the parent if its possible */
    137         CMedium parent = mMedium.GetParent();
    138         Assert (!parent.isNull() || mParent == NULL);
    139 
    140         if (!parent.isNull() && (mParent == NULL || mParent->mMedium != parent))
     137        CMedium parentMedium = mMedium.GetParent();
     138        Assert (!parentMedium.isNull() || mParent == NULL);
     139
     140        if (!parentMedium.isNull() && (mParent == NULL || mParent->mMedium != parentMedium))
    141141        {
    142142            /* Search for the parent (might be there) */
     
    147147                    break;
    148148
    149                 if ((*it).mMedium == parent)
     149                if ((*it).mMedium == parentMedium)
    150150                {
    151151                    mParent = unconst (&*it);
     
    184184        if (machineIds.size() > 0)
    185185        {
    186             QString usage;
     186            QString sUsage;
    187187
    188188            CVirtualBox vbox = vboxGlobal().virtualBox();
     
    192192                CMachine machine = vbox.GetMachine (*it);
    193193
    194                 QString name = machine.GetName();
    195                 QString snapshots;
     194                QString sName = machine.GetName();
     195                QString sSnapshots;
    196196
    197197                QVector <QString> snapIds = mMedium.GetSnapshotIds (*it);
     
    210210                    if (!snapshot.isNull())           // can be NULL while takeSnaphot is in progress
    211211                    {
    212                         if (!snapshots.isNull())
    213                             snapshots += ", ";
    214                         snapshots += snapshot.GetName();
     212                        if (!sSnapshots.isNull())
     213                            sSnapshots += ", ";
     214                        sSnapshots += snapshot.GetName();
    215215                    }
    216216                }
    217217
    218                 if (!usage.isNull())
    219                     usage += ", ";
    220 
    221                 usage += name;
    222 
    223                 if (!snapshots.isNull())
     218                if (!sUsage.isNull())
     219                    sUsage += ", ";
     220
     221                sUsage += sName;
     222
     223                if (!sSnapshots.isNull())
    224224                {
    225                     usage += QString (" (%2)").arg (snapshots);
     225                    sUsage += QString (" (%2)").arg (sSnapshots);
    226226                    mIsUsedInSnapshots = true;
    227227                }
     
    230230            }
    231231
    232             Assert (!usage.isEmpty());
    233             mUsage = usage;
     232            Assert (!sUsage.isEmpty());
     233            mUsage = sUsage;
    234234        }
    235235    }
     
    286286VBoxMedium &VBoxMedium::root() const
    287287{
    288     VBoxMedium *root = unconst (this);
    289     while (root->mParent != NULL)
    290         root = root->mParent;
    291 
    292     return *root;
     288    VBoxMedium *pRoot = unconst (this);
     289    while (pRoot->mParent != NULL)
     290        pRoot = pRoot->mParent;
     291
     292    return *pRoot;
    293293}
    294294
     
    307307QString VBoxMedium::toolTip (bool aNoDiffs /* = false */, bool aCheckRO /* = false */, bool aNullAllowed /* = false */) const
    308308{
    309     QString tip;
     309    QString sTip;
    310310
    311311    if (mMedium.isNull())
    312312    {
    313         tip = aNullAllowed ? mRow.arg (VBoxGlobal::tr ("<b>No medium selected</b>", "medium")) +
    314                              mRow.arg (VBoxGlobal::tr ("You can also change this while the machine is running.")) :
    315                              mRow.arg (VBoxGlobal::tr ("<b>No media available</b>", "medium")) +
    316                              mRow.arg (VBoxGlobal::tr ("You can create media images using the virtual media manager."));
     313        sTip = aNullAllowed ? mRow.arg (VBoxGlobal::tr ("<b>No medium selected</b>", "medium")) +
     314                              mRow.arg (VBoxGlobal::tr ("You can also change this while the machine is running.")) :
     315                              mRow.arg (VBoxGlobal::tr ("<b>No media available</b>", "medium")) +
     316                              mRow.arg (VBoxGlobal::tr ("You can create media images using the virtual media manager."));
    317317    }
    318318    else
     
    320320        unconst (this)->checkNoDiffs (aNoDiffs);
    321321
    322         tip = aNoDiffs ? mNoDiffs.toolTip : mToolTip;
     322        sTip = aNoDiffs ? mNoDiffs.toolTip : mToolTip;
    323323
    324324        if (aCheckRO && mIsReadOnly)
    325             tip += mRow.arg ("<hr>") +
    326                    mRow.arg (VBoxGlobal::tr ("Attaching this hard disk will be performed indirectly using "
    327                                              "a newly created differencing hard disk.", "medium"));
    328     }
    329 
    330     return mTable.arg (tip);
     325            sTip += mRow.arg ("<hr>") +
     326                    mRow.arg (VBoxGlobal::tr ("Attaching this hard disk will be performed indirectly using "
     327                                              "a newly created differencing hard disk.", "medium"));
     328    }
     329
     330    return mTable.arg (sTip);
    331331}
    332332
     
    347347QPixmap VBoxMedium::icon (bool aNoDiffs /* = false */, bool aCheckRO /* = false */) const
    348348{
    349     QPixmap icon;
     349    QPixmap pixmap;
    350350
    351351    if (state (aNoDiffs) == KMediumState_Inaccessible)
    352         icon = result (aNoDiffs).isOk() ? vboxGlobal().warningIcon() : vboxGlobal().errorIcon();
     352        pixmap = result (aNoDiffs).isOk() ? vboxGlobal().warningIcon() : vboxGlobal().errorIcon();
    353353
    354354    if (aCheckRO && mIsReadOnly)
    355         icon = VBoxGlobal::joinPixmaps (icon, QPixmap (":/new_16px.png"));
    356 
    357     return icon;
     355        pixmap = VBoxGlobal::joinPixmaps (pixmap, QPixmap (":/new_16px.png"));
     356
     357    return pixmap;
    358358}
    359359
     
    407407        return QString::null;
    408408
    409     QString details, str;
    410 
    411     VBoxMedium *root = unconst (this);
    412     KMediumState state = mState;
     409    QString sDetails, sStr;
     410
     411    VBoxMedium *pRoot = unconst (this);
     412    KMediumState eState = mState;
    413413
    414414    if (mType == VBoxDefs::MediumType_HardDisk)
     
    416416        if (aNoDiffs)
    417417        {
    418             root = &this->root();
     418            pRoot = &this->root();
    419419
    420420            bool isDiff = (!aPredictDiff && mParent != NULL) || (aPredictDiff && mIsReadOnly);
    421421
    422             details = isDiff && aUseHTML ?
    423                 QString ("<i>%1</i>, ").arg (root->mHardDiskType) :
    424                 QString ("%1, ").arg (root->mHardDiskType);
    425 
    426             state = this->state (true /* aNoDiffs */);
    427 
    428             if (root->mState == KMediumState_NotCreated)
    429                 state = KMediumState_NotCreated;
     422            sDetails = isDiff && aUseHTML ?
     423                QString ("<i>%1</i>, ").arg (pRoot->mHardDiskType) :
     424                QString ("%1, ").arg (pRoot->mHardDiskType);
     425
     426            eState = this->state (true /* aNoDiffs */);
     427
     428            if (pRoot->mState == KMediumState_NotCreated)
     429                eState = KMediumState_NotCreated;
    430430        }
    431431        else
    432432        {
    433             details = QString ("%1, ").arg (root->mHardDiskType);
     433            sDetails = QString ("%1, ").arg (pRoot->mHardDiskType);
    434434        }
    435435    }
     
    437437    // @todo prepend the details with the warning/error icon when not accessible
    438438
    439     switch (state)
     439    switch (eState)
    440440    {
    441441        case KMediumState_NotCreated:
    442             str = VBoxGlobal::tr ("Checking...", "medium");
    443             details += aUseHTML ? QString ("<i>%1</i>").arg (str) : str;
     442            sStr = VBoxGlobal::tr ("Checking...", "medium");
     443            sDetails += aUseHTML ? QString ("<i>%1</i>").arg (sStr) : sStr;
    444444            break;
    445445        case KMediumState_Inaccessible:
    446             str = VBoxGlobal::tr ("Inaccessible", "medium");
    447             details += aUseHTML ? QString ("<b>%1</b>").arg (str) : str;
     446            sStr = VBoxGlobal::tr ("Inaccessible", "medium");
     447            sDetails += aUseHTML ? QString ("<b>%1</b>").arg (sStr) : sStr;
    448448            break;
    449449        default:
    450             details += mType == VBoxDefs::MediumType_HardDisk ? root->mLogicalSize : root->mSize;
     450            sDetails += mType == VBoxDefs::MediumType_HardDisk ? pRoot->mLogicalSize : pRoot->mSize;
    451451            break;
    452452    }
    453453
    454     details = aUseHTML ?
    455         QString ("%1 (<nobr>%2</nobr>)").arg (VBoxGlobal::locationForHTML (root->mName), details) :
    456         QString ("%1 (%2)").arg (VBoxGlobal::locationForHTML (root->mName), details);
    457 
    458     return details;
     454    sDetails = aUseHTML ?
     455        QString ("%1 (<nobr>%2</nobr>)").arg (VBoxGlobal::locationForHTML (pRoot->mName), sDetails) :
     456        QString ("%1 (%2)").arg (VBoxGlobal::locationForHTML (pRoot->mName), sDetails);
     457
     458    return sDetails;
    459459}
    460460
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r25041 r25045  
    298298#endif
    299299
    300     int i;
    301     for (i=0; i<argc; i++)
     300    for (int i=0; i<argc; i++)
    302301        if (   !strcmp(argv[i], "-h")
    303302            || !strcmp(argv[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