From cf48632f89383c9f96346ef8d0ac794f611766a0 Mon Sep 17 00:00:00 2001 From: Arttu Tarkiainen Date: Tue, 26 Jan 2021 15:58:42 +0200 Subject: Restructure logging utilities Create a singleton-pattern class as an encapsulation unit for holding and altering the state of debug printing attributes. Move related code from various places under a single umbrella header file for logging utilities, with some minor stylistic changes & cleanup. This acts as a preparatory change for providing non-blocking headless CLI runs when there is no TTY attached - that will be fixed in a follow-up change. Change-Id: Ib7f72cf75362c3ea6713058e92eda997d6df55c3 Reviewed-by: Katja Marttila --- src/libs/installer/packagemanagergui.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libs/installer/packagemanagergui.cpp') diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index beb8603a4..e9f3a42fa 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -41,6 +41,7 @@ #include "productkeycheck.h" #include "repositorycategory.h" #include "componentselectionpage_p.h" +#include "loggingutils.h" #include "sysinfo.h" #include "globals.h" @@ -2578,7 +2579,7 @@ void ReadyForInstallationPage::entering() QString htmlOutput; bool componentsOk = packageManagerCore()->calculateComponents(&htmlOutput); m_taskDetailsBrowser->setHtml(htmlOutput); - m_taskDetailsBrowser->setVisible(!componentsOk || isVerbose()); + m_taskDetailsBrowser->setVisible(!componentsOk || LoggingHandler::instance().isVerbose()); setComplete(componentsOk); QString spaceInfo; @@ -2719,7 +2720,7 @@ void PerformInstallationPage::entering() if (packageManagerCore()->settings().productImages().count() > 1) m_imageChangeTimer.start(); - if (isVerbose()) { + if (LoggingHandler::instance().isVerbose()) { m_performInstallationForm->toggleDetails(); } if (packageManagerCore()->isUninstaller()) { -- cgit v1.2.3