🐛 fix: forgot to implement 'printSelected' 😒
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "manager.hpp"
|
#include "manager.hpp"
|
||||||
|
|
||||||
|
#include "Utils/misc.hpp"
|
||||||
#include "Utils/texttemplate.hpp"
|
#include "Utils/texttemplate.hpp"
|
||||||
#include "logger.hpp"
|
#include "logger.hpp"
|
||||||
|
|
||||||
@@ -61,6 +62,8 @@ void Manager::selectWallpaper(const QString& id) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utils::printPath(data->getFullPath());
|
||||||
|
|
||||||
const auto command = _renderCommand(m_actionConfig.onSelected, _generateVariables(*data));
|
const auto command = _renderCommand(m_actionConfig.onSelected, _generateVariables(*data));
|
||||||
m_wallpaperService->select(command);
|
m_wallpaperService->select(command);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,6 +179,24 @@ inline QDir getPicturesDir() {
|
|||||||
return QDir(picturesDir);
|
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
|
} // namespace WallReel::Core::Utils
|
||||||
|
|
||||||
#endif // WALLREEL_MISC_HPP
|
#endif // WALLREEL_MISC_HPP
|
||||||
|
|||||||
Reference in New Issue
Block a user