forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -147,6 +147,7 @@ public:
|
||||
ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final;
|
||||
|
||||
static bool isQtDesignStudio();
|
||||
static bool isQtDesignStudioStartedFromQtC();
|
||||
|
||||
bool isEditModePreferred() const override;
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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(
|
||||
|
Reference in New Issue
Block a user