36 QString PathUtils::settingsFilename =
"";
51 QDir rootDir = QApplication::applicationDirPath();
53 const QString rootDirPath = rootDir.canonicalPath();
54 QString dataPath = rootDirPath;
55 dataPath += QLatin1Char(
'/');
56 dataPath += QLatin1String(GCS_DATA_BASENAME);
57 dataPath += QLatin1Char(
'/');
71 QString goodPath = QDir::fromNativeSeparators(path);
74 return QString(
"%%DATAPATH%%") + goodPath.right(i);
86 if (path.startsWith(QString(
"%%DATAPATH%%")))
89 newPath += path.right(path.length()-12);
90 return QDir::toNativeSeparators(newPath);
92 return QDir::toNativeSeparators(path);
106 QSettings set(
XmlConfig::XmlSettingsFormat, QSettings::UserScope,QLatin1String(GCS_PROJECT_BRANDING), QLatin1String(GCS_PROJECT_BRANDING
"_config"));
107 f.setFile(set.fileName());
109 QDir dir(f.absoluteDir());
111 const QString homeDirPath = dir.canonicalPath();
112 QString storagePath = homeDirPath;
113 storagePath += QLatin1Char(
'/');
124 QString goodPath = QDir::fromNativeSeparators(path);
127 return QString(
"%%STOREPATH%%") + goodPath.right(i);
137 if (path.startsWith(QString(
"%%STOREPATH%%")))
140 newPath += path.right(path.length()-13);
141 return QDir::toNativeSeparators(newPath);
143 return QDir::toNativeSeparators(path);
149 return PathUtils::settingsFilename;
154 PathUtils::settingsFilename = filename;
void setSettingsFilename(QString filename)
QString getSettingsFilename()
static QString GetDataPath()
QString RemoveStoragePath(QString path)
static QString RemoveDataPath(QString path)
static const QSettings::Format XmlSettingsFormat
QString InsertStoragePath(QString path)
static QString InsertDataPath(QString path)