Changeset 98854 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 7, 2023 11:08:32 AM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156178
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/logviewer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
r98103 r98854 49 49 #include "QIFileDialog.h" 50 50 #include "QITabWidget.h" 51 #include "QIToolBar.h" 52 #include "QIToolButton.h" 51 53 #include "UIActionPool.h" 54 #include "UICommon.h" 52 55 #include "UIExtraDataManager.h" 53 56 #include "UIIconPool.h" … … 60 63 #include "UIVMLogViewerSearchPanel.h" 61 64 #include "UIVMLogViewerOptionsPanel.h" 62 #include "QIToolBar.h"63 #include "QIToolButton.h"64 #include "UICommon.h"65 65 66 66 /* COM includes: */ 67 #include "COMEnums.h" 68 #include "CMachine.h" 67 69 #include "CSystemProperties.h" 68 70 … … 350 352 } 351 353 352 QString UIVMLogViewerWidget::readLogFile(CMachine &comMachine, int iLogFileId) 353 { 354 QString UIVMLogViewerWidget::readLogFile(const CMachine &comConstMachine, int iLogFileId) 355 { 356 CMachine comMachine(comConstMachine); // ReadLog is non const 354 357 QString strLogFileContent; 355 358 ULONG uOffset = 0; … … 358 361 { 359 362 QVector<BYTE> data = comMachine.ReadLog(iLogFileId, uOffset, _1M); 363 /// @todo it's probably worth testing !comMachine.isOk() and show error message, or not :) 360 364 if (data.size() == 0) 361 365 break; … … 452 456 return; 453 457 454 CMachine comMachine = uiCommon().virtualBox().FindMachine(pLogPage->machineId().toString()); 455 if (comMachine.isNull()) 458 if (pLogPage->machineId().isNull()) 456 459 return; 457 460 … … 464 467 const QDateTime dtInfo = fileInfo.lastModified(); 465 468 const QString strDtString = dtInfo.toString("yyyy-MM-dd-hh-mm-ss"); 466 const QString strDefaultFileName = QString("%1-%2.log").arg( comMachine.GetName()).arg(strDtString);469 const QString strDefaultFileName = QString("%1-%2.log").arg(pLogPage->machineName()).arg(strDtString); 467 470 const QString strDefaultFullName = QDir::toNativeSeparators(QDir::home().absolutePath() + "/" + strDefaultFileName); 468 471 -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h
r98844 r98854 42 42 #include "QIWithRetranslateUI.h" 43 43 44 /* COM includes: */45 #include "COMEnums.h"46 #include "CMachine.h"47 48 44 /* Forward declarations: */ 49 class UITabWidget;50 45 class QVBoxLayout; 46 class QIToolBar; 47 class QIToolButton; 51 48 class UIActionPool; 52 49 class UIDialogPanel; 53 class QIToolBar;54 class QIToolButton;55 50 class UIMachineListMenu; 51 class UITabWidget; 56 52 class UIVirtualMachineItem; 57 53 class UIVMLogPage; … … 59 55 class UIVMLogViewerBookmarksPanel; 60 56 class UIVMLogViewerFilterPanel; 57 class UIVMLogViewerOptionsPanel; 61 58 class UIVMLogViewerPanel; 62 59 class UIVMLogViewerSearchPanel; 63 class UIVMLogViewerOptionsPanel;60 class CMachine; 64 61 65 62 /** QWidget extension providing GUI for VirtualBox LogViewer. It … … 213 210 void setMachines(const QVector<QUuid> &machineIDs); 214 211 /** Returns the content of the ith log file of @comMachine or possibly an empty string */ 215 QString readLogFile( CMachine &comMachine, int iLogFileId);212 QString readLogFile(const CMachine &comConstMachine, int iLogFileId); 216 213 /** If the current tab is a label tab then switch to the next tab and return true. Returns false otherwise. */ 217 214 bool labelTabHandler();
Note:
See TracChangeset
for help on using the changeset viewer.