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 {
|
||||
|
||||
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)
|
||||
{
|
||||
if (target) {
|
||||
@@ -114,7 +107,7 @@ QmlProject::QmlProject(const Utils::FilePath &fileName)
|
||||
setNeedsBuildConfigurations(false);
|
||||
setBuildSystemCreator([](Target *t) { return new QmlBuildSystem(t); });
|
||||
|
||||
if (!isQtDesignStudio()) {
|
||||
if (!QmlProject::isQtDesignStudio()) {
|
||||
if (QmlProjectPlugin::qdsInstallationExists()) {
|
||||
auto lambda = [fileName]() {
|
||||
if (Core::ICore::infoBar()->canInfoBeAdded(openInQDSAppSetting)) {
|
||||
@@ -484,7 +477,7 @@ Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *erro
|
||||
addTargetForKit(kits.first());
|
||||
}
|
||||
|
||||
if (isQtDesignStudio()) {
|
||||
if (QmlProject::isQtDesignStudio()) {
|
||||
auto setKitWithVersion = [&](int qtMajorVersion) {
|
||||
const QList<Kit *> qtVersionkits
|
||||
= Utils::filtered(kits, [qtMajorVersion](const Kit *k) {
|
||||
@@ -511,6 +504,14 @@ Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *erro
|
||||
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
|
||||
{
|
||||
return DeploymentKnowledge::Perfect;
|
||||
|
@@ -146,6 +146,8 @@ public:
|
||||
|
||||
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
|
||||
|
||||
static bool isQtDesignStudio();
|
||||
|
||||
protected:
|
||||
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
|
||||
|
||||
|
@@ -66,14 +66,6 @@ namespace Internal {
|
||||
|
||||
// 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
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(QmlProjectManager::QmlProjectRunConfiguration)
|
||||
@@ -252,7 +244,7 @@ QString QmlProjectRunConfiguration::commandLineArguments() const
|
||||
|
||||
void QmlProjectRunConfiguration::createQtVersionAspect()
|
||||
{
|
||||
if (!isQtDesignStudio())
|
||||
if (!QmlProject::isQtDesignStudio())
|
||||
return;
|
||||
|
||||
m_qtversionAspect = addAspect<SelectionAspect>();
|
||||
|
Reference in New Issue
Block a user