VirtualBox

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


Ignore:
Timestamp:
Jul 4, 2019 8:40:43 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
131799
Message:

FE/Qt: bugref:6143. Some refactoring

File:
1 edited

Legend:

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

    r79513 r79516  
    116116public:
    117117
    118     void setName(const QString &strName)
    119     {
    120         m_strName = strName;
    121     }
    122 
    123     const QString &name() const
    124     {
    125         return m_strName;
    126     }
     118    void setName(const QString &strName);
     119    const QString &name() const;
     120
     121    void setFileName(const QString &strName);
     122    const QString &fileName() const;
     123
     124    void setUid(const QUuid &uid);
     125    const QUuid &uid() const;
     126
     127    const QVector<UISoftKeyboardRow> &rows() const;
     128    QVector<UISoftKeyboardRow> &rows();
     129
     130private:
    127131
    128132    QString  m_strFileName;
    129133    QUuid    m_uId;
    130 
    131     const QVector<UISoftKeyboardRow> &rows() const
    132     {
    133         return m_rows;
    134     }
    135 
    136     QVector<UISoftKeyboardRow> &rows()
    137     {
    138         return m_rows;
    139     }
    140 
    141 private:
    142 
    143134    QString  m_strName;
    144135    QVector<UISoftKeyboardRow>  m_rows;
     
    726717};
    727718
     719
     720/*********************************************************************************************************************************
     721*   UISoftKeyboardPhysicalLayout implementation.                                                                                 *
     722*********************************************************************************************************************************/
     723
     724void UISoftKeyboardPhysicalLayout::setName(const QString &strName)
     725{
     726    m_strName = strName;
     727}
     728
     729const QString &UISoftKeyboardPhysicalLayout::name() const
     730{
     731    return m_strName;
     732}
     733
     734void UISoftKeyboardPhysicalLayout::setFileName(const QString &strName)
     735{
     736    m_strFileName = strName;
     737}
     738
     739const QString &UISoftKeyboardPhysicalLayout::fileName() const
     740{
     741    return m_strFileName;
     742}
     743
     744void UISoftKeyboardPhysicalLayout::setUid(const QUuid &uid)
     745{
     746    m_uId = uid;
     747}
     748
     749const QUuid &UISoftKeyboardPhysicalLayout::uid() const
     750{
     751    return m_uId;
     752}
     753
     754const QVector<UISoftKeyboardRow> &UISoftKeyboardPhysicalLayout::rows() const
     755{
     756    return m_rows;
     757}
     758
     759QVector<UISoftKeyboardRow> &UISoftKeyboardPhysicalLayout::rows()
     760{
     761    return m_rows;
     762}
    728763
    729764/*********************************************************************************************************************************
     
    780815            m_pLayout->setShiftAltGrCaption(m_pKey->position(), m_pShiftAltGrCaptionEdit->text());
    781816    }
    782 
    783817    m_pKey = pKey;
    784818    if (m_pSelectedKeyGroupBox)
     
    835869    m_pPhysicalLayoutCombo->clear();
    836870    foreach (const UISoftKeyboardPhysicalLayout &physicalLayout, physicalLayouts)
    837         m_pPhysicalLayoutCombo->addItem(physicalLayout.name(), physicalLayout.m_uId);
     871        m_pPhysicalLayoutCombo->addItem(physicalLayout.name(), physicalLayout.uid());
    838872}
    839873
     
    20912125    xmlWriter.writeTextElement("name", m_pCurrentKeyboardLayout->name());
    20922126    xmlWriter.writeTextElement("nativename", m_pCurrentKeyboardLayout->nativeName());
    2093     xmlWriter.writeTextElement("physicallayoutid", pPhysicalLayout->m_uId.toString());
     2127    xmlWriter.writeTextElement("physicallayoutid", pPhysicalLayout->uid().toString());
    20942128    xmlWriter.writeTextElement("id", m_pCurrentKeyboardLayout->uid().toString());
    20952129
     
    22562290        return;
    22572291
    2258     if (m_pCurrentKeyboardLayout->physicalLayoutUuid() == m_physicalLayouts[iIndex].m_uId)
    2259         return;
    2260     m_pCurrentKeyboardLayout->setPhysicalLayoutUuid(m_physicalLayouts[iIndex].m_uId);
     2292    if (m_pCurrentKeyboardLayout->physicalLayoutUuid() == m_physicalLayouts[iIndex].uid())
     2293        return;
     2294    m_pCurrentKeyboardLayout->setPhysicalLayoutUuid(m_physicalLayouts[iIndex].uid());
    22612295    update();
    22622296}
     
    25332567    for (int i = 0; i < m_physicalLayouts.size(); ++i)
    25342568    {
    2535         if (m_physicalLayouts[i].m_uId == uuid)
     2569        if (m_physicalLayouts[i].uid() == uuid)
    25362570            return &(m_physicalLayouts[i]);
    25372571    }
     
    27052739    if (!m_xmlReader.readNextStartElement() || m_xmlReader.name() != "physicallayout")
    27062740        return false;
    2707     physicalLayout.m_strFileName = strFileName;
     2741    physicalLayout.setFileName(strFileName);
    27082742
    27092743    QXmlStreamAttributes attributes = m_xmlReader.attributes();
     
    27242758            physicalLayout.setName(m_xmlReader.readElementText());
    27252759        else if (m_xmlReader.name() == "id")
    2726             physicalLayout.m_uId = m_xmlReader.readElementText();
     2760            physicalLayout.setUid(m_xmlReader.readElementText());
    27272761        else
    27282762            m_xmlReader.skipCurrentElement();
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