VirtualBox

Changeset 79126 in vbox


Ignore:
Timestamp:
Jun 13, 2019 10:55:00 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6143. Build fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r79121 r79126  
    285285
    286286public:
    287 
     287    UISoftKeyboardLayout()
     288        :m_pPhysicalLayout(0){}
    288289    /** The physical layout used by this layout. */
    289290    UISoftKeyboardPhysicalLayout *m_pPhysicalLayout;
     
    385386    int   m_iRightMargin;
    386387    int   m_iBottomMargin;
    387     bool  m_fInKeyCapEditMode;
    388388
    389389    QMenu   *m_pContextMenu;
     
    434434    };
    435435
    436     bool  parseFile(const QString &strFileName, UISoftKeyboardLayout &layout, QUuid &physicalLayoutUid);
     436    bool  parseFile(const QString &strFileName);
    437437
    438438private:
    439439
    440 
    441     void  parseKey(QMap<int, KeyCaptions> &keyCapMap);
     440    void  parseKey();
    442441    QXmlStreamReader m_xmlReader;
     442    /** Map key is the key position and the value is the captions of the key. */
     443    QMap<int, KeyCaptions> m_keyCapMap;
     444    QUuid m_physicalLayoutUid;
     445    QString m_strName;
    443446};
    444447
     
    980983    , m_iRightMargin(10)
    981984    , m_iBottomMargin(10)
    982     , m_fInKeyCapEditMode(false)
    983985    , m_pContextMenu(0)
    984986    , m_pShowPositionsAction(0)
     
    15171519        return false;
    15181520
    1519     m_layouts.append(UISoftKeyboardLayout());
    1520     UISoftKeyboardLayout &newLayout = m_layouts.back();
    15211521    UIKeyboardLayoutReader keyboardLayoutReader;
    1522     QUuid physicalLayoutUid;
    1523     if (!keyboardLayoutReader.parseFile(strLayoutName, newLayout, physicalLayoutUid))
    1524     {
    1525         m_layouts.removeLast();
     1522
     1523    if (!keyboardLayoutReader.parseFile(strLayoutName))
    15261524        return false;
    1527     }
     1525
     1526    // m_layouts.append(UISoftKeyboardLayout());
     1527    // UISoftKeyboardLayout &newLayout = m_layouts.back();
     1528
     1529
     1530    /* Search for the physical layout among the one stored in m_pPhysicalLayout: */
     1531    // for (int i = 0; i < m_physicalLayouts.size(); ++i)
     1532    // {
     1533    //     if (physicalLayoutUid == m_physicalLayouts[i].m_uId)
     1534    //         newLayout.m_pPhysicalLayout = &(m_physicalLayouts[i]);
     1535    // }
     1536
     1537    // /* If no pyhsical layout with the UUID the keyboard layout refers is found then cancel loading the keyboard layout: */
     1538    // if (!newLayout.m_pPhysicalLayout)
     1539    // {
     1540    //     m_layouts.removeLast();
     1541    //     return false;
     1542    // }
    15281543    return true;
    1529 //     //const QMap<int, QString> &keyCapMap = keyCapReader.keyCapMap();
    1530 
    1531 //     //for (int i = 0; i < m_rows.size(); ++i)
    1532 //     {
    1533 //         //QVector<UISoftKeyboardKey> &keys = m_rows[i].keys();
    1534 //         // for (int j = 0; j < keys.size(); ++j)
    1535 //         // {
    1536 //         //     UISoftKeyboardKey &key = keys[j];
    1537 //         //     if (keyCapMap.contains(key.position()))
    1538 //         //         key.setKeyCap(keyCapMap[key.position()]);
    1539 //         // }
    1540 //     }
    1541 //     emit sigKeyCapChange(strFileName);
    15421544
    15431545}
     
    18561858*********************************************************************************************************************************/
    18571859
    1858 bool UIKeyboardLayoutReader::parseFile(const QString &strFileName, UISoftKeyboardLayout &layout, QUuid &physicalLayoutUid)
     1860bool UIKeyboardLayoutReader::parseFile(const QString &strFileName)
    18591861{
    18601862    QFile xmlFile(strFileName);
     
    18701872        return false;
    18711873
    1872     /** Map key is the key position and the value is the captions of the key. */
    1873     QMap<int, KeyCaptions> keyCapMap;
    1874 
    18751874    while (m_xmlReader.readNextStartElement())
    18761875    {
    18771876        if (m_xmlReader.name() == "key")
    1878             parseKey(keyCapMap);
     1877            parseKey();
    18791878        else if (m_xmlReader.name() == "name")
    1880             layout.m_strName = m_xmlReader.readElementText();
     1879            m_strName = m_xmlReader.readElementText();
    18811880        else if (m_xmlReader.name() == "physicallayoutid")
    1882             physicalLayoutUid = QUuid(m_xmlReader.readElementText());
     1881            m_physicalLayoutUid = QUuid(m_xmlReader.readElementText());
    18831882        else
    18841883            m_xmlReader.skipCurrentElement();
     
    18871886}
    18881887
    1889 void  UIKeyboardLayoutReader::parseKey(QMap<int, KeyCaptions> &keyCapMap)
     1888void  UIKeyboardLayoutReader::parseKey()
    18901889{
    18911890    KeyCaptions keyCaptions;
     
    19041903            m_xmlReader.skipCurrentElement();
    19051904    }
    1906     keyCapMap.insert(iKeyPosition, keyCaptions);
     1905    m_keyCapMap.insert(iKeyPosition, keyCaptions);
    19071906}
    19081907
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