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
|
||||
qdbdevicedebugsupport.cpp qdbdevicedebugsupport.h
|
||||
qdbmakedefaultappstep.cpp qdbmakedefaultappstep.h
|
||||
qdbplugin.cpp qdbplugin.h
|
||||
qdbplugin.cpp
|
||||
qdbqtversion.cpp qdbqtversion.h
|
||||
qdbrunconfiguration.cpp qdbrunconfiguration.h
|
||||
qdbstopapplicationstep.cpp qdbstopapplicationstep.h
|
||||
|
@@ -28,7 +28,6 @@ QtcPlugin {
|
||||
"qdbmakedefaultappstep.cpp",
|
||||
"qdbmakedefaultappstep.h",
|
||||
"qdbplugin.cpp",
|
||||
"qdbplugin.h",
|
||||
"qdbstopapplicationstep.cpp",
|
||||
"qdbstopapplicationstep.h",
|
||||
"qdbtr.h",
|
||||
|
@@ -1,8 +1,6 @@
|
||||
// Copyright (C) 2019 The Qt Company Ltd.
|
||||
// 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 "qdbconstants.h"
|
||||
#include "qdbdevice.h"
|
||||
@@ -18,10 +16,10 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||
#include <projectexplorer/kitaspects.h>
|
||||
#include <projectexplorer/kitmanager.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -30,12 +28,9 @@
|
||||
|
||||
#include <remotelinux/remotelinux_constants.h>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/process.h>
|
||||
|
||||
#include <QAction>
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -124,10 +119,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class QdbPluginPrivate : public QObject
|
||||
class QdbPluginPrivate final : public QObject
|
||||
{
|
||||
public:
|
||||
void setupDeviceDetection();
|
||||
void setupDeviceDetection() { m_deviceDetector.start(); }
|
||||
|
||||
QdbLinuxDeviceFactory m_qdbDeviceFactory;
|
||||
QdbQtVersionFactory m_qtVersionFactory;
|
||||
@@ -153,19 +148,23 @@ public:
|
||||
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; }
|
||||
|
||||
private:
|
||||
void initialize() final
|
||||
{
|
||||
d = new QdbPluginPrivate;
|
||||
|
||||
registerFlashAction(this);
|
||||
}
|
||||
|
||||
void QdbPlugin::extensionsInitialized()
|
||||
void extensionsInitialized() final
|
||||
{
|
||||
DeviceManager * const dm = DeviceManager::instance();
|
||||
if (dm->isLoaded()) {
|
||||
@@ -176,16 +175,16 @@ void QdbPlugin::extensionsInitialized()
|
||||
}
|
||||
}
|
||||
|
||||
ExtensionSystem::IPlugin::ShutdownFlag QdbPlugin::aboutToShutdown()
|
||||
ShutdownFlag aboutToShutdown() final
|
||||
{
|
||||
d->m_deviceDetector.stop();
|
||||
|
||||
return SynchronousShutdown;
|
||||
}
|
||||
|
||||
void QdbPluginPrivate::setupDeviceDetection()
|
||||
{
|
||||
m_deviceDetector.start();
|
||||
}
|
||||
class QdbPluginPrivate *d = nullptr;
|
||||
};
|
||||
|
||||
} // 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