qad_locations

This commit is contained in:
2020-05-16 10:02:44 +03:00
parent 30d1faff9a
commit 9db04f5aa0
2 changed files with 8 additions and 8 deletions

View File

@@ -17,21 +17,21 @@
QString QAD::userPath(QAD::LocationType loc, QString name) { QString QAD::userPath(QAD::LocationType loc, QString name) {
QString dir, ext; QString dir, ext;
switch (loc) { switch (loc) {
case ctConfig: ext = ".conf"; break; case ltConfig: ext = ".conf"; break;
case ctCache : ext = ".cache"; break; case ltCache : ext = ".cache"; break;
} }
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
QStandardPaths::StandardLocation l = QStandardPaths::AppConfigLocation; QStandardPaths::StandardLocation l = QStandardPaths::AppConfigLocation;
switch (loc) { switch (loc) {
case ctConfig: l = QStandardPaths::AppConfigLocation; break; case ltConfig: l = QStandardPaths::AppConfigLocation; break;
case ctCache : l = QStandardPaths::CacheLocation; break; case ltCache : l = QStandardPaths::CacheLocation; break;
} }
dir = QStandardPaths::writableLocation(l); dir = QStandardPaths::writableLocation(l);
#else #else
QDesktopServices::StandardLocation l = QDesktopServices::DataLocation; QDesktopServices::StandardLocation l = QDesktopServices::DataLocation;
switch (loc) { switch (loc) {
case ctConfig: l = QDesktopServices::DataLocation; break; case ltConfig: l = QDesktopServices::DataLocation; break;
case ctCache : l = QDesktopServices::CacheLocation; break; case ltCache : l = QDesktopServices::CacheLocation; break;
} }
dir = QDesktopServices::storageLocation(l); dir = QDesktopServices::storageLocation(l);
#endif #endif

View File

@@ -27,8 +27,8 @@
namespace QAD { namespace QAD {
enum QAD_EXPORT LocationType { enum QAD_EXPORT LocationType {
ctConfig, ltConfig,
ctCache, ltCache,
}; };
//! Create QStandardPaths::writableLocation(<loc>) directory //! Create QStandardPaths::writableLocation(<loc>) directory