qad_locations
This commit is contained in:
@@ -17,21 +17,21 @@
|
||||
QString QAD::userPath(QAD::LocationType loc, QString name) {
|
||||
QString dir, ext;
|
||||
switch (loc) {
|
||||
case ctConfig: ext = ".conf"; break;
|
||||
case ctCache : ext = ".cache"; break;
|
||||
case ltConfig: ext = ".conf"; break;
|
||||
case ltCache : ext = ".cache"; break;
|
||||
}
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QStandardPaths::StandardLocation l = QStandardPaths::AppConfigLocation;
|
||||
switch (loc) {
|
||||
case ctConfig: l = QStandardPaths::AppConfigLocation; break;
|
||||
case ctCache : l = QStandardPaths::CacheLocation; break;
|
||||
case ltConfig: l = QStandardPaths::AppConfigLocation; break;
|
||||
case ltCache : l = QStandardPaths::CacheLocation; break;
|
||||
}
|
||||
dir = QStandardPaths::writableLocation(l);
|
||||
#else
|
||||
QDesktopServices::StandardLocation l = QDesktopServices::DataLocation;
|
||||
switch (loc) {
|
||||
case ctConfig: l = QDesktopServices::DataLocation; break;
|
||||
case ctCache : l = QDesktopServices::CacheLocation; break;
|
||||
case ltConfig: l = QDesktopServices::DataLocation; break;
|
||||
case ltCache : l = QDesktopServices::CacheLocation; break;
|
||||
}
|
||||
dir = QDesktopServices::storageLocation(l);
|
||||
#endif
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
namespace QAD {
|
||||
|
||||
enum QAD_EXPORT LocationType {
|
||||
ctConfig,
|
||||
ctCache,
|
||||
ltConfig,
|
||||
ltCache,
|
||||
};
|
||||
|
||||
//! Create QStandardPaths::writableLocation(<loc>) directory
|
||||
|
||||
Reference in New Issue
Block a user