forked from qt-creator/qt-creator
BareMetal: Dissolve BareMetalRunControlFactory
Less code. Change-Id: Ie3bd75557e4f4b5acff65a9b3a074692ea652253 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -27,7 +27,8 @@
|
||||
#include "baremetalplugin.h"
|
||||
#include "baremetalconstants.h"
|
||||
#include "baremetaldeviceconfigurationfactory.h"
|
||||
#include "baremetalruncontrolfactory.h"
|
||||
#include "baremetaldebugsupport.h"
|
||||
#include "baremetalrunconfiguration.h"
|
||||
#include "baremetalrunconfigurationfactory.h"
|
||||
|
||||
#include "gdbserverproviderssettingspage.h"
|
||||
@@ -46,6 +47,8 @@
|
||||
#include <QMenu>
|
||||
#include <QtPlugin>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace BareMetal {
|
||||
namespace Internal {
|
||||
|
||||
@@ -64,11 +67,22 @@ bool BareMetalPlugin::initialize(const QStringList &arguments, QString *errorStr
|
||||
Q_UNUSED(errorString)
|
||||
|
||||
addAutoReleasedObject(new BareMetalDeviceConfigurationFactory);
|
||||
addAutoReleasedObject(new BareMetalRunControlFactory);
|
||||
addAutoReleasedObject(new BareMetalRunConfigurationFactory);
|
||||
addAutoReleasedObject(new GdbServerProvidersSettingsPage);
|
||||
addAutoReleasedObject(new GdbServerProviderManager);
|
||||
|
||||
auto constraint = [](RunConfiguration *runConfig) {
|
||||
const QByteArray idStr = runConfig->id().name();
|
||||
return runConfig->isEnabled() && idStr.startsWith(BareMetalRunConfiguration::IdPrefix);
|
||||
};
|
||||
|
||||
RunControl::registerWorker<BareMetalDebugSupport>
|
||||
(ProjectExplorer::Constants::NORMAL_RUN_MODE, constraint);
|
||||
RunControl::registerWorker<BareMetalDebugSupport>
|
||||
(ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint);
|
||||
RunControl::registerWorker<BareMetalDebugSupport>
|
||||
(ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN, constraint);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user