# HG changeset patch # User Chris Cannam # Date 1488792849 0 # Node ID e1926cba940c31f24989bf6862c75d039ec21bd6 # Parent b0533d195c83658a172fa888bd4ff1bd5d2f2268 Support pre-5.4 Qt builds. Also, don't use SVDEBUG in here, because it depends on this class! diff -r b0533d195c83 -r e1926cba940c base/ResourceFinder.cpp --- a/base/ResourceFinder.cpp Sun Mar 05 21:51:10 2017 +0000 +++ b/base/ResourceFinder.cpp Mon Mar 06 09:34:09 2017 +0000 @@ -133,14 +133,22 @@ } #if QT_VERSION >= 0x050000 + // This is expected to be much more reliable than // getOldStyleUserResourcePrefix(), but it returns a different // directory because it includes the organisation name (which is // fair enough). Hence migrateOldStyleResources() which moves // across any resources found in the old-style path the first time // we look for the new-style one +#if QT_VERSION >= 0x050400 return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); #else + cerr << "WARNING: ResourceFinder::getOldStyleUserResourcePrefix: Building with older version of Qt (pre 5.4), resource location may be incompatible with future versions" << endl; + return QStandardPaths::writableLocation(QStandardPaths::DataLocation); +#endif + +#else + cerr << "WARNING: ResourceFinder::getOldStyleUserResourcePrefix: Building with very old version of Qt (pre 5.0?), resource location may be incompatible with future versions" << endl; return getOldStyleUserResourcePrefix(); #endif } @@ -239,12 +247,12 @@ QString prefix = *i; - SVDEBUG << "ResourceFinder::getResourcePath: Looking up file \"" << fileName << "\" for category \"" << resourceCat << "\" in prefix \"" << prefix << "\"" << endl; +// cerr << "ResourceFinder::getResourcePath: Looking up file \"" << fileName << "\" for category \"" << resourceCat << "\" in prefix \"" << prefix << "\"" << endl; QString path = QString("%1%2/%3").arg(prefix).arg(resourceCat).arg(fileName); if (QFileInfo(path).exists() && QFileInfo(path).isReadable()) { - cerr << "Found it!" << endl; +// cerr << "Found it!" << endl; return path; } }