QmlProject: Use fromUserInput for settings

Change-Id: Ib591c703e8badc2f12337680a788c051e1a7d974
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Thomas Hartmann
2021-11-17 10:03:50 +01:00
parent be9f7313b6
commit dad7deccc4
2 changed files with 5 additions and 5 deletions

View File

@@ -91,7 +91,7 @@ QmlProjectPlugin::~QmlProjectPlugin()
void QmlProjectPlugin::openQDS(const Utils::FilePath &fileName) void QmlProjectPlugin::openQDS(const Utils::FilePath &fileName)
{ {
const QString &qdsPath = QmlProjectPlugin::qdsInstallationEntry(); const QString &qdsPath = QmlProjectPlugin::qdsInstallationEntry().toString();
bool qdsStarted = false; bool qdsStarted = false;
//-a and -client arguments help to append project to open design studio application //-a and -client arguments help to append project to open design studio application
if (Utils::HostOsInfo::isMacHost()) if (Utils::HostOsInfo::isMacHost())
@@ -106,17 +106,17 @@ void QmlProjectPlugin::openQDS(const Utils::FilePath &fileName)
} }
} }
QString QmlProjectPlugin::qdsInstallationEntry() Utils::FilePath QmlProjectPlugin::qdsInstallationEntry()
{ {
QSettings *settings = Core::ICore::settings(); QSettings *settings = Core::ICore::settings();
const QString qdsInstallationEntry = "QML/Designer/DesignStudioInstallation"; //set in installer const QString qdsInstallationEntry = "QML/Designer/DesignStudioInstallation"; //set in installer
return settings->value(qdsInstallationEntry).toString(); return Utils::FilePath::fromUserInput(settings->value(qdsInstallationEntry).toString());
} }
bool QmlProjectPlugin::qdsInstallationExists() bool QmlProjectPlugin::qdsInstallationExists()
{ {
return Utils::FilePath::fromString(qdsInstallationEntry()).exists(); return qdsInstallationEntry().exists();
} }
Utils::FilePath findQmlProject(const Utils::FilePath &folder) Utils::FilePath findQmlProject(const Utils::FilePath &folder)

View File

@@ -41,7 +41,7 @@ public:
~QmlProjectPlugin() final; ~QmlProjectPlugin() final;
static void openQDS(const Utils::FilePath &fileName); static void openQDS(const Utils::FilePath &fileName);
static QString qdsInstallationEntry(); static Utils::FilePath qdsInstallationEntry();
static bool qdsInstallationExists(); static bool qdsInstallationExists();
private: private: