From be93bb643b60809b03901ee63cff732cef492698 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 25 Jul 2024 10:28:39 +0200 Subject: [PATCH] Core: Use AppInfo.Paths Change-Id: Ic4aff7e2b8957ab125560eefe1cff4d9df5ffd0a Reviewed-by: Eike Ziller --- src/plugins/coreplugin/icore.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 169c8dffd33..08d638ecdfb 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -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; } /*!