BareMetal: Dissolve BareMetalRunControlFactory

Less code.

Change-Id: Ie3bd75557e4f4b5acff65a9b3a074692ea652253
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
hjk
2017-07-07 18:49:26 +02:00
parent 82f8cb70e6
commit 0d06dbb5b2
5 changed files with 16 additions and 116 deletions

View File

@@ -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;
}