VirtualBox

Ignore:
Timestamp:
Apr 23, 2021 11:09:03 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
143985
Message:

FE/Qt: bugref:9930. Some refactoring

Location:
trunk/src/VBox/Frontends/VirtualBox/src/logviewer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.cpp

    r82968 r88671  
    3232
    3333
    34 UIVMLogPage::UIVMLogPage(QWidget *pParent /* = 0 */, int tabIndex /*= -1 */)
     34UIVMLogPage::UIVMLogPage(QWidget *pParent /* = 0 */)
    3535    : QIWithRetranslateUI<QWidget>(pParent)
    3636    , m_pMainLayout(0)
    3737    , m_pTextEdit(0)
    38     , m_tabIndex(tabIndex)
    3938    , m_iSelectedBookmarkIndex(-1)
    4039    , m_bFiltered(false)
     
    9695        return 0;
    9796    return m_pTextEdit->document();
    98 }
    99 
    100 void UIVMLogPage::setTabIndex(int index)
    101 {
    102     m_tabIndex = index;
    103 }
    104 
    105 int UIVMLogPage::tabIndex()  const
    106 {
    107     return m_tabIndex;
    10897}
    10998
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogPage.h

    r82968 r88671  
    5454public:
    5555
    56     UIVMLogPage(QWidget *pParent = 0, int tabIndex = -1);
     56    UIVMLogPage(QWidget *pParent = 0);
    5757    ~UIVMLogPage();
    5858
     
    6262    QPlainTextEdit *textEdit();
    6363    QTextDocument  *document();
    64 
    65     void setTabIndex(int index);
    66     int tabIndex()  const;
    6764
    6865    /* Only to be called when log file is re-read. */
     
    137134    /** Stores full path and name of the log file. */
    138135    QString         m_strLogFileName;
    139     /** This is the index of the tab containing this widget in UIVMLogViewerWidget. */
    140     int             m_tabIndex;
    141136    /** Stores the bookmarks of the logpage. All other bookmark related containers are updated wrt. this one. */
    142137    QVector<LogBookmark> m_bookmarkVector;
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp

    r88660 r88671  
    133133    m_pLayout->addWidget(pCheckBox);
    134134}
    135 
    136 
    137 UIVMLogViewerWidget::Machine::Machine(const QUuid &id, const QString &strName)
    138     : m_id(id)
    139     , m_strName(strName)
    140 {
    141 }
    142 
    143 UIVMLogViewerWidget::Machine::Machine()
    144 {}
    145135
    146136UIVMLogViewerWidget::UIVMLogViewerWidget(EmbedTo enmEmbedding,
     
    213203        if (!item)
    214204            continue;
    215         m_machines << Machine(item->id(), item->name());
    216     }
    217     updateMachineSelectionMenu();
     205        //m_machines << Machine(item->id(), item->name());
     206    }
     207    //updateMachineSelectionMenu();
    218208}
    219209
     
    875865        int tabIndex = m_pTabWidget->insertTab(m_pTabWidget->count(), pLogPage, QFileInfo(strFileName).fileName());
    876866
    877         pLogPage->setTabIndex(tabIndex);
    878867        m_logPageList.resize(m_pTabWidget->count());
    879868        m_logPageList[tabIndex] = pLogPage;
     
    948937                if (uOffset >= uAllowedLogSize)
    949938                {
    950                     strText.append("\n=========Log file has been truncate as it is too large.======");
     939                    strText.append("\n=========Log file has been truncated as it is too large.======");
    951940                    break;
    952941                }
     
    10431032    m_pMachineSelectionMenu->clear();
    10441033
    1045     foreach (const Machine &machine, m_machines)
    1046     {
    1047 
    1048         m_pMachineSelectionMenu->addListItem(machine.m_strName, machine.m_id);
    1049     }
     1034    // foreach (const Machine &machine, m_machines)
     1035    // {
     1036
     1037    //     m_pMachineSelectionMenu->addListItem(machine.m_strName, machine.m_id);
     1038    // }
    10501039}
    10511040
  • trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h

    r88660 r88671  
    141141    void sltCornerButtonClicked();
    142142private:
    143         struct Machine
    144         {
    145             Machine(const QUuid &id, const QString &strName);
    146             Machine();
    147             QUuid   m_id;
    148             QString m_strName;
    149         };
     143
    150144    /** @name Prepare/Cleanup
    151145      * @{ */
     
    207201    /** Holds the machine instance. */
    208202    CMachine      m_comMachine;
    209     QVector<Machine> m_machines;
     203    QMap<QUuid, CMachine> m_machines;
    210204
    211205    /** Holds whether the dialog is polished. */
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