From 3cd7641f2ea80b4b88358e3f505a5863e0dcffa1 Mon Sep 17 00:00:00 2001 From: Santi Date: Sat, 8 Aug 2015 16:54:30 -0300 Subject: [PATCH 1/3] Set mood file as hidden on Windows --- src/moodbar/moodbarloader.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/moodbar/moodbarloader.cpp b/src/moodbar/moodbarloader.cpp index 578e8b4d6..5cfcd0102 100644 --- a/src/moodbar/moodbarloader.cpp +++ b/src/moodbar/moodbarloader.cpp @@ -167,6 +167,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 changing hidden attribute for file" + << mood_filename; + } +#endif + } else { qLog(Warning) << "Error opening mood file for writing" << mood_filename; } From 5779385c8b40ea9c3ee18c46b00c36790c936755 Mon Sep 17 00:00:00 2001 From: Santi Date: Sat, 8 Aug 2015 16:57:28 -0300 Subject: [PATCH 2/3] Change warning message --- src/moodbar/moodbarloader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/moodbar/moodbarloader.cpp b/src/moodbar/moodbarloader.cpp index 5cfcd0102..bc1fc4f30 100644 --- a/src/moodbar/moodbarloader.cpp +++ b/src/moodbar/moodbarloader.cpp @@ -171,7 +171,7 @@ void MoodbarLoader::RequestFinished(MoodbarPipeline* request, const QUrl& url) { #ifdef Q_OS_WIN32 if (!SetFileAttributes((LPCTSTR)mood_filename.utf16(), FILE_ATTRIBUTE_HIDDEN)) { - qLog(Warning) << "Error changing hidden attribute for file" + qLog(Warning) << "Error setting hidden attribute for file" << mood_filename; } #endif From 47d667934e97d384946d3c96a47fd5059960dc87 Mon Sep 17 00:00:00 2001 From: Santi Date: Tue, 11 Aug 2015 15:15:26 -0300 Subject: [PATCH 3/3] Include windows.h --- src/moodbar/moodbarloader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/moodbar/moodbarloader.cpp b/src/moodbar/moodbarloader.cpp index bc1fc4f30..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)),