From acb731d8237ce638decaa32514215b2c05048d0a Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 21 Jun 2021 22:21:06 +0200 Subject: [PATCH] [libcalamaresui] Provide the logFile path This is intended for consumption by QML; the ViewManager object acts as a proxy for a handful of global Settings values already, so throw in global Logger values as well. A QML module that would like to read the log file (e.g. for tailing it as part of a slide-show) can get the path via this property. --- src/libcalamaresui/ViewManager.cpp | 6 ++++++ src/libcalamaresui/ViewManager.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/libcalamaresui/ViewManager.cpp b/src/libcalamaresui/ViewManager.cpp index c55b5dd67..f6edbfc2a 100644 --- a/src/libcalamaresui/ViewManager.cpp +++ b/src/libcalamaresui/ViewManager.cpp @@ -613,4 +613,10 @@ ViewManager::isSetupMode() const return s ? s->isSetupMode() : false; } +QString +ViewManager::logFilePath() const +{ + return Logger::logFile(); +} + } // namespace Calamares diff --git a/src/libcalamaresui/ViewManager.h b/src/libcalamaresui/ViewManager.h index 9a77cbb5a..5a449a153 100644 --- a/src/libcalamaresui/ViewManager.h +++ b/src/libcalamaresui/ViewManager.h @@ -54,6 +54,7 @@ class UIDLLEXPORT ViewManager : public QAbstractListModel Q_PROPERTY( bool isDebugMode READ isDebugMode CONSTANT FINAL ) Q_PROPERTY( bool isChrootMode READ isChrootMode CONSTANT FINAL ) Q_PROPERTY( bool isSetupMode READ isSetupMode CONSTANT FINAL ) + Q_PROPERTY( QString logFilePath READ logFilePath CONSTANT FINAL ) public: /** @@ -208,6 +209,8 @@ public Q_SLOTS: bool isChrootMode() const; /// @brief Proxy to Settings::isSetupMode() default @c false bool isSetupMode() const; + /// @brief Proxy to Logger::logFile(), default empty + QString logFilePath() const; signals: void currentStepChanged();