Changeset 59498 in vbox
- Timestamp:
- Jan 27, 2016 4:35:56 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.cpp
r58859 r59498 502 502 QTextEdit *pCurrentPage = m_pViewer->currentLogPage(); 503 503 AssertReturnVoid(pCurrentPage); 504 const QString *pCurrentLog = m_pViewer->currentLog(); 505 if (pCurrentLog) 506 { 507 QString strInputText(pCurrentLog->data()); 504 QString strInputText = m_pViewer->currentLog(); 505 if (!strInputText.isNull()) 506 { 508 507 /* Prepare filter-data: */ 509 508 QString strFilteredText; … … 755 754 756 755 /* Clearing old data if any: */ 757 for (int index = 0; index < m_book.count(); index++)758 {759 QTextEdit* pLogPage = m_book.at(index).second;760 if (pLogPage)761 delete m_logMap[pLogPage];762 }763 756 m_book.clear(); 764 757 m_logMap.clear(); … … 805 798 m_book << qMakePair(strFileName, pLogViewer); 806 799 /* Add the log-text to the map: */ 807 m_logMap[pLogViewer] = new QString(strText);800 m_logMap[pLogViewer] = strText; 808 801 isAnyLogPresent = true; 809 802 } … … 978 971 saveSettings(); 979 972 980 /* Delete the log if not already: */981 for (int index = 0; index < m_book.count(); index++)982 {983 QTextEdit* pLogPage = m_book.at(index).second;984 if (pLogPage)985 delete m_logMap[pLogPage];986 }987 988 973 /* Remove log-viewer: */ 989 974 if (!m_machine.isNull()) … … 1111 1096 } 1112 1097 1113 const QString *UIVMLogViewer::currentLog()1098 const QString& UIVMLogViewer::currentLog() 1114 1099 { 1115 1100 return m_logMap[currentLogPage()]; -
trunk/src/VBox/Frontends/VirtualBox/src/UIVMLogViewer.h
r58859 r59498 45 45 typedef QPair<QString, QTextEdit*> LogPage; 46 46 typedef QList<LogPage> LogBook; 47 typedef QMap<QTextEdit*, QString *> VMLogMap;47 typedef QMap<QTextEdit*, QString> VMLogMap; 48 48 49 49 /** QMainWindow extension … … 110 110 QTextEdit* createLogPage(const QString &strPage); 111 111 /** Returns the content of current log-page. */ 112 const QString *currentLog();112 const QString& currentLog(); 113 113 114 114 /** Load settings helper. */
Note:
See TracChangeset
for help on using the changeset viewer.