diff --git a/src/moodbar/moodbarloader.cpp b/src/moodbar/moodbarloader.cpp index 578e8b4d6..5b50ed9e7 100644 --- a/src/moodbar/moodbarloader.cpp +++ b/src/moodbar/moodbarloader.cpp @@ -34,6 +34,10 @@ #include "core/qhash_qurl.h" #include "core/utilities.h" +#ifdef Q_OS_WIN32 +#include +#endif + MoodbarLoader::MoodbarLoader(Application* app, QObject* parent) : QObject(parent), cache_(new QNetworkDiskCache(this)), @@ -167,6 +171,15 @@ void MoodbarLoader::RequestFinished(MoodbarPipeline* request, const QUrl& url) { QFile mood_file(mood_filename); if (mood_file.open(QIODevice::WriteOnly)) { mood_file.write(request->data()); + +#ifdef Q_OS_WIN32 + if (!SetFileAttributes((LPCTSTR)mood_filename.utf16(), + FILE_ATTRIBUTE_HIDDEN)) { + qLog(Warning) << "Error setting hidden attribute for file" + << mood_filename; + } +#endif + } else { qLog(Warning) << "Error opening mood file for writing" << mood_filename; }