forked from qt-creator/qt-creator
BuildManager: apply 'static' pattern
Change-Id: I00bb591c027a22088d5f1feedc84aa28523dcca2 Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
@@ -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,11 +37,9 @@
|
||||
#include <QStringList>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Task;
|
||||
class ProjectExplorerPlugin;
|
||||
class Project;
|
||||
|
||||
struct BuildManagerPrivate;
|
||||
class Task;
|
||||
class Project;
|
||||
|
||||
class PROJECTEXPLORER_EXPORT BuildManager : public QObject
|
||||
{
|
||||
@@ -49,35 +47,35 @@ class PROJECTEXPLORER_EXPORT BuildManager : public QObject
|
||||
|
||||
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()),
|
||||
|
||||
@@ -248,9 +248,7 @@ bool Target::removeBuildConfiguration(BuildConfiguration *configuration)
|
||||
if (!d->m_buildConfigurations.contains(configuration))
|
||||
return false;
|
||||
|
||||
ProjectExplorer::BuildManager *bm =
|
||||
ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager();
|
||||
if (bm->isBuilding(configuration))
|
||||
if (BuildManager::isBuilding(configuration))
|
||||
return false;
|
||||
|
||||
d->m_buildConfigurations.removeOne(configuration);
|
||||
@@ -325,9 +323,7 @@ bool Target::removeDeployConfiguration(DeployConfiguration *dc)
|
||||
if (!d->m_deployConfigurations.contains(dc))
|
||||
return false;
|
||||
|
||||
ProjectExplorer::BuildManager *bm =
|
||||
ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager();
|
||||
if (bm->isBuilding(dc))
|
||||
if (BuildManager::isBuilding(dc))
|
||||
return false;
|
||||
|
||||
d->m_deployConfigurations.removeOne(dc);
|
||||
|
||||
@@ -443,8 +443,7 @@ void TargetSettingsPanelWidget::removeTarget()
|
||||
|
||||
void TargetSettingsPanelWidget::removeTarget(Target *t)
|
||||
{
|
||||
ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager();
|
||||
if (bm->isBuilding(t)) {
|
||||
if (BuildManager::isBuilding(t)) {
|
||||
QMessageBox box;
|
||||
QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Remove Kit"), QMessageBox::AcceptRole);
|
||||
QPushButton *cancelClose = box.addButton(tr("Do Not Remove"), QMessageBox::RejectRole);
|
||||
@@ -455,7 +454,7 @@ void TargetSettingsPanelWidget::removeTarget(Target *t)
|
||||
box.exec();
|
||||
if (box.clickedButton() != closeAnyway)
|
||||
return;
|
||||
bm->cancel();
|
||||
BuildManager::cancel();
|
||||
} else {
|
||||
// We don't show the generic message box on removing the target, if we showed the still building one
|
||||
int ret = QMessageBox::warning(this, tr("Qt Creator"),
|
||||
|
||||
@@ -172,7 +172,7 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
connect(m_projectExplorer, SIGNAL(currentNodeChanged(ProjectExplorer::Node*,ProjectExplorer::Project*)),
|
||||
this, SLOT(updateContextActions(ProjectExplorer::Node*,ProjectExplorer::Project*)));
|
||||
|
||||
connect(m_projectExplorer->buildManager(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)),
|
||||
connect(BuildManager::instance(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)),
|
||||
this, SLOT(buildStateChanged(ProjectExplorer::Project*)));
|
||||
|
||||
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||
@@ -213,7 +213,7 @@ void QbsProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node,
|
||||
|
||||
activeTargetChanged();
|
||||
|
||||
bool isBuilding = m_projectExplorer->buildManager()->isBuilding(project);
|
||||
bool isBuilding = BuildManager::isBuilding(project);
|
||||
bool isFile = m_currentProject && node && (node->nodeType() == ProjectExplorer::FileNodeType);
|
||||
bool isProduct = m_currentProject && node && qobject_cast<QbsProductNode *>(node->projectNode());
|
||||
bool isFileEnabled = isFile && node->isEnabled();
|
||||
@@ -226,7 +226,7 @@ void QbsProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node,
|
||||
void QbsProjectManagerPlugin::updateReparseQbsAction()
|
||||
{
|
||||
m_reparseQbs->setEnabled(m_currentProject
|
||||
&& !m_projectExplorer->buildManager()->isBuilding(m_currentProject)
|
||||
&& !BuildManager::isBuilding(m_currentProject)
|
||||
&& !m_currentProject->isParsing());
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ void QbsProjectManagerPlugin::updateBuildActions()
|
||||
|
||||
m_buildFile->setParameter(QFileInfo(file).fileName());
|
||||
fileVisible = project && node && qobject_cast<QbsBaseProjectNode *>(node->projectNode());
|
||||
fileEnabled = !m_projectExplorer->buildManager()->isBuilding(project)
|
||||
fileEnabled = !BuildManager::isBuilding(project)
|
||||
&& m_currentProject && !m_currentProject->isParsing();
|
||||
|
||||
if (QbsProductNode *productNode
|
||||
@@ -357,18 +357,17 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance();
|
||||
if (!pe->saveModifiedFiles())
|
||||
if (!ProjectExplorerPlugin::instance()->saveModifiedFiles())
|
||||
return;
|
||||
|
||||
bc->setChangedFiles(files);
|
||||
bc->setActiveFileTags(activeFileTags);
|
||||
bc->setProducts(QStringList());
|
||||
|
||||
const Core::Id buildStep = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
|
||||
|
||||
const QString name = ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
||||
pe->buildManager()->buildList(bc->stepList(buildStep), name);
|
||||
BuildManager::buildList(bc->stepList(buildStep), name);
|
||||
|
||||
bc->setChangedFiles(QStringList());
|
||||
}
|
||||
@@ -391,17 +390,16 @@ void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringLi
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance();
|
||||
if (!pe->saveModifiedFiles())
|
||||
if (!ProjectExplorerPlugin::instance()->saveModifiedFiles())
|
||||
return;
|
||||
|
||||
bc->setChangedFiles(QStringList());
|
||||
bc->setProducts(products);
|
||||
|
||||
const Core::Id buildStep = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
|
||||
|
||||
const QString name = ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
||||
pe->buildManager()->buildList(bc->stepList(buildStep), name);
|
||||
const QString name = ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
||||
BuildManager::buildList(bc->stepList(buildStep), name);
|
||||
|
||||
bc->setProducts(QStringList());
|
||||
}
|
||||
|
||||
@@ -649,11 +649,10 @@ void QMakeStepConfigWidget::recompileMessageBoxFinished(int button)
|
||||
return;
|
||||
|
||||
QList<ProjectExplorer::BuildStepList *> stepLists;
|
||||
const Core::Id clean = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
|
||||
const Core::Id build = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
const Core::Id clean = ProjectExplorer::Constants::BUILDSTEPS_CLEAN;
|
||||
const Core::Id build = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
|
||||
stepLists << bc->stepList(clean) << bc->stepList(build);
|
||||
ProjectExplorer::BuildManager *bm = ProjectExplorerPlugin::instance()->buildManager();
|
||||
bm->buildLists(stepLists, QStringList() << ProjectExplorerPlugin::displayNameForStepId(clean)
|
||||
BuildManager::buildLists(stepLists, QStringList() << ProjectExplorerPlugin::displayNameForStepId(clean)
|
||||
<< ProjectExplorerPlugin::displayNameForStepId(build));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,8 +349,7 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
|
||||
m_asyncUpdateTimer.setInterval(3000);
|
||||
connect(&m_asyncUpdateTimer, SIGNAL(timeout()), this, SLOT(asyncUpdate()));
|
||||
|
||||
connect(ProjectExplorerPlugin::instance()->buildManager(),
|
||||
SIGNAL(buildQueueFinished(bool)),
|
||||
connect(BuildManager::instance(), SIGNAL(buildQueueFinished(bool)),
|
||||
SLOT(buildFinished(bool)));
|
||||
}
|
||||
|
||||
|
||||
@@ -108,11 +108,6 @@ ProjectExplorer::Project *Qt4Manager::openProject(const QString &fileName, QStri
|
||||
return new Qt4Project(this, fileName);
|
||||
}
|
||||
|
||||
ProjectExplorer::ProjectExplorerPlugin *Qt4Manager::projectExplorer() const
|
||||
{
|
||||
return ProjectExplorer::ProjectExplorerPlugin::instance();
|
||||
}
|
||||
|
||||
ProjectExplorer::Node *Qt4Manager::contextNode() const
|
||||
{
|
||||
return m_contextNode;
|
||||
@@ -222,7 +217,7 @@ void Qt4Manager::runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *no
|
||||
if (Qt4ProFileNode *profile = qobject_cast<Qt4ProFileNode *>(node))
|
||||
bc->setSubNodeBuild(profile);
|
||||
|
||||
projectExplorer()->buildManager()->appendStep(qs, tr("QMake"));
|
||||
BuildManager::appendStep(qs, tr("QMake"));
|
||||
bc->setSubNodeBuild(0);
|
||||
}
|
||||
|
||||
@@ -287,23 +282,23 @@ void Qt4Manager::handleSubDirContextMenu(Qt4Manager::Action action, bool isFileB
|
||||
|
||||
if (isFileBuild)
|
||||
bc->setFileNodeBuild(contextFile);
|
||||
if (projectExplorer()->saveModifiedFiles()) {
|
||||
const Core::Id buildStep = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD);
|
||||
const Core::Id cleanStep = Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN);
|
||||
if (ProjectExplorerPlugin::instance()->saveModifiedFiles()) {
|
||||
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
|
||||
const Core::Id cleanStep = ProjectExplorer::Constants::BUILDSTEPS_CLEAN;
|
||||
if (action == BUILD) {
|
||||
const QString name = ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
||||
projectExplorer()->buildManager()->buildList(bc->stepList(buildStep), name);
|
||||
const QString name = ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
||||
BuildManager::buildList(bc->stepList(buildStep), name);
|
||||
} else if (action == CLEAN) {
|
||||
const QString name = ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(cleanStep);
|
||||
projectExplorer()->buildManager()->buildList(bc->stepList(cleanStep), name);
|
||||
const QString name = ProjectExplorerPlugin::displayNameForStepId(cleanStep);
|
||||
BuildManager::buildList(bc->stepList(cleanStep), name);
|
||||
} else if (action == REBUILD) {
|
||||
QStringList names;
|
||||
names << ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(cleanStep)
|
||||
<< ProjectExplorer::ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
||||
names << ProjectExplorerPlugin::displayNameForStepId(cleanStep)
|
||||
<< ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
||||
|
||||
QList<ProjectExplorer::BuildStepList *> stepLists;
|
||||
stepLists << bc->stepList(cleanStep) << bc->stepList(buildStep);
|
||||
projectExplorer()->buildManager()->buildLists(stepLists, names);
|
||||
BuildManager::buildLists(stepLists, names);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ namespace ExtensionSystem { class PluginManager; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Project;
|
||||
class ProjectExplorerPlugin;
|
||||
class Node;
|
||||
class ToolChain;
|
||||
}
|
||||
@@ -67,8 +66,6 @@ public:
|
||||
void unregisterProject(Qt4Project *project);
|
||||
void notifyChanged(const QString &name);
|
||||
|
||||
ProjectExplorer::ProjectExplorerPlugin *projectExplorer() const;
|
||||
|
||||
virtual QString mimeType() const;
|
||||
ProjectExplorer::Project *openProject(const QString &fileName, QString *errorString);
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
|
||||
connect(m_buildFileAction, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(buildFile()));
|
||||
|
||||
connect(m_projectExplorer->buildManager(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)),
|
||||
connect(BuildManager::instance(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)),
|
||||
this, SLOT(buildStateChanged(ProjectExplorer::Project*)));
|
||||
connect(SessionManager::instance(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
|
||||
this, SLOT(startupProjectChanged()));
|
||||
@@ -333,7 +333,7 @@ void Qt4ProjectManagerPlugin::activeTargetChanged()
|
||||
void Qt4ProjectManagerPlugin::updateRunQMakeAction()
|
||||
{
|
||||
bool enable = true;
|
||||
if (m_projectExplorer->buildManager()->isBuilding(m_projectExplorer->currentProject()))
|
||||
if (BuildManager::isBuilding(m_projectExplorer->currentProject()))
|
||||
enable = false;
|
||||
Qt4Project *pro = qobject_cast<Qt4Project *>(m_projectExplorer->currentProject());
|
||||
if (!pro
|
||||
@@ -374,7 +374,7 @@ void Qt4ProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node,
|
||||
Qt4BuildConfiguration *buildConfiguration = (qt4Project && qt4Project->activeTarget()) ?
|
||||
static_cast<Qt4BuildConfiguration *>(qt4Project->activeTarget()->activeBuildConfiguration()) : 0;
|
||||
bool isProjectNode = qt4Project && proFileNode && buildConfiguration;
|
||||
bool isBuilding = m_projectExplorer->buildManager()->isBuilding(project);
|
||||
bool isBuilding = BuildManager::isBuilding(project);
|
||||
bool enabled = subProjectActionsVisible && !isBuilding;
|
||||
|
||||
m_buildSubProjectAction->setVisible(subProjectActionsVisible);
|
||||
@@ -424,7 +424,7 @@ void Qt4ProjectManagerPlugin::updateBuildFileAction()
|
||||
&& node
|
||||
&& qobject_cast<Qt4ProFileNode *>(node->projectNode());
|
||||
|
||||
enabled = !m_projectExplorer->buildManager()->isBuilding(project);
|
||||
enabled = !BuildManager::isBuilding(project);
|
||||
}
|
||||
m_buildFileAction->setVisible(visible);
|
||||
m_buildFileAction->setEnabled(enabled);
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
|
||||
enum { debug = 0 };
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace CPlusPlus;
|
||||
|
||||
// Test for form editor (loosely coupled)
|
||||
@@ -310,11 +311,9 @@ UiCodeModelManager::UiCodeModelManager() :
|
||||
m_dirty(false)
|
||||
{
|
||||
m_instance = this;
|
||||
ProjectExplorer::BuildManager *bm
|
||||
= ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager();
|
||||
connect(bm, SIGNAL(buildStateChanged(ProjectExplorer::Project*)),
|
||||
connect(BuildManager::instance(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)),
|
||||
this, SLOT(buildStateHasChanged(ProjectExplorer::Project*)));
|
||||
connect(ProjectExplorer::SessionManager::instance(),
|
||||
connect(SessionManager::instance(),
|
||||
SIGNAL(projectRemoved(ProjectExplorer::Project*)),
|
||||
this, SLOT(projectWasRemoved(ProjectExplorer::Project*)));
|
||||
|
||||
@@ -370,7 +369,7 @@ void UiCodeModelManager::update(ProjectExplorer::Project *project, QHash<QString
|
||||
|
||||
void UiCodeModelManager::updateContents(const QString &uiFileName, const QString &contents)
|
||||
{
|
||||
QHash<ProjectExplorer::Project *, QList<UiCodeModelSupport *> >::iterator i;
|
||||
QHash<Project *, QList<UiCodeModelSupport *> >::iterator i;
|
||||
for (i = m_instance->m_projectUiSupport.begin();
|
||||
i != m_instance->m_projectUiSupport.end(); ++i) {
|
||||
foreach (UiCodeModelSupport *support, i.value()) {
|
||||
@@ -380,9 +379,9 @@ void UiCodeModelManager::updateContents(const QString &uiFileName, const QString
|
||||
}
|
||||
}
|
||||
|
||||
void UiCodeModelManager::buildStateHasChanged(ProjectExplorer::Project *project)
|
||||
void UiCodeModelManager::buildStateHasChanged(Project *project)
|
||||
{
|
||||
if (ProjectExplorer::ProjectExplorerPlugin::instance()->buildManager()->isBuilding(project))
|
||||
if (BuildManager::isBuilding(project))
|
||||
return;
|
||||
|
||||
QList<UiCodeModelSupport *> projectSupport = m_projectUiSupport.value(project);
|
||||
@@ -390,7 +389,7 @@ void UiCodeModelManager::buildStateHasChanged(ProjectExplorer::Project *project)
|
||||
i->updateFromBuild();
|
||||
}
|
||||
|
||||
void UiCodeModelManager::projectWasRemoved(ProjectExplorer::Project *project)
|
||||
void UiCodeModelManager::projectWasRemoved(Project *project)
|
||||
{
|
||||
CppTools::CppModelManagerInterface *mm = CppTools::CppModelManagerInterface::instance();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user