Changeset View
Changeset View
Standalone View
Standalone View
src/private/standarddirs.cpp
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | |||||
105 | QString StandardDirs::saveDir(const char *resource, const QString &relPath) | 105 | QString StandardDirs::saveDir(const char *resource, const QString &relPath) | ||
106 | { | 106 | { | ||
107 | const QString fullRelPath = buildFullRelPath(resource, relPath); | 107 | const QString fullRelPath = buildFullRelPath(resource, relPath); | ||
108 | QString fullPath; | 108 | QString fullPath; | ||
109 | if (qstrncmp(resource, "config", 6) == 0) { | 109 | if (qstrncmp(resource, "config", 6) == 0) { | ||
110 | fullPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + fullRelPath; | 110 | fullPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + fullRelPath; | ||
111 | } else if (qstrncmp(resource, "data", 4) == 0) { | 111 | } else if (qstrncmp(resource, "data", 4) == 0) { | ||
112 | fullPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + fullRelPath; | 112 | fullPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + fullRelPath; | ||
113 | } else if (qstrncmp(resource, "runtime", 7) == 0) { | ||||
114 | fullPath = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) + fullRelPath; | ||||
113 | } else { | 115 | } else { | ||
114 | qt_assert_x(__FUNCTION__, "Invalid resource type", __FILE__, __LINE__); | 116 | qt_assert_x(__FUNCTION__, "Invalid resource type", __FILE__, __LINE__); | ||
115 | return {}; | 117 | return {}; | ||
116 | } | 118 | } | ||
117 | 119 | | |||
118 | // ensure directory exists or is created | 120 | // ensure directory exists or is created | ||
119 | QFileInfo fileInfo(fullPath); | 121 | QFileInfo fileInfo(fullPath); | ||
120 | if (fileInfo.exists()) { | 122 | if (fileInfo.exists()) { | ||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |