From 0524f26f97e1c76eed280696bc8b726c67865274 Mon Sep 17 00:00:00 2001 From: Uyanide Date: Fri, 3 Apr 2026 08:40:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20forgot=20to=20implement?= =?UTF-8?q?=20'printSelected'=20=F0=9F=98=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WallReel/Core/Service/manager.cpp | 3 +++ WallReel/Core/Utils/misc.hpp | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/WallReel/Core/Service/manager.cpp b/WallReel/Core/Service/manager.cpp index bd1345e..de609b1 100644 --- a/WallReel/Core/Service/manager.cpp +++ b/WallReel/Core/Service/manager.cpp @@ -1,5 +1,6 @@ #include "manager.hpp" +#include "Utils/misc.hpp" #include "Utils/texttemplate.hpp" #include "logger.hpp" @@ -61,6 +62,8 @@ void Manager::selectWallpaper(const QString& id) { return; } + Utils::printPath(data->getFullPath()); + const auto command = _renderCommand(m_actionConfig.onSelected, _generateVariables(*data)); m_wallpaperService->select(command); } diff --git a/WallReel/Core/Utils/misc.hpp b/WallReel/Core/Utils/misc.hpp index d3fa83d..6052c8c 100644 --- a/WallReel/Core/Utils/misc.hpp +++ b/WallReel/Core/Utils/misc.hpp @@ -179,6 +179,24 @@ inline QDir getPicturesDir() { return QDir(picturesDir); } +inline void printPath(const QString& path, std::FILE* out = stdout) { + if (path.isEmpty()) { + return; + } + + const QByteArray bytes = QFile::encodeName(path); + + const size_t n = static_cast(bytes.size()); + if (std::fwrite(bytes.constData(), 1, n, out) != n) { + return; + } + if (std::fputc('\n', out) == EOF) { + return; + } + std::fflush(out); + return; +} + } // namespace WallReel::Core::Utils #endif // WALLREEL_MISC_HPP