forked from qt-creator/qt-creator
Core: add ICore::isQtDesignStudio()
Change-Id: I3aed97b62abd05b283ac327be210af75f173383d Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -51,7 +51,7 @@ QmlProject::QmlProject(const Utils::FilePath &fileName)
|
||||
setNeedsBuildConfigurations(false);
|
||||
setBuildSystemCreator([](Target *t) { return new QmlBuildSystem(t); });
|
||||
|
||||
if (QmlProject::isQtDesignStudio()) {
|
||||
if (Core::ICore::isQtDesignStudio()) {
|
||||
if (allowOnlySingleProject()) {
|
||||
EditorManager::closeAllDocuments();
|
||||
ProjectManager::closeAllProjects();
|
||||
@@ -111,7 +111,7 @@ Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *erro
|
||||
|
||||
// FIXME: are there any other way?
|
||||
// What if it's not a Design Studio project? What should we do then?
|
||||
if (QmlProject::isQtDesignStudio()) {
|
||||
if (Core::ICore::isQtDesignStudio()) {
|
||||
int preferedVersion = preferedQtTarget(activeTarget());
|
||||
|
||||
setKitWithVersion(preferedVersion, kits);
|
||||
@@ -205,13 +205,6 @@ Tasks QmlProject::projectIssues(const Kit *k) const
|
||||
return result;
|
||||
}
|
||||
|
||||
bool QmlProject::isQtDesignStudio()
|
||||
{
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode";
|
||||
return settings->value(qdsStandaloneEntry, false).toBool();
|
||||
}
|
||||
|
||||
bool QmlProject::isQtDesignStudioStartedFromQtC()
|
||||
{
|
||||
return qEnvironmentVariableIsSet(Constants::enviromentLaunchedQDS);
|
||||
@@ -224,7 +217,7 @@ DeploymentKnowledge QmlProject::deploymentKnowledge() const
|
||||
|
||||
bool QmlProject::isEditModePreferred() const
|
||||
{
|
||||
return !isQtDesignStudio();
|
||||
return !Core::ICore::isQtDesignStudio();
|
||||
}
|
||||
|
||||
int QmlProject::preferedQtTarget(Target *target)
|
||||
@@ -238,7 +231,7 @@ int QmlProject::preferedQtTarget(Target *target)
|
||||
|
||||
bool QmlProject::allowOnlySingleProject()
|
||||
{
|
||||
QSettings *settings = Core::ICore::settings();
|
||||
auto settings = Core::ICore::settings();
|
||||
auto key = "QML/Designer/AllowMultipleProjects";
|
||||
return !settings->value(QString::fromUtf8(key), false).toBool();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user