forked from qt-creator/qt-creator
Boot2Qt: Move Plugin class definition to .cpp
Change-Id: I9c3952e5ea1993888ccbd54a243392e2004d0b60 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -9,7 +9,7 @@ add_qtc_plugin(Boot2Qt
|
|||||||
qdbdevice.cpp qdbdevice.h
|
qdbdevice.cpp qdbdevice.h
|
||||||
qdbdevicedebugsupport.cpp qdbdevicedebugsupport.h
|
qdbdevicedebugsupport.cpp qdbdevicedebugsupport.h
|
||||||
qdbmakedefaultappstep.cpp qdbmakedefaultappstep.h
|
qdbmakedefaultappstep.cpp qdbmakedefaultappstep.h
|
||||||
qdbplugin.cpp qdbplugin.h
|
qdbplugin.cpp
|
||||||
qdbqtversion.cpp qdbqtversion.h
|
qdbqtversion.cpp qdbqtversion.h
|
||||||
qdbrunconfiguration.cpp qdbrunconfiguration.h
|
qdbrunconfiguration.cpp qdbrunconfiguration.h
|
||||||
qdbstopapplicationstep.cpp qdbstopapplicationstep.h
|
qdbstopapplicationstep.cpp qdbstopapplicationstep.h
|
||||||
|
@@ -28,7 +28,6 @@ QtcPlugin {
|
|||||||
"qdbmakedefaultappstep.cpp",
|
"qdbmakedefaultappstep.cpp",
|
||||||
"qdbmakedefaultappstep.h",
|
"qdbmakedefaultappstep.h",
|
||||||
"qdbplugin.cpp",
|
"qdbplugin.cpp",
|
||||||
"qdbplugin.h",
|
|
||||||
"qdbstopapplicationstep.cpp",
|
"qdbstopapplicationstep.cpp",
|
||||||
"qdbstopapplicationstep.h",
|
"qdbstopapplicationstep.h",
|
||||||
"qdbtr.h",
|
"qdbtr.h",
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
// Copyright (C) 2019 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "qdbplugin.h"
|
|
||||||
|
|
||||||
#include "device-detection/devicedetector.h"
|
#include "device-detection/devicedetector.h"
|
||||||
#include "qdbconstants.h"
|
#include "qdbconstants.h"
|
||||||
#include "qdbdevice.h"
|
#include "qdbdevice.h"
|
||||||
@@ -18,10 +16,10 @@
|
|||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <extensionsystem/iplugin.h>
|
||||||
|
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <projectexplorer/kitaspects.h>
|
|
||||||
#include <projectexplorer/kitmanager.h>
|
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
@@ -30,12 +28,9 @@
|
|||||||
|
|
||||||
#include <remotelinux/remotelinux_constants.h>
|
#include <remotelinux/remotelinux_constants.h>
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/process.h>
|
#include <utils/process.h>
|
||||||
|
|
||||||
#include <QAction>
|
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
@@ -124,10 +119,10 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class QdbPluginPrivate : public QObject
|
class QdbPluginPrivate final : public QObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void setupDeviceDetection();
|
void setupDeviceDetection() { m_deviceDetector.start(); }
|
||||||
|
|
||||||
QdbLinuxDeviceFactory m_qdbDeviceFactory;
|
QdbLinuxDeviceFactory m_qdbDeviceFactory;
|
||||||
QdbQtVersionFactory m_qtVersionFactory;
|
QdbQtVersionFactory m_qtVersionFactory;
|
||||||
@@ -153,39 +148,43 @@ public:
|
|||||||
DeviceDetector m_deviceDetector;
|
DeviceDetector m_deviceDetector;
|
||||||
};
|
};
|
||||||
|
|
||||||
QdbPlugin::~QdbPlugin()
|
class QdbPlugin final : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
delete d;
|
Q_OBJECT
|
||||||
}
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Boot2Qt.json")
|
||||||
|
|
||||||
void QdbPlugin::initialize()
|
public:
|
||||||
{
|
~QdbPlugin() final { delete d; }
|
||||||
d = new QdbPluginPrivate;
|
|
||||||
|
|
||||||
registerFlashAction(this);
|
private:
|
||||||
}
|
void initialize() final
|
||||||
|
{
|
||||||
|
d = new QdbPluginPrivate;
|
||||||
|
|
||||||
void QdbPlugin::extensionsInitialized()
|
registerFlashAction(this);
|
||||||
{
|
|
||||||
DeviceManager * const dm = DeviceManager::instance();
|
|
||||||
if (dm->isLoaded()) {
|
|
||||||
d->setupDeviceDetection();
|
|
||||||
} else {
|
|
||||||
connect(dm, &DeviceManager::devicesLoaded,
|
|
||||||
d, &QdbPluginPrivate::setupDeviceDetection);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ExtensionSystem::IPlugin::ShutdownFlag QdbPlugin::aboutToShutdown()
|
void extensionsInitialized() final
|
||||||
{
|
{
|
||||||
d->m_deviceDetector.stop();
|
DeviceManager * const dm = DeviceManager::instance();
|
||||||
|
if (dm->isLoaded()) {
|
||||||
|
d->setupDeviceDetection();
|
||||||
|
} else {
|
||||||
|
connect(dm, &DeviceManager::devicesLoaded,
|
||||||
|
d, &QdbPluginPrivate::setupDeviceDetection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return SynchronousShutdown;
|
ShutdownFlag aboutToShutdown() final
|
||||||
}
|
{
|
||||||
|
d->m_deviceDetector.stop();
|
||||||
|
|
||||||
void QdbPluginPrivate::setupDeviceDetection()
|
return SynchronousShutdown;
|
||||||
{
|
}
|
||||||
m_deviceDetector.start();
|
|
||||||
}
|
class QdbPluginPrivate *d = nullptr;
|
||||||
|
};
|
||||||
|
|
||||||
} // Qdb::Internal
|
} // Qdb::Internal
|
||||||
|
|
||||||
|
#include "qdbplugin.moc"
|
||||||
|
@@ -1,27 +0,0 @@
|
|||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <extensionsystem/iplugin.h>
|
|
||||||
|
|
||||||
namespace Qdb::Internal {
|
|
||||||
|
|
||||||
class QdbPlugin final : public ExtensionSystem::IPlugin
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Boot2Qt.json")
|
|
||||||
|
|
||||||
public:
|
|
||||||
QdbPlugin() = default;
|
|
||||||
~QdbPlugin() final;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void initialize() final;
|
|
||||||
void extensionsInitialized() final;
|
|
||||||
ShutdownFlag aboutToShutdown() final;
|
|
||||||
|
|
||||||
class QdbPluginPrivate *d = nullptr;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qdb::Internal
|
|
Reference in New Issue
Block a user