forked from qt-creator/qt-creator
QmlProject: Add single isQtDesignStudio method
Change-Id: Idf9d07e6318af8d6934adcbc0afa3695e262836f Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -76,13 +76,6 @@ Q_LOGGING_CATEGORY(infoLogger, "QmlProjectManager.QmlBuildSystem", QtInfoMsg)
|
|||||||
|
|
||||||
namespace QmlProjectManager {
|
namespace QmlProjectManager {
|
||||||
|
|
||||||
static bool isQtDesignStudio()
|
|
||||||
{
|
|
||||||
QSettings *settings = Core::ICore::settings();
|
|
||||||
const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode"; //entry from qml settings
|
|
||||||
|
|
||||||
return settings->value(qdsStandaloneEntry, false).toBool();
|
|
||||||
}
|
|
||||||
static int preferedQtTarget(Target *target)
|
static int preferedQtTarget(Target *target)
|
||||||
{
|
{
|
||||||
if (target) {
|
if (target) {
|
||||||
@@ -114,7 +107,7 @@ QmlProject::QmlProject(const Utils::FilePath &fileName)
|
|||||||
setNeedsBuildConfigurations(false);
|
setNeedsBuildConfigurations(false);
|
||||||
setBuildSystemCreator([](Target *t) { return new QmlBuildSystem(t); });
|
setBuildSystemCreator([](Target *t) { return new QmlBuildSystem(t); });
|
||||||
|
|
||||||
if (!isQtDesignStudio()) {
|
if (!QmlProject::isQtDesignStudio()) {
|
||||||
if (QmlProjectPlugin::qdsInstallationExists()) {
|
if (QmlProjectPlugin::qdsInstallationExists()) {
|
||||||
auto lambda = [fileName]() {
|
auto lambda = [fileName]() {
|
||||||
if (Core::ICore::infoBar()->canInfoBeAdded(openInQDSAppSetting)) {
|
if (Core::ICore::infoBar()->canInfoBeAdded(openInQDSAppSetting)) {
|
||||||
@@ -484,7 +477,7 @@ Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *erro
|
|||||||
addTargetForKit(kits.first());
|
addTargetForKit(kits.first());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isQtDesignStudio()) {
|
if (QmlProject::isQtDesignStudio()) {
|
||||||
auto setKitWithVersion = [&](int qtMajorVersion) {
|
auto setKitWithVersion = [&](int qtMajorVersion) {
|
||||||
const QList<Kit *> qtVersionkits
|
const QList<Kit *> qtVersionkits
|
||||||
= Utils::filtered(kits, [qtMajorVersion](const Kit *k) {
|
= Utils::filtered(kits, [qtMajorVersion](const Kit *k) {
|
||||||
@@ -511,6 +504,14 @@ Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *erro
|
|||||||
return RestoreResult::Ok;
|
return RestoreResult::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QmlProject::isQtDesignStudio()
|
||||||
|
{
|
||||||
|
QSettings *settings = Core::ICore::settings();
|
||||||
|
const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode";
|
||||||
|
|
||||||
|
return settings->value(qdsStandaloneEntry, false).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
ProjectExplorer::DeploymentKnowledge QmlProject::deploymentKnowledge() const
|
ProjectExplorer::DeploymentKnowledge QmlProject::deploymentKnowledge() const
|
||||||
{
|
{
|
||||||
return DeploymentKnowledge::Perfect;
|
return DeploymentKnowledge::Perfect;
|
||||||
|
@@ -146,6 +146,8 @@ public:
|
|||||||
|
|
||||||
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
|
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
|
||||||
|
|
||||||
|
static bool isQtDesignStudio();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
||||||
|
|
||||||
|
@@ -66,14 +66,6 @@ namespace Internal {
|
|||||||
|
|
||||||
// QmlProjectRunConfiguration
|
// QmlProjectRunConfiguration
|
||||||
|
|
||||||
static bool isQtDesignStudio()
|
|
||||||
{
|
|
||||||
QSettings *settings = Core::ICore::settings();
|
|
||||||
const QString qdsStandaloneEntry = "QML/Designer/StandAloneMode"; //entry from qml settings
|
|
||||||
|
|
||||||
return settings->value(qdsStandaloneEntry, false).toBool();
|
|
||||||
}
|
|
||||||
|
|
||||||
class QmlProjectRunConfiguration final : public RunConfiguration
|
class QmlProjectRunConfiguration final : public RunConfiguration
|
||||||
{
|
{
|
||||||
Q_DECLARE_TR_FUNCTIONS(QmlProjectManager::QmlProjectRunConfiguration)
|
Q_DECLARE_TR_FUNCTIONS(QmlProjectManager::QmlProjectRunConfiguration)
|
||||||
@@ -252,7 +244,7 @@ QString QmlProjectRunConfiguration::commandLineArguments() const
|
|||||||
|
|
||||||
void QmlProjectRunConfiguration::createQtVersionAspect()
|
void QmlProjectRunConfiguration::createQtVersionAspect()
|
||||||
{
|
{
|
||||||
if (!isQtDesignStudio())
|
if (!QmlProject::isQtDesignStudio())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_qtversionAspect = addAspect<SelectionAspect>();
|
m_qtversionAspect = addAspect<SelectionAspect>();
|
||||||
|
Reference in New Issue
Block a user