forked from qt-creator/qt-creator
Core: Use AppInfo.Paths
Change-Id: Ic4aff7e2b8957ab125560eefe1cff4d9df5ffd0a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -613,9 +613,7 @@ static QString pathHelper(const QString &rel)
|
||||
*/
|
||||
FilePath ICore::resourcePath(const QString &rel)
|
||||
{
|
||||
return FilePath::fromString(
|
||||
QDir::cleanPath(QCoreApplication::applicationDirPath() + '/' + RELATIVE_DATA_PATH))
|
||||
/ rel;
|
||||
return appInfo().resources / rel;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -630,17 +628,7 @@ FilePath ICore::resourcePath(const QString &rel)
|
||||
|
||||
FilePath ICore::userResourcePath(const QString &rel)
|
||||
{
|
||||
// Create qtcreator dir if it doesn't yet exist
|
||||
const QString configDir = QFileInfo(settings(QSettings::UserScope)->fileName()).path();
|
||||
const QString urp = configDir + '/' + appInfo().id;
|
||||
|
||||
if (!QFileInfo::exists(urp + QLatin1Char('/'))) {
|
||||
QDir dir;
|
||||
if (!dir.mkpath(urp))
|
||||
qWarning() << "could not create" << urp;
|
||||
}
|
||||
|
||||
return FilePath::fromString(urp + pathHelper(rel));
|
||||
return appInfo().userResources / rel;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Reference in New Issue
Block a user