# HG changeset patch # User Chris Cannam # Date 1410291427 -3600 # Node ID f161ca450050b87bf8c3cd88041332f1aead1698 # Parent c6f2b93a7d52feb143f99dc68395599076012769 Use QStandardPaths::writableLocation(DataLocation) instead of synthesising path ourselves (hopefully fixing encoding difficulties on Windows) diff -r c6f2b93a7d52 -r f161ca450050 base/ResourceFinder.cpp --- a/base/ResourceFinder.cpp Tue Sep 09 16:52:24 2014 +0100 +++ b/base/ResourceFinder.cpp Tue Sep 09 20:37:07 2014 +0100 @@ -27,6 +27,10 @@ #include #include +#if QT_VERSION >= 0x050000 +#include +#endif + #include #include @@ -91,7 +95,12 @@ QString ResourceFinder::getUserResourcePrefix() { +#if QT_VERSION >= 0x050000 + QString loc = QStandardPaths::writableLocation(QStandardPaths::DataLocation); + return loc; +#else #ifdef Q_OS_WIN32 + // This does not work correctly for non-ASCII home directory names char *homedrive = getenv("HOMEDRIVE"); char *homepath = getenv("HOMEPATH"); QString home; @@ -114,7 +123,8 @@ .arg(home) .arg(qApp->applicationName()); #endif -#endif +#endif +#endif } QStringList