QmlDesigner: Track if QDS was opened from QtC

Task-number: QDS-6315
Change-Id: I4109e9c98ff5c27b4096b1af32ae945aec10c123
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
Thomas Hartmann
2022-02-22 16:33:53 +01:00
parent c1c0dab2a9
commit dfd9d4804e
5 changed files with 14 additions and 1 deletions

View File

@@ -312,8 +312,11 @@ bool QmlDesignerPlugin::delayedInitialize()
d->viewManager.registerFormEditorTool(std::make_unique<QmlDesigner::PathTool>()); d->viewManager.registerFormEditorTool(std::make_unique<QmlDesigner::PathTool>());
d->viewManager.registerFormEditorTool(std::make_unique<QmlDesigner::TransitionTool>()); d->viewManager.registerFormEditorTool(std::make_unique<QmlDesigner::TransitionTool>());
if (QmlProjectManager::QmlProject::isQtDesignStudio()) if (QmlProjectManager::QmlProject::isQtDesignStudio()) {
emitUsageStatistics("StandaloneMode"); emitUsageStatistics("StandaloneMode");
if (QmlProjectManager::QmlProject::isQtDesignStudioStartedFromQtC())
emitUsageStatistics("QDSlaunchedFromQtC");
}
return true; return true;
} }

View File

@@ -517,6 +517,11 @@ bool QmlProject::isQtDesignStudio()
return settings->value(qdsStandaloneEntry, false).toBool(); return settings->value(qdsStandaloneEntry, false).toBool();
} }
bool QmlProject::isQtDesignStudioStartedFromQtC()
{
return qEnvironmentVariableIsSet(Constants::enviromentLaunchedQDS);
}
ProjectExplorer::DeploymentKnowledge QmlProject::deploymentKnowledge() const ProjectExplorer::DeploymentKnowledge QmlProject::deploymentKnowledge() const
{ {
return DeploymentKnowledge::Perfect; return DeploymentKnowledge::Perfect;

View File

@@ -147,6 +147,7 @@ public:
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final; ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
static bool isQtDesignStudio(); static bool isQtDesignStudio();
static bool isQtDesignStudioStartedFromQtC();
bool isEditModePreferred() const override; bool isEditModePreferred() const override;

View File

@@ -41,5 +41,7 @@ const char customQt6Project[] = "CustomQt6Project";
const char mainFilePath[] = "MainFilePath"; const char mainFilePath[] = "MainFilePath";
const char customImportPaths[] = "CustomImportPaths"; const char customImportPaths[] = "CustomImportPaths";
const char canonicalProjectDir[] ="CanonicalProjectDir"; const char canonicalProjectDir[] ="CanonicalProjectDir";
const char enviromentLaunchedQDS[] = "QTC_LAUNCHED_QDS";
} // namespace Constants } // namespace Constants
} // namespace QmlProjectManager } // namespace QmlProjectManager

View File

@@ -25,6 +25,7 @@
#include "qmlprojectplugin.h" #include "qmlprojectplugin.h"
#include "qmlproject.h" #include "qmlproject.h"
#include "qmlprojectconstants.h"
#include "qmlprojectrunconfiguration.h" #include "qmlprojectrunconfiguration.h"
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
@@ -105,6 +106,7 @@ void QmlProjectPlugin::openQDS(const Utils::FilePath &fileName)
{ {
const Utils::FilePath &qdsPath = QmlProjectPlugin::qdsInstallationEntry(); const Utils::FilePath &qdsPath = QmlProjectPlugin::qdsInstallationEntry();
bool qdsStarted = false; bool qdsStarted = false;
qputenv(Constants::enviromentLaunchedQDS, "true");
//-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())
qdsStarted = Utils::QtcProcess::startDetached( qdsStarted = Utils::QtcProcess::startDetached(