Commit ad58c2bb authored by hjk's avatar hjk

BuildManager: apply 'static' pattern

Change-Id: I00bb591c027a22088d5f1feedc84aa28523dcca2
Reviewed-by: default avatarDavid Schulz <david.schulz@digia.com>
parent e5c7ac61
......@@ -55,6 +55,7 @@
namespace Android {
namespace Internal {
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
///////////////////////////// CheckModel /////////////////////////////
......@@ -251,10 +252,9 @@ void AndroidPackageCreationWidget::setTargetSDK(const QString &sdk)
qs->setForced(true);
ProjectExplorer::BuildManager *bm = ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager();
bm->buildList(bc->stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)),
ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)));
bm->appendStep(qs, ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)));
BuildManager::buildList(bc->stepList(ProjectExplorer::Constants::BUILDSTEPS_CLEAN),
ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
BuildManager::appendStep(qs, ProjectExplorerPlugin::displayNameForStepId(ProjectExplorer::Constants::BUILDSTEPS_CLEAN));
bc->setSubNodeBuild(0);
// Make the buildconfiguration emit a evironmentChanged() signal
// TODO find a better way
......
......@@ -3490,8 +3490,7 @@ void DebuggerPluginPrivate::testProjectEvaluated()
QString fileName = m_testProject->projectFilePath();
QVERIFY(!fileName.isEmpty());
qWarning("Project %s loaded", qPrintable(fileName));
connect(ProjectExplorerPlugin::instance()->buildManager(),
SIGNAL(buildQueueFinished(bool)),
connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)),
SLOT(testProjectBuilt(bool)));
ProjectExplorerPlugin::instance()->buildProject(m_testProject);
}
......
......@@ -111,9 +111,15 @@ BuildManagerPrivate::BuildManagerPrivate() :
{
}
static BuildManagerPrivate *d = 0;
static BuildManager *m_instance = 0;
BuildManager::BuildManager(QObject *parent, QAction *cancelBuildAction)
: QObject(parent), d(new BuildManagerPrivate)
: QObject(parent)
{
m_instance = this;
d = new BuildManagerPrivate;
connect(&d->m_watcher, SIGNAL(finished()),
this, SLOT(nextBuildQueue()));
......@@ -148,6 +154,11 @@ BuildManager::BuildManager(QObject *parent, QAction *cancelBuildAction)
this, SLOT(finish()));
}
QObject *BuildManager::instance()
{
return m_instance;
}
void BuildManager::extensionsInitialized()
{
TaskHub::addCategory(Constants::TASK_CATEGORY_COMPILE,
......@@ -161,6 +172,7 @@ void BuildManager::extensionsInitialized()
BuildManager::~BuildManager()
{
cancel();
m_instance = 0;
ExtensionSystem::PluginManager::removeObject(d->m_taskWindow);
delete d->m_taskWindow;
......@@ -170,7 +182,7 @@ BuildManager::~BuildManager()
delete d;
}
void BuildManager::aboutToRemoveProject(ProjectExplorer::Project *p)
void BuildManager::aboutToRemoveProject(Project *p)
{
QHash<Project *, int>::iterator it = d->m_activeBuildSteps.find(p);
QHash<Project *, int>::iterator end = d->m_activeBuildSteps.end();
......@@ -182,13 +194,13 @@ void BuildManager::aboutToRemoveProject(ProjectExplorer::Project *p)
}
}
bool BuildManager::isBuilding() const
bool BuildManager::isBuilding()
{
// we are building even if we are not running yet
return !d->m_buildQueue.isEmpty() || d->m_running;
}
int BuildManager::getErrorTaskCount() const
int BuildManager::getErrorTaskCount()
{
const int errors =
d->m_taskWindow->errorTaskCount(Constants::TASK_CATEGORY_BUILDSYSTEM)
......@@ -213,7 +225,7 @@ void BuildManager::updateTaskCount()
{
const int errors = getErrorTaskCount();
ProgressManager::setApplicationLabel(errors > 0 ? QString::number(errors) : QString());
emit tasksChanged();
emit m_instance->tasksChanged();
}
void BuildManager::finish()
......@@ -254,7 +266,7 @@ void BuildManager::clearBuildQueue()
d->m_futureProgress = 0;
d->m_maxProgress = 0;
emit buildQueueFinished(false);
emit m_instance->buildQueueFinished(false);
}
......@@ -273,7 +285,7 @@ void BuildManager::toggleTaskWindow()
d->m_taskWindow->toggle(IOutputPane::ModeSwitch);
}
bool BuildManager::tasksAvailable() const
bool BuildManager::tasksAvailable()
{
const int count =
d->m_taskWindow->taskCount(Constants::TASK_CATEGORY_BUILDSYSTEM)
......@@ -285,7 +297,7 @@ bool BuildManager::tasksAvailable() const
void BuildManager::startBuildQueue(const QStringList &preambleMessage)
{
if (d->m_buildQueue.isEmpty()) {
emit buildQueueFinished(true);
emit m_instance->buildQueueFinished(true);
return;
}
if (!d->m_running) {
......@@ -302,7 +314,7 @@ void BuildManager::startBuildQueue(const QStringList &preambleMessage)
d->m_futureProgress = ProgressManager::addTask(d->m_progressFutureInterface->future(),
QString(), "ProjectExplorer.Task.Build",
ProgressManager::KeepOnFinish | ProgressManager::ShowInApplicationIcon);
connect(d->m_futureProgress.data(), SIGNAL(clicked()), this, SLOT(showBuildResults()));
connect(d->m_futureProgress.data(), SIGNAL(clicked()), m_instance, SLOT(showBuildResults()));
d->m_futureProgress.data()->setWidget(new Internal::BuildProgress(d->m_taskWindow));
d->m_futureProgress.data()->setStatusBarWidget(new Internal::BuildProgress(d->m_taskWindow,
Qt::Horizontal));
......@@ -352,7 +364,7 @@ void BuildManager::addToOutputWindow(const QString &string, BuildStep::OutputFor
void BuildManager::buildStepFinishedAsync()
{
disconnect(d->m_currentBuildStep, SIGNAL(finished()),
this, SLOT(buildStepFinishedAsync()));
m_instance, SLOT(buildStepFinishedAsync()));
d->m_futureInterfaceForAysnc = QFutureInterface<bool>();
nextBuildQueue();
}
......@@ -361,7 +373,7 @@ void BuildManager::nextBuildQueue()
{
if (d->m_canceling) {
d->m_canceling = false;
QTimer::singleShot(0, this, SLOT(emitCancelMessage()));
QTimer::singleShot(0, m_instance, SLOT(emitCancelMessage()));
disconnectOutput(d->m_currentBuildStep);
decrementActiveBuildSteps(d->m_currentBuildStep);
......@@ -443,7 +455,7 @@ void BuildManager::nextStep()
if (d->m_currentBuildStep->runInGuiThread()) {
connect (d->m_currentBuildStep, SIGNAL(finished()),
this, SLOT(buildStepFinishedAsync()));
m_instance, SLOT(buildStepFinishedAsync()));
d->m_watcher.setFuture(d->m_futureInterfaceForAysnc.future());
d->m_currentBuildStep->run(d->m_futureInterfaceForAysnc);
} else {
......@@ -458,7 +470,7 @@ void BuildManager::nextStep()
delete d->m_progressFutureInterface;
d->m_progressFutureInterface = 0;
d->m_maxProgress = 0;
emit buildQueueFinished(true);
emit m_instance->buildQueueFinished(true);
}
}
......@@ -471,9 +483,9 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps, QStringList names)
for (; i < count; ++i) {
BuildStep *bs = steps.at(i);
connect(bs, SIGNAL(addTask(ProjectExplorer::Task)),
this, SLOT(addToTaskWindow(ProjectExplorer::Task)));
m_instance, SLOT(addToTaskWindow(ProjectExplorer::Task)));
connect(bs, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat,ProjectExplorer::BuildStep::OutputNewlineSetting)),
this, SLOT(addToOutputWindow(QString,ProjectExplorer::BuildStep::OutputFormat,ProjectExplorer::BuildStep::OutputNewlineSetting)));
m_instance, SLOT(addToOutputWindow(QString,ProjectExplorer::BuildStep::OutputFormat,ProjectExplorer::BuildStep::OutputNewlineSetting)));
if (bs->enabled()) {
init = bs->init();
if (!init)
......@@ -616,7 +628,7 @@ void BuildManager::incrementActiveBuildSteps(BuildStep *bs)
increment<ProjectConfiguration>(d->m_activeBuildStepsPerProjectConfiguration, bs->projectConfiguration());
increment<Target>(d->m_activeBuildStepsPerTarget, bs->target());
if (increment<Project>(d->m_activeBuildSteps, bs->project()))
emit buildStateChanged(bs->project());
emit m_instance->buildStateChanged(bs->project());
}
void BuildManager::decrementActiveBuildSteps(BuildStep *bs)
......@@ -624,16 +636,16 @@ void BuildManager::decrementActiveBuildSteps(BuildStep *bs)
decrement<ProjectConfiguration>(d->m_activeBuildStepsPerProjectConfiguration, bs->projectConfiguration());
decrement<Target>(d->m_activeBuildStepsPerTarget, bs->target());
if (decrement<Project>(d->m_activeBuildSteps, bs->project()))
emit buildStateChanged(bs->project());
emit m_instance->buildStateChanged(bs->project());
}
void BuildManager::disconnectOutput(BuildStep *bs)
{
disconnect(bs, SIGNAL(addTask(ProjectExplorer::Task)),
this, SLOT(addToTaskWindow(ProjectExplorer::Task)));
m_instance, SLOT(addToTaskWindow(ProjectExplorer::Task)));
disconnect(bs, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat,
ProjectExplorer::BuildStep::OutputNewlineSetting)),
this, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat,
m_instance, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat,
ProjectExplorer::BuildStep::OutputNewlineSetting)));
}
......
......@@ -37,47 +37,45 @@
#include <QStringList>
namespace ProjectExplorer {
class Task;
class ProjectExplorerPlugin;
class Project;
struct BuildManagerPrivate;
class PROJECTEXPLORER_EXPORT BuildManager : public QObject
{
Q_OBJECT
public:
explicit BuildManager(QObject *parent, QAction *cancelBuildAction);
virtual ~BuildManager();
~BuildManager();
static QObject *instance();
void extensionsInitialized();
static void extensionsInitialized();
bool isBuilding() const;
static bool isBuilding();
static bool tasksAvailable();
bool tasksAvailable() const;
bool buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames,
static bool buildLists(QList<BuildStepList *> bsls, const QStringList &stepListNames,
const QStringList &preambelMessage = QStringList());
bool buildList(BuildStepList *bsl, const QString &stepListName);
static bool buildList(BuildStepList *bsl, const QString &stepListName);
bool isBuilding(Project *p);
bool isBuilding(Target *t);
bool isBuilding(ProjectConfiguration *p);
bool isBuilding(BuildStep *step);
static bool isBuilding(Project *p);
static bool isBuilding(Target *t);
static bool isBuilding(ProjectConfiguration *p);
static bool isBuilding(BuildStep *step);
// Append any build step to the list of build steps (currently only used to add the QMakeStep)
void appendStep(BuildStep *step, const QString &name);
static void appendStep(BuildStep *step, const QString &name);
int getErrorTaskCount() const;
static int getErrorTaskCount();
public slots:
void cancel();
static void cancel();
// Shows without focus
void showTaskWindow();
void toggleTaskWindow();
void toggleOutputWindow();
void aboutToRemoveProject(ProjectExplorer::Project *p);
static void showTaskWindow();
static void toggleTaskWindow();
static void toggleOutputWindow();
static void aboutToRemoveProject(ProjectExplorer::Project *p);
signals:
void buildStateChanged(ProjectExplorer::Project *pro);
......@@ -87,30 +85,29 @@ signals:
void tasksCleared();
private slots:
void addToTaskWindow(const ProjectExplorer::Task &task);
void addToOutputWindow(const QString &string, ProjectExplorer::BuildStep::OutputFormat,
static void addToTaskWindow(const ProjectExplorer::Task &task);
static void addToOutputWindow(const QString &string, ProjectExplorer::BuildStep::OutputFormat,
ProjectExplorer::BuildStep::OutputNewlineSetting = BuildStep::DoAppendNewline);
void buildStepFinishedAsync();
void nextBuildQueue();
void progressChanged();
void progressTextChanged();
void emitCancelMessage();
void showBuildResults();
void updateTaskCount();
void finish();
static void buildStepFinishedAsync();
static void nextBuildQueue();
static void progressChanged();
static void progressTextChanged();
static void emitCancelMessage();
static void showBuildResults();
static void updateTaskCount();
static void finish();
private:
void startBuildQueue(const QStringList &preambleMessage = QStringList());
void nextStep();
void clearBuildQueue();
bool buildQueueAppend(QList<BuildStep *> steps, QStringList names);
void incrementActiveBuildSteps(BuildStep *bs);
void decrementActiveBuildSteps(BuildStep *bs);
void disconnectOutput(BuildStep *bs);
BuildManagerPrivate *d;
static void startBuildQueue(const QStringList &preambleMessage = QStringList());
static void nextStep();
static void clearBuildQueue();
static bool buildQueueAppend(QList<BuildStep *> steps, QStringList names);
static void incrementActiveBuildSteps(BuildStep *bs);
static void decrementActiveBuildSteps(BuildStep *bs);
static void disconnectOutput(BuildStep *bs);
};
} // namespace ProjectExplorer
#endif // BUILDMANAGER_H
......@@ -357,8 +357,7 @@ void BuildSettingsWidget::deleteConfiguration(BuildConfiguration *deleteConfigur
m_target->buildConfigurations().size() <= 1)
return;
ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager();
if (bm->isBuilding(deleteConfiguration)) {
if (BuildManager::isBuilding(deleteConfiguration)) {
QMessageBox box;
QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Remove Build Configuration"), QMessageBox::AcceptRole);
QPushButton *cancelClose = box.addButton(tr("Do Not Remove"), QMessageBox::RejectRole);
......@@ -369,7 +368,7 @@ void BuildSettingsWidget::deleteConfiguration(BuildConfiguration *deleteConfigur
box.exec();
if (box.clickedButton() != closeAnyway)
return;
bm->cancel();
BuildManager::cancel();
} else {
QMessageBox msgBox(QMessageBox::Question, tr("Remove Build Configuration?"),
tr("Do you really want to delete build configuration <b>%1</b>?").arg(deleteConfiguration->displayName()),
......
......@@ -184,10 +184,8 @@ void BuildStepList::insertStep(int position, BuildStep *step)
bool BuildStepList::removeStep(int position)
{
ProjectExplorer::BuildManager *bm =
ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager();
BuildStep *bs = at(position);
if (bm->isBuilding(bs))
if (BuildManager::isBuilding(bs))
return false;
emit aboutToRemoveStep(position);
......
......@@ -172,9 +172,7 @@ bool Project::removeTarget(Target *target)
if (!target || !d->m_targets.contains(target))
return false;
ProjectExplorer::BuildManager *bm =
ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager();
if (bm->isBuilding(target))
if (BuildManager::isBuilding(target))
return false;
if (target == activeTarget()) {
......
......@@ -215,8 +215,6 @@ struct ProjectExplorerPluginPrivate {
Context m_lastProjectContext;
Node *m_currentNode;
BuildManager *m_buildManager;
QList<Internal::ProjectFileFactory*> m_fileFactories;
QStringList m_profileMimeTypes;
Internal::AppOutputPane *m_outputPane;
......@@ -971,10 +969,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(this, SIGNAL(updateRunActions()), this, SLOT(slotUpdateRunActions()));
connect(this, SIGNAL(settingsChanged()), this, SLOT(updateRunWithoutDeployMenu()));
d->m_buildManager = new BuildManager(this, d->m_cancelBuildAction);
connect(d->m_buildManager, SIGNAL(buildStateChanged(ProjectExplorer::Project*)),
QObject *buildManager = new BuildManager(this, d->m_cancelBuildAction);
connect(buildManager, SIGNAL(buildStateChanged(ProjectExplorer::Project*)),
this, SLOT(buildStateChanged(ProjectExplorer::Project*)));
connect(d->m_buildManager, SIGNAL(buildQueueFinished(bool)),
connect(buildManager, SIGNAL(buildQueueFinished(bool)),
this, SLOT(buildQueueFinished(bool)));
updateActions();
......@@ -1036,7 +1034,7 @@ void ProjectExplorerPlugin::unloadProject()
if (debug)
qDebug() << "ProjectExplorerPlugin::unloadProject";
if (buildManager()->isBuilding(d->m_currentProject)) {
if (BuildManager::isBuilding(d->m_currentProject)) {
QMessageBox box;
QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Unload"), QMessageBox::AcceptRole);
QPushButton *cancelClose = box.addButton(tr("Do Not Unload"), QMessageBox::RejectRole);
......@@ -1047,7 +1045,7 @@ void ProjectExplorerPlugin::unloadProject()
box.exec();
if (box.clickedButton() != closeAnyway)
return;
buildManager()->cancel();
BuildManager::cancel();
}
IDocument *document = d->m_currentProject->document();
......@@ -1098,7 +1096,7 @@ void ProjectExplorerPlugin::extensionsInitialized()
d->m_profileMimeTypes += pf->mimeTypes();
addAutoReleasedObject(pf);
}
d->m_buildManager->extensionsInitialized();
BuildManager::extensionsInitialized();
DeviceManager::instance()->addDevice(IDevice::Ptr(new DesktopDevice));
DeviceManager::instance()->load();
......@@ -1630,16 +1628,11 @@ void ProjectExplorerPlugin::showContextMenu(QWidget *view, const QPoint &globalP
contextMenu->popup(globalPos);
}
BuildManager *ProjectExplorerPlugin::buildManager() const
{
return d->m_buildManager;
}
void ProjectExplorerPlugin::buildStateChanged(Project * pro)
{
if (debug) {
qDebug() << "buildStateChanged";
qDebug() << pro->document()->filePath() << "isBuilding()" << d->m_buildManager->isBuilding(pro);
qDebug() << pro->document()->filePath() << "isBuilding()" << BuildManager::isBuilding(pro);
}
Q_UNUSED(pro)
updateActions();
......@@ -1704,7 +1697,7 @@ void ProjectExplorerPlugin::buildQueueFinished(bool success)
updateActions();
bool ignoreErrors = true;
if (d->m_delayedRunConfiguration && success && d->m_buildManager->getErrorTaskCount() > 0) {
if (d->m_delayedRunConfiguration && success && BuildManager::getErrorTaskCount() > 0) {
ignoreErrors = QMessageBox::question(ICore::mainWindow(),
tr("Ignore all errors?"),
tr("Found some build errors in current task.\n"
......@@ -1716,8 +1709,8 @@ void ProjectExplorerPlugin::buildQueueFinished(bool success)
if (success && ignoreErrors && d->m_delayedRunConfiguration) {
executeRunConfiguration(d->m_delayedRunConfiguration, d->m_runMode);
} else {
if (d->m_buildManager->tasksAvailable())
d->m_buildManager->showTaskWindow();
if (BuildManager::tasksAvailable())
BuildManager::showTaskWindow();
}
d->m_delayedRunConfiguration = 0;
d->m_runMode = NoRunMode;
......@@ -1894,7 +1887,7 @@ void ProjectExplorerPlugin::updateActions()
d->m_rebuildSessionAction->setToolTip(buildSessionState.second);
d->m_cleanSessionAction->setToolTip(buildSessionState.second);
d->m_cancelBuildAction->setEnabled(d->m_buildManager->isBuilding());
d->m_cancelBuildAction->setEnabled(BuildManager::isBuilding());
bool canPublish = false;
if (project) {
......@@ -2028,7 +2021,7 @@ int ProjectExplorerPlugin::queue(QList<Project *> projects, QList<Id> stepIds)
if (stepLists.isEmpty())
return 0;
if (!d->m_buildManager->buildLists(stepLists, names, preambleMessage))
if (!BuildManager::buildLists(stepLists, names, preambleMessage))
return -1;
return stepLists.count();
}
......@@ -2178,7 +2171,7 @@ QPair<bool, QString> ProjectExplorerPlugin::buildSettingsEnabled(Project *pro)
if (!pro) {
result.first = false;
result.second = tr("No project loaded.");
} else if (d->m_buildManager->isBuilding(pro)) {
} else if (BuildManager::isBuilding(pro)) {
result.first = false;
result.second = tr("Currently building the active project.");
} else if (pro->needsConfiguration()) {
......@@ -2211,7 +2204,7 @@ QPair<bool, QString> ProjectExplorerPlugin::buildSettingsEnabledForSession()
if (!SessionManager::hasProjects()) {
result.first = false;
result.second = tr("No project loaded");
} else if (d->m_buildManager->isBuilding()) {
} else if (BuildManager::isBuilding()) {
result.first = false;
result.second = tr("A build is in progress");
} else if (!hasBuildSettings(0)) {
......@@ -2235,7 +2228,7 @@ QPair<bool, QString> ProjectExplorerPlugin::buildSettingsEnabledForSession()
bool ProjectExplorerPlugin::coreAboutToClose()
{
if (d->m_buildManager->isBuilding()) {
if (BuildManager::isBuilding()) {
QMessageBox box;
QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Close"), QMessageBox::AcceptRole);
QPushButton *cancelClose = box.addButton(tr("Do Not Close"), QMessageBox::RejectRole);
......@@ -2414,10 +2407,10 @@ void ProjectExplorerPlugin::updateDeployActions()
Project *project = SessionManager::startupProject();
bool enableDeployActions = project
&& ! (d->m_buildManager->isBuilding(project))
&& BuildManager::isBuilding(project)
&& hasDeploySettings(project);
bool enableDeployActionsContextMenu = d->m_currentProject
&& ! (d->m_buildManager->isBuilding(d->m_currentProject))
&& !BuildManager::isBuilding(d->m_currentProject)
&& hasDeploySettings(d->m_currentProject);
if (d->m_projectExplorerSettings.buildBeforeDeploy) {
......@@ -2451,9 +2444,7 @@ void ProjectExplorerPlugin::updateDeployActions()
}
}
}
if (!hasProjects
|| !hasDeploySettings(0)
|| d->m_buildManager->isBuilding())
if (!hasProjects || !hasDeploySettings(0) || BuildManager::isBuilding())
enableDeploySessionAction = false;
d->m_deploySessionAction->setEnabled(enableDeploySessionAction);
......@@ -2479,8 +2470,7 @@ bool ProjectExplorerPlugin::canRun(Project *project, RunMode runMode)
bool canRun = findRunControlFactory(activeRC, runMode)
&& activeRC->isEnabled();
const bool building = d->m_buildManager->isBuilding();
return (canRun && !building);
return canRun && !BuildManager::isBuilding();
}
QString ProjectExplorerPlugin::cannotRunReason(Project *project, RunMode runMode)
......@@ -2516,8 +2506,7 @@ QString ProjectExplorerPlugin::cannotRunReason(Project *project, RunMode runMode
if (!findRunControlFactory(activeRC, runMode))
return tr("Cannot run '%1'.").arg(activeRC->displayName());
if (d->m_buildManager->isBuilding())
if (BuildManager::isBuilding())
return tr("A build is still in progress.");
return QString();
}
......@@ -2536,8 +2525,8 @@ void ProjectExplorerPlugin::cancelBuild()
if (debug)
qDebug() << "ProjectExplorerPlugin::cancelBuild";
if (d->m_buildManager->isBuilding())
d->m_buildManager->cancel();
if (BuildManager::isBuilding())
BuildManager::cancel();
}
void ProjectExplorerPlugin::addToRecentProjects(const QString &fileName, const QString &displayName)
......
......@@ -49,7 +49,6 @@ class Id;
}
namespace ProjectExplorer {
class BuildManager;
class RunControl;
class RunConfiguration;
class IRunControlFactory;
......@@ -86,8 +85,6 @@ public:
void setCurrentFile(Project *project, const QString &file);
void setCurrentNode(Node *node);
BuildManager *buildManager() const;
bool saveModifiedFiles();
void showContextMenu(QWidget *view, const QPoint &globalPos, Node *node);
......
......@@ -436,8 +436,7 @@ void RunSettingsWidget::addDeployConfiguration()
void RunSettingsWidget::removeDeployConfiguration()
{
DeployConfiguration *dc = m_target->activeDeployConfiguration();
ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager();
if (bm->isBuilding(dc)) {
if (BuildManager::isBuilding(dc)) {
QMessageBox box;
QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Remove Deploy Configuration"), QMessageBox::AcceptRole);
QPushButton *cancelClose = box.addButton(tr("Do Not Remove"), QMessageBox::RejectRole);
......@@ -448,7 +447,7 @@ void RunSettingsWidget::removeDeployConfiguration()
box.exec();
if (box.clickedButton() != closeAnyway)
return;
bm->cancel();
BuildManager::cancel();
} else {
QMessageBox msgBox(QMessageBox::Question, tr("Remove Deploy Configuration?"),
tr("Do you really want to delete deploy configuration <b>%1</b>?").arg(dc->displayName()),
......