diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-02-22 16:33:53 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-02-22 16:59:38 +0000 |
commit | dfd9d4804e3514b5e7776c0b7fe97587bcecb20c (patch) | |
tree | 0cdeb0ec927ad91fc34c0a919468ed4cbae8558d | |
parent | c1c0dab2a9f5eded6fbec9e5adebf27a0bed6fbd (diff) | |
download | qt-creator-dfd9d4804e3514b5e7776c0b7fe97587bcecb20c.tar.gz |
QmlDesigner: Track if QDS was opened from QtC
Task-number: QDS-6315
Change-Id: I4109e9c98ff5c27b4096b1af32ae945aec10c123
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
-rw-r--r-- | src/plugins/qmldesigner/qmldesignerplugin.cpp | 5 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlproject.cpp | 5 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlproject.h | 1 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectconstants.h | 2 | ||||
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlprojectplugin.cpp | 2 |
5 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index 3748a2164e..fafbce3809 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -312,8 +312,11 @@ bool QmlDesignerPlugin::delayedInitialize() d->viewManager.registerFormEditorTool(std::make_unique<QmlDesigner::PathTool>()); d->viewManager.registerFormEditorTool(std::make_unique<QmlDesigner::TransitionTool>()); - if (QmlProjectManager::QmlProject::isQtDesignStudio()) + if (QmlProjectManager::QmlProject::isQtDesignStudio()) { emitUsageStatistics("StandaloneMode"); + if (QmlProjectManager::QmlProject::isQtDesignStudioStartedFromQtC()) + emitUsageStatistics("QDSlaunchedFromQtC"); + } return true; } diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index e96dadb970..9191106ed4 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -517,6 +517,11 @@ bool QmlProject::isQtDesignStudio() return settings->value(qdsStandaloneEntry, false).toBool(); } +bool QmlProject::isQtDesignStudioStartedFromQtC() +{ + return qEnvironmentVariableIsSet(Constants::enviromentLaunchedQDS); +} + ProjectExplorer::DeploymentKnowledge QmlProject::deploymentKnowledge() const { return DeploymentKnowledge::Perfect; diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index a351d394c7..fed2002912 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -147,6 +147,7 @@ public: ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final; static bool isQtDesignStudio(); + static bool isQtDesignStudioStartedFromQtC(); bool isEditModePreferred() const override; diff --git a/src/plugins/qmlprojectmanager/qmlprojectconstants.h b/src/plugins/qmlprojectmanager/qmlprojectconstants.h index 184469f243..3ba2b10146 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectconstants.h +++ b/src/plugins/qmlprojectmanager/qmlprojectconstants.h @@ -41,5 +41,7 @@ const char customQt6Project[] = "CustomQt6Project"; const char mainFilePath[] = "MainFilePath"; const char customImportPaths[] = "CustomImportPaths"; const char canonicalProjectDir[] ="CanonicalProjectDir"; + +const char enviromentLaunchedQDS[] = "QTC_LAUNCHED_QDS"; } // namespace Constants } // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp index 2922c55aea..17cce6402f 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectplugin.cpp @@ -25,6 +25,7 @@ #include "qmlprojectplugin.h" #include "qmlproject.h" +#include "qmlprojectconstants.h" #include "qmlprojectrunconfiguration.h" #include <coreplugin/editormanager/editormanager.h> @@ -105,6 +106,7 @@ void QmlProjectPlugin::openQDS(const Utils::FilePath &fileName) { const Utils::FilePath &qdsPath = QmlProjectPlugin::qdsInstallationEntry(); bool qdsStarted = false; + qputenv(Constants::enviromentLaunchedQDS, "true"); //-a and -client arguments help to append project to open design studio application if (Utils::HostOsInfo::isMacHost()) qdsStarted = Utils::QtcProcess::startDetached( |