VirtualBox

Changeset 30930 in vbox


Ignore:
Timestamp:
Jul 20, 2010 2:26:06 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: New running VM core: More wise positioning settings processing for normal & scale windows.

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

Legend:

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

    r30751 r30930  
    517517        QStringList strPositionSettings = machine.GetExtraDataStringList(strPositionAddress);
    518518
    519         bool ok = true, max = false;
     519        bool ok = !strPositionSettings.isEmpty(), max = false;
    520520        int x = 0, y = 0, w = 0, h = 0;
     521
    521522        if (ok && strPositionSettings.size() > 0)
    522523            x = strPositionSettings[0].toInt(&ok);
     524        else ok = false;
    523525        if (ok && strPositionSettings.size() > 1)
    524526            y = strPositionSettings[1].toInt(&ok);
     527        else ok = false;
    525528        if (ok && strPositionSettings.size() > 2)
    526529            w = strPositionSettings[2].toInt(&ok);
     530        else ok = false;
    527531        if (ok && strPositionSettings.size() > 3)
    528532            h = strPositionSettings[3].toInt(&ok);
     533        else ok = false;
    529534        if (ok && strPositionSettings.size() > 4)
    530535            max = strPositionSettings[4] == VBoxDefs::GUI_LastWindowState_Max;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineWindowScale.cpp

    r30848 r30930  
    217217        QStringList strPositionSettings = machine.GetExtraDataStringList(strPositionAddress);
    218218
    219         bool ok = true, max = false;
     219        bool ok = !strPositionSettings.isEmpty(), max = false;
    220220        int x = 0, y = 0, w = 0, h = 0;
     221
    221222        if (ok && strPositionSettings.size() > 0)
    222223            x = strPositionSettings[0].toInt(&ok);
     224        else ok = false;
    223225        if (ok && strPositionSettings.size() > 1)
    224226            y = strPositionSettings[1].toInt(&ok);
     227        else ok = false;
    225228        if (ok && strPositionSettings.size() > 2)
    226229            w = strPositionSettings[2].toInt(&ok);
     230        else ok = false;
    227231        if (ok && strPositionSettings.size() > 3)
    228232            h = strPositionSettings[3].toInt(&ok);
     233        else ok = false;
    229234        if (ok && strPositionSettings.size() > 4)
    230235            max = strPositionSettings[4] == VBoxDefs::GUI_LastWindowState_Max;
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