🐛 fix: forgot to implement 'printSelected' 😒

This commit is contained in:
2026-04-03 08:40:16 +02:00
parent 740411f194
commit 0524f26f97
2 changed files with 21 additions and 0 deletions
+3
View File
@@ -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);
}
+18
View File
@@ -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<size_t>(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