Files
qt-creator/src/plugins/android/androidqmltoolingsupport.cpp
hjk 978639b995 Android: Use specific classes for run worker factories
Slimmer file interfaces.

Change-Id: I2cf846c04000eb29fe53219db9a97088b6b9a1aa
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-23 11:18:03 +00:00

46 lines
1.3 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "androidqmltoolingsupport.h"
#include "androidconstants.h"
#include "androidrunner.h"
using namespace ProjectExplorer;
namespace Android::Internal {
class AndroidQmlToolingSupport final : public RunWorker
{
public:
explicit AndroidQmlToolingSupport(RunControl *runControl) : RunWorker(runControl)
{
setId("AndroidQmlToolingSupport");
auto runner = new AndroidRunner(runControl, {});
addStartDependency(runner);
auto worker = runControl->createWorker(QmlDebug::runnerIdForRunMode(runControl->runMode()));
worker->addStartDependency(this);
connect(runner, &AndroidRunner::qmlServerReady, this, [this, worker](const QUrl &server) {
worker->recordData("QmlServerUrl", server);
reportStarted();
});
}
private:
void start() override {}
void stop() override { reportStopped(); }
};
AndroidQmlToolingSupportFactory::AndroidQmlToolingSupportFactory()
{
setProduct<AndroidQmlToolingSupport>();
addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
addSupportedRunConfig(Constants::ANDROID_RUNCONFIG_ID);
}
} // Android::Internal