VirtualBox

Changeset 107420 in vbox for trunk/src


Ignore:
Timestamp:
Jan 6, 2025 3:57:35 PM (13 days ago)
Author:
vboxsync
Message:

FE/Qt: bugref:3409: Extra-data Manager & Runtime UI: Fixing parfait warnings related to implicit type conversion.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r107148 r107420  
    41804180}
    41814181
    4182 double UIExtraDataManager::scaleFactor(const QUuid &uID, const int uScreenIndex)
     4182double UIExtraDataManager::scaleFactor(const QUuid &uID, int iScreenIndex)
    41834183{
    41844184    /* Get corresponding extra-data for this machine: */
     
    41894189        return 1.0;
    41904190
    4191     int index = uScreenIndex;
    4192     /* use the 0th. scale factor in case we dont have a scale factor for @p uScreenIndex: */
    4193     if (data.size() <= uScreenIndex)
    4194         index = 0;
     4191    int iIndex = iScreenIndex;
     4192    /* use the 0th. scale factor in case we dont have a scale factor for @p iScreenIndex: */
     4193    if (data.size() <= iScreenIndex)
     4194        iIndex = 0;
    41954195
    41964196    bool fOk = false;
    4197     double scaleFactor = data[index].toDouble(&fOk);
     4197    const double dScaleFactor = data.at(iIndex).toDouble(&fOk);
    41984198    if (!fOk)
    41994199        return 1.0;
    4200     return scaleFactor;
     4200    return dScaleFactor;
    42014201}
    42024202
     
    42264226}
    42274227
    4228 void UIExtraDataManager::setScaleFactor(double dScaleFactor, const QUuid &uID, const int uScreenIndex)
     4228void UIExtraDataManager::setScaleFactor(double dScaleFactor, const QUuid &uID, int iScreenIndex)
    42294229{
    42304230    QStringList data = extraDataStringList(GUI_ScaleFactor, uID);
    42314231
    42324232    /* Just make sure that we have corresponding data item: */
    4233     if (data.size() <= uScreenIndex)
    4234     {
    4235         int listSize = data.size();
    4236         for (int i = listSize; i <= uScreenIndex; ++i)
     4233    if (data.size() <= iScreenIndex)
     4234    {
     4235        for (int i = data.size(); i <= iScreenIndex; ++i)
    42374236            data.append(QString::number(1.0));
    42384237    }
    42394238
    4240     data[uScreenIndex] = QString::number(dScaleFactor);
     4239    data[iScreenIndex] = QString::number(dScaleFactor);
    42414240    setExtraDataStringList(GUI_ScaleFactor, data, uID);
    42424241}
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r107148 r107420  
    713713
    714714        /** Returns the scale-factor. */
    715         double scaleFactor(const QUuid &uID, const int uScreenIndex);
     715        double scaleFactor(const QUuid &uID, int iScreenIndex);
    716716        QList<double> scaleFactors(const QUuid &uID);
    717717        /** Saves the @a dScaleFactor for the monitor with @a uScreenIndex. If the existing scale factor
    718718          * list (from extra data) does not have scale factors for the screens with ids in [0, uScreenIndex)
    719719          * the this function appends a default scale factor for said screens.*/
    720         void setScaleFactor(double dScaleFactor, const QUuid &uID, const int uScreenIndex);
     720        void setScaleFactor(double dScaleFactor, const QUuid &uID, int iScreenIndex);
    721721        /** Replaces the scale factor list of the machine with @a uID with @a scaleFactors. */
    722722        void setScaleFactors(const QList<double> &scaleFactors, const QUuid &uID);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp

    r107411 r107420  
    298298
    299299    /* Acquire selected scale-factor: */
    300     double dScaleFactor = gEDataManager->scaleFactor(uiCommon().managedVMUuid(), m_uScreenId);
     300    double dScaleFactor = gEDataManager->scaleFactor(uiCommon().managedVMUuid(), (int)m_uScreenId);
    301301
    302302    /* Take the device-pixel-ratio into account: */
     
    10611061
    10621062    /* Acquire selected scale-factor: */
    1063     double dScaleFactor = gEDataManager->scaleFactor(uiCommon().managedVMUuid(), m_uScreenId);
     1063    double dScaleFactor = gEDataManager->scaleFactor(uiCommon().managedVMUuid(), (int)m_uScreenId);
    10641064
    10651065    /* Take the device-pixel-ratio into account: */
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