From 740411f194d7bd45206862a939c0bcefd94d6457 Mon Sep 17 00:00:00 2001 From: Uyanide Date: Tue, 24 Mar 2026 12:48:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20correct=20behaviour=20of?= =?UTF-8?q?=20--disable-actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 2 +- WallReel/Assets/man/man.1 | 2 +- WallReel/Assets/man/man.5 | 2 +- WallReel/Core/Config/manager.cpp | 10 +++++++++- WallReel/Core/Config/manager.hpp | 4 ++++ WallReel/Core/Provider/bootstrap.hpp | 11 +++++++++-- docs/man/man.1.md | 2 +- docs/man/man.5.md | 2 +- 8 files changed, 27 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9e1d22..ae34e57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -project(WallReel VERSION 2.0.1 LANGUAGES CXX) +project(WallReel VERSION 2.0.2 LANGUAGES CXX) set(EXECUTABLE_NAME "wallreel") set(CORELIB_NAME "wallreel-core") diff --git a/WallReel/Assets/man/man.1 b/WallReel/Assets/man/man.1 index 8575b45..3128116 100644 --- a/WallReel/Assets/man/man.1 +++ b/WallReel/Assets/man/man.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.5 .\" -.TH "WALLREEL" "1" "2026\-03\-24" "WallReel 2.0.1" "User Commands" +.TH "WALLREEL" "1" "2026\-03\-24" "WallReel 2.0.2" "User Commands" .SH NAME wallreel \- Choose and set desktop wallpapers with customizable themes and actions diff --git a/WallReel/Assets/man/man.5 b/WallReel/Assets/man/man.5 index 5d887e0..72e0956 100644 --- a/WallReel/Assets/man/man.5 +++ b/WallReel/Assets/man/man.5 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 3.5 .\" -.TH "WALLREEL" "5" "2026\-03\-24" "WallReel 2.0.1" "File Formats Manual" +.TH "WALLREEL" "5" "2026\-03\-24" "WallReel 2.0.2" "File Formats Manual" .SH NAME wallreel\-config \- configuration format for wallreel .SH SYNOPSIS diff --git a/WallReel/Core/Config/manager.cpp b/WallReel/Core/Config/manager.cpp index be760a7..58800a5 100644 --- a/WallReel/Core/Config/manager.cpp +++ b/WallReel/Core/Config/manager.cpp @@ -26,8 +26,9 @@ Manager::Manager( const QDir& picturesDir, const QStringList& searchDirs, const QString& configPath, + bool disableActions, QObject* parent) - : QObject(parent), m_configDir(configDir) { + : QObject(parent), m_configDir(configDir), m_disableActions(disableActions) { connect(this, &Manager::stateCaptured, this, [this]() { m_stateCaptured = true; WR_INFO("State capture completed"); @@ -398,6 +399,13 @@ void Manager::captureState() { if (m_stateCaptured) { WR_DEBUG("State already captured, skipping capture"); emit stateCaptured(); + return; + } + + if (m_disableActions) { + WR_DEBUG("Actions are disabled, skipping state capture"); + emit stateCaptured(); + return; } if (m_pendingCaptures > 0) { diff --git a/WallReel/Core/Config/manager.hpp b/WallReel/Core/Config/manager.hpp index 8bc7ad6..15b6b5e 100644 --- a/WallReel/Core/Config/manager.hpp +++ b/WallReel/Core/Config/manager.hpp @@ -27,6 +27,7 @@ class Manager : public QObject { * @param searchDirs Additional directories to search for wallpapers (not recursive) * @param configPath Optional path to a specific configuration file (overrides the default config path) * @param picturesDir The pictures directory (default location for user wallpapers) + * @param disableActions Whether to disable actions * @param parent QObject parent * * @note The constructor will load the configuration and scan for wallpapers immediately. @@ -36,6 +37,7 @@ class Manager : public QObject { const QDir& picturesDir, const QStringList& searchDirs = {}, const QString& configPath = "", + bool disableActions = false, QObject* parent = nullptr); ~Manager(); @@ -88,6 +90,8 @@ class Manager : public QObject { private: const QDir m_configDir; + bool m_disableActions = false; + WallpaperConfigItems m_wallpaperConfig; ThemeConfigItems m_themeConfig; ActionConfigItems m_actionConfig; diff --git a/WallReel/Core/Provider/bootstrap.hpp b/WallReel/Core/Provider/bootstrap.hpp index e561ce3..07b0495 100644 --- a/WallReel/Core/Provider/bootstrap.hpp +++ b/WallReel/Core/Provider/bootstrap.hpp @@ -18,12 +18,13 @@ class Bootstrap { friend class Carousel; public: - Bootstrap(const AppOptions& options) { + Bootstrap(const AppOptions& options) : options(options) { configMgr = new Config::Manager( Utils::getConfigDir(), Utils::getPicturesDir(), options.appendDirs, - options.configPath); + options.configPath, + options.disableActions); cacheMgr = new Cache::Manager( Utils::getCacheDir(), @@ -58,6 +59,11 @@ class Bootstrap { } bool apply(const QString& path) { + if (options.disableActions) { + Logger::warn("Bootstrap", "Actions are disabled, cannot apply wallpaper"); + return false; + } + QEventLoop loop; bool successFlag = false; @@ -122,6 +128,7 @@ class Bootstrap { } private: + const AppOptions& options; Cache::Manager* cacheMgr{}; Config::Manager* configMgr{}; Image::Manager* imageMgr{}; diff --git a/docs/man/man.1.md b/docs/man/man.1.md index 767c03c..7ec2899 100644 --- a/docs/man/man.1.md +++ b/docs/man/man.1.md @@ -2,7 +2,7 @@ title: WALLREEL section: 1 header: User Commands -footer: WallReel 2.0.1 +footer: WallReel 2.0.2 date: 2026-03-24 --- diff --git a/docs/man/man.5.md b/docs/man/man.5.md index 73adbc0..66c5956 100644 --- a/docs/man/man.5.md +++ b/docs/man/man.5.md @@ -2,7 +2,7 @@ title: WALLREEL section: 5 header: File Formats Manual -footer: WallReel 2.0.1 +footer: WallReel 2.0.2 date: 2026-03-24 ---