forked from qt-creator/qt-creator
Merge branch 'master' of scm.dev.nokia.troll.no:creator/mainline
Conflicts: src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationstep.cpp
This commit is contained in:
@@ -36,7 +36,10 @@
|
|||||||
#include "cmakehighlighter.h"
|
#include "cmakehighlighter.h"
|
||||||
#include "cmakeeditorfactory.h"
|
#include "cmakeeditorfactory.h"
|
||||||
#include "cmakeprojectconstants.h"
|
#include "cmakeprojectconstants.h"
|
||||||
|
#include "cmakeproject.h"
|
||||||
|
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
#include <projectexplorer/session.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/texteditoractionhandler.h>
|
#include <texteditor/texteditoractionhandler.h>
|
||||||
#include <texteditor/texteditorconstants.h>
|
#include <texteditor/texteditorconstants.h>
|
||||||
@@ -55,7 +58,10 @@ CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
|
|||||||
: BaseTextEditor(editor),
|
: BaseTextEditor(editor),
|
||||||
m_context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
|
m_context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
|
||||||
TextEditor::Constants::C_TEXTEDITOR)
|
TextEditor::Constants::C_TEXTEDITOR)
|
||||||
{ }
|
{
|
||||||
|
connect (this, SIGNAL(changed()),
|
||||||
|
this, SLOT(markAsChanged()));
|
||||||
|
}
|
||||||
|
|
||||||
Core::Context CMakeEditor::context() const
|
Core::Context CMakeEditor::context() const
|
||||||
{
|
{
|
||||||
@@ -76,6 +82,30 @@ QString CMakeEditor::id() const
|
|||||||
return QLatin1String(CMakeProjectManager::Constants::CMAKE_EDITOR_ID);
|
return QLatin1String(CMakeProjectManager::Constants::CMAKE_EDITOR_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMakeEditor::markAsChanged()
|
||||||
|
{
|
||||||
|
Core::EditorManager::instance()->
|
||||||
|
showEditorInfoBar(QLatin1String("CMakeEditor.RunCMake"),
|
||||||
|
tr("Changes to cmake files are shown in the project tree after building."),
|
||||||
|
tr("Build now"),
|
||||||
|
this, SLOT(build()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMakeEditor::build()
|
||||||
|
{
|
||||||
|
QList<ProjectExplorer::Project *> projects =
|
||||||
|
ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projects();
|
||||||
|
foreach (ProjectExplorer::Project *p, projects) {
|
||||||
|
CMakeProject *cmakeProject = qobject_cast<CMakeProject *>(p);
|
||||||
|
if (cmakeProject) {
|
||||||
|
if (cmakeProject->isProjectFile(file()->fileName())) {
|
||||||
|
ProjectExplorer::ProjectExplorerPlugin::instance()->buildProject(cmakeProject);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// CMakeEditor
|
// CMakeEditor
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class CMakeManager;
|
|||||||
|
|
||||||
class CMakeEditor : public TextEditor::BaseTextEditor
|
class CMakeEditor : public TextEditor::BaseTextEditor
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
CMakeEditor(CMakeEditorWidget *);
|
CMakeEditor(CMakeEditorWidget *);
|
||||||
Core::Context context() const;
|
Core::Context context() const;
|
||||||
@@ -61,6 +62,9 @@ public:
|
|||||||
Core::IEditor *duplicate(QWidget *parent);
|
Core::IEditor *duplicate(QWidget *parent);
|
||||||
QString id() const;
|
QString id() const;
|
||||||
bool isTemporary() const { return false; }
|
bool isTemporary() const { return false; }
|
||||||
|
private slots:
|
||||||
|
void markAsChanged();
|
||||||
|
void build();
|
||||||
private:
|
private:
|
||||||
const Core::Context m_context;
|
const Core::Context m_context;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
|
|||||||
: m_manager(manager),
|
: m_manager(manager),
|
||||||
m_fileName(fileName),
|
m_fileName(fileName),
|
||||||
m_rootNode(new CMakeProjectNode(m_fileName)),
|
m_rootNode(new CMakeProjectNode(m_fileName)),
|
||||||
m_insideFileChanged(false),
|
|
||||||
m_lastEditor(0)
|
m_lastEditor(0)
|
||||||
{
|
{
|
||||||
m_file = new CMakeFile(this, fileName);
|
m_file = new CMakeFile(this, fileName);
|
||||||
@@ -126,15 +125,8 @@ CMakeProject::~CMakeProject()
|
|||||||
void CMakeProject::fileChanged(const QString &fileName)
|
void CMakeProject::fileChanged(const QString &fileName)
|
||||||
{
|
{
|
||||||
Q_UNUSED(fileName)
|
Q_UNUSED(fileName)
|
||||||
if (!activeTarget() ||
|
|
||||||
!activeTarget()->activeBuildConfiguration())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (m_insideFileChanged)
|
parseCMakeLists();
|
||||||
return;
|
|
||||||
m_insideFileChanged = true;
|
|
||||||
changeActiveBuildConfiguration(activeTarget()->activeBuildConfiguration());
|
|
||||||
m_insideFileChanged = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfiguration *bc)
|
void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfiguration *bc)
|
||||||
@@ -201,6 +193,8 @@ bool CMakeProject::parseCMakeLists()
|
|||||||
!activeTarget()->activeBuildConfiguration())
|
!activeTarget()->activeBuildConfiguration())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Core::EditorManager::instance()->hideEditorInfoBar("CMakeEditor.RunCMake");
|
||||||
|
|
||||||
// Find cbp file
|
// Find cbp file
|
||||||
CMakeBuildConfiguration *activeBC = activeTarget()->activeBuildConfiguration();
|
CMakeBuildConfiguration *activeBC = activeTarget()->activeBuildConfiguration();
|
||||||
QString cbpFile = CMakeManager::findCbpFile(activeBC->buildDirectory());
|
QString cbpFile = CMakeManager::findCbpFile(activeBC->buildDirectory());
|
||||||
@@ -212,12 +206,17 @@ bool CMakeProject::parseCMakeLists()
|
|||||||
//qDebug()<<"Parsing file "<<cbpFile;
|
//qDebug()<<"Parsing file "<<cbpFile;
|
||||||
if (!cbpparser.parseCbpFile(cbpFile)) {
|
if (!cbpparser.parseCbpFile(cbpFile)) {
|
||||||
// TODO report error
|
// TODO report error
|
||||||
qDebug()<<"Parsing failed";
|
|
||||||
// activeBC->updateToolChain(QString::null);
|
|
||||||
emit buildTargetsChanged();
|
emit buildTargetsChanged();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (const QString &file, m_watcher->files())
|
||||||
|
if (file != cbpFile)
|
||||||
|
m_watcher->removePath(file);
|
||||||
|
|
||||||
|
// how can we ensure that it is completly written?
|
||||||
|
m_watcher->addPath(cbpFile);
|
||||||
|
|
||||||
// ToolChain
|
// ToolChain
|
||||||
// activeBC->updateToolChain(cbpparser.compilerName());
|
// activeBC->updateToolChain(cbpparser.compilerName());
|
||||||
m_projectName = cbpparser.projectName();
|
m_projectName = cbpparser.projectName();
|
||||||
@@ -238,12 +237,6 @@ bool CMakeProject::parseCMakeLists()
|
|||||||
projectFiles.insert(cmakeListTxt);
|
projectFiles.insert(cmakeListTxt);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSet<QString> added = projectFiles;
|
|
||||||
added.subtract(m_watchedFiles);
|
|
||||||
foreach(const QString &add, added)
|
|
||||||
m_watcher->addFile(add);
|
|
||||||
foreach(const QString &remove, m_watchedFiles.subtract(projectFiles))
|
|
||||||
m_watcher->removeFile(remove);
|
|
||||||
m_watchedFiles = projectFiles;
|
m_watchedFiles = projectFiles;
|
||||||
|
|
||||||
m_files.clear();
|
m_files.clear();
|
||||||
@@ -279,7 +272,6 @@ bool CMakeProject::parseCMakeLists()
|
|||||||
}
|
}
|
||||||
cmakeCache.close();
|
cmakeCache.close();
|
||||||
|
|
||||||
//qDebug()<<"Updating CodeModel";
|
|
||||||
createUiCodeModelSupport();
|
createUiCodeModelSupport();
|
||||||
|
|
||||||
if (!activeBC->toolChain())
|
if (!activeBC->toolChain())
|
||||||
@@ -317,12 +309,16 @@ bool CMakeProject::parseCMakeLists()
|
|||||||
m_codeModelFuture = modelmanager->updateSourceFiles(pinfo.sourceFiles);
|
m_codeModelFuture = modelmanager->updateSourceFiles(pinfo.sourceFiles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit buildTargetsChanged();
|
emit buildTargetsChanged();
|
||||||
emit fileListChanged();
|
emit fileListChanged();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CMakeProject::isProjectFile(const QString &fileName)
|
||||||
|
{
|
||||||
|
return m_watchedFiles.contains(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
QList<CMakeBuildTarget> CMakeProject::buildTargets() const
|
QList<CMakeBuildTarget> CMakeProject::buildTargets() const
|
||||||
{
|
{
|
||||||
return m_buildTargets;
|
return m_buildTargets;
|
||||||
@@ -562,7 +558,7 @@ bool CMakeProject::fromMap(const QVariantMap &map)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_watcher = new ProjectExplorer::FileWatcher(this);
|
m_watcher = new QFileSystemWatcher(this);
|
||||||
connect(m_watcher, SIGNAL(fileChanged(QString)), this, SLOT(fileChanged(QString)));
|
connect(m_watcher, SIGNAL(fileChanged(QString)), this, SLOT(fileChanged(QString)));
|
||||||
|
|
||||||
if (!parseCMakeLists()) // Gets the directory from the active buildconfiguration
|
if (!parseCMakeLists()) // Gets the directory from the active buildconfiguration
|
||||||
|
|||||||
@@ -46,9 +46,11 @@
|
|||||||
#include <projectexplorer/filewatcher.h>
|
#include <projectexplorer/filewatcher.h>
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <coreplugin/ifile.h>
|
#include <coreplugin/ifile.h>
|
||||||
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
|
|
||||||
#include <QtCore/QXmlStreamReader>
|
#include <QtCore/QXmlStreamReader>
|
||||||
|
#include <QtCore/QFileSystemWatcher>
|
||||||
#include <QtGui/QPushButton>
|
#include <QtGui/QPushButton>
|
||||||
#include <QtGui/QLineEdit>
|
#include <QtGui/QLineEdit>
|
||||||
|
|
||||||
@@ -105,6 +107,8 @@ public:
|
|||||||
|
|
||||||
QString uicCommand() const;
|
QString uicCommand() const;
|
||||||
|
|
||||||
|
bool isProjectFile(const QString &fileName);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/// emitted after parsing
|
/// emitted after parsing
|
||||||
void buildTargetsChanged();
|
void buildTargetsChanged();
|
||||||
@@ -142,8 +146,7 @@ private:
|
|||||||
CMakeProjectNode *m_rootNode;
|
CMakeProjectNode *m_rootNode;
|
||||||
QStringList m_files;
|
QStringList m_files;
|
||||||
QList<CMakeBuildTarget> m_buildTargets;
|
QList<CMakeBuildTarget> m_buildTargets;
|
||||||
ProjectExplorer::FileWatcher *m_watcher;
|
QFileSystemWatcher *m_watcher;
|
||||||
bool m_insideFileChanged;
|
|
||||||
QSet<QString> m_watchedFiles;
|
QSet<QString> m_watchedFiles;
|
||||||
QFuture<void> m_codeModelFuture;
|
QFuture<void> m_codeModelFuture;
|
||||||
|
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> &fi)
|
|||||||
|
|
||||||
void AbstractProcessStep::processStarted()
|
void AbstractProcessStep::processStarted()
|
||||||
{
|
{
|
||||||
emit addOutput(tr("Starting: \"%1\" %2\n")
|
emit addOutput(tr("Starting: \"%1\" %2")
|
||||||
.arg(QDir::toNativeSeparators(m_param.effectiveCommand()),
|
.arg(QDir::toNativeSeparators(m_param.effectiveCommand()),
|
||||||
m_param.prettyArguments()),
|
m_param.prettyArguments()),
|
||||||
BuildStep::MessageOutput);
|
BuildStep::MessageOutput);
|
||||||
@@ -222,7 +222,7 @@ void AbstractProcessStep::stdOutput(const QString &line)
|
|||||||
{
|
{
|
||||||
if (m_outputParserChain)
|
if (m_outputParserChain)
|
||||||
m_outputParserChain->stdOutput(line);
|
m_outputParserChain->stdOutput(line);
|
||||||
emit addOutput(line, BuildStep::NormalOutput);
|
emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractProcessStep::processReadyReadStdError()
|
void AbstractProcessStep::processReadyReadStdError()
|
||||||
@@ -238,7 +238,7 @@ void AbstractProcessStep::stdError(const QString &line)
|
|||||||
{
|
{
|
||||||
if (m_outputParserChain)
|
if (m_outputParserChain)
|
||||||
m_outputParserChain->stdError(line);
|
m_outputParserChain->stdError(line);
|
||||||
emit addOutput(line, BuildStep::ErrorOutput);
|
emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractProcessStep::checkForCancel()
|
void AbstractProcessStep::checkForCancel()
|
||||||
@@ -301,7 +301,7 @@ void AbstractProcessStep::taskAdded(const ProjectExplorer::Task &task)
|
|||||||
|
|
||||||
void AbstractProcessStep::outputAdded(const QString &string, ProjectExplorer::BuildStep::OutputFormat format)
|
void AbstractProcessStep::outputAdded(const QString &string, ProjectExplorer::BuildStep::OutputFormat format)
|
||||||
{
|
{
|
||||||
emit addOutput(string, format);
|
emit addOutput(string, format, BuildStep::DontAppendNewline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)
|
void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ BuildManager::BuildManager(ProjectExplorerPlugin *parent)
|
|||||||
pm->addObject(d->m_taskWindow);
|
pm->addObject(d->m_taskWindow);
|
||||||
|
|
||||||
qRegisterMetaType<ProjectExplorer::BuildStep::OutputFormat>();
|
qRegisterMetaType<ProjectExplorer::BuildStep::OutputFormat>();
|
||||||
|
qRegisterMetaType<ProjectExplorer::BuildStep::OutputNewlineSetting>();
|
||||||
|
|
||||||
connect(d->m_taskWindow, SIGNAL(tasksChanged()),
|
connect(d->m_taskWindow, SIGNAL(tasksChanged()),
|
||||||
this, SLOT(updateTaskCount()));
|
this, SLOT(updateTaskCount()));
|
||||||
@@ -198,10 +199,7 @@ void BuildManager::cancel()
|
|||||||
// (And we want those to be before the cancel message.)
|
// (And we want those to be before the cancel message.)
|
||||||
QTimer::singleShot(0, this, SLOT(emitCancelMessage()));
|
QTimer::singleShot(0, this, SLOT(emitCancelMessage()));
|
||||||
|
|
||||||
disconnect(d->m_currentBuildStep, SIGNAL(addTask(ProjectExplorer::Task)),
|
disconnectOutput(d->m_currentBuildStep);
|
||||||
this, SLOT(addToTaskWindow(ProjectExplorer::Task)));
|
|
||||||
disconnect(d->m_currentBuildStep, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat)),
|
|
||||||
this, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat)));
|
|
||||||
decrementActiveBuildSteps(d->m_currentBuildStep->buildConfiguration()->target()->project());
|
decrementActiveBuildSteps(d->m_currentBuildStep->buildConfiguration()->target()->project());
|
||||||
|
|
||||||
d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, tr("Build canceled")); //TODO NBS fix in qtconcurrent
|
d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, tr("Build canceled")); //TODO NBS fix in qtconcurrent
|
||||||
@@ -229,17 +227,14 @@ void BuildManager::finish()
|
|||||||
|
|
||||||
void BuildManager::emitCancelMessage()
|
void BuildManager::emitCancelMessage()
|
||||||
{
|
{
|
||||||
emit addToOutputWindow(tr("Canceled build."), BuildStep::ErrorMessageOutput);
|
addToOutputWindow(tr("Canceled build."), BuildStep::ErrorMessageOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildManager::clearBuildQueue()
|
void BuildManager::clearBuildQueue()
|
||||||
{
|
{
|
||||||
foreach (BuildStep *bs, d->m_buildQueue) {
|
foreach (BuildStep *bs, d->m_buildQueue) {
|
||||||
decrementActiveBuildSteps(bs->buildConfiguration()->target()->project());
|
decrementActiveBuildSteps(bs->buildConfiguration()->target()->project());
|
||||||
disconnect(bs, SIGNAL(addTask(ProjectExplorer::Task)),
|
disconnectOutput(bs);
|
||||||
this, SLOT(addToTaskWindow(ProjectExplorer::Task)));
|
|
||||||
disconnect(bs, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat)),
|
|
||||||
this, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d->m_buildQueue.clear();
|
d->m_buildQueue.clear();
|
||||||
@@ -329,9 +324,13 @@ void BuildManager::addToTaskWindow(const ProjectExplorer::Task &task)
|
|||||||
d->m_taskHub->addTask(task);
|
d->m_taskHub->addTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildManager::addToOutputWindow(const QString &string, ProjectExplorer::BuildStep::OutputFormat format)
|
void BuildManager::addToOutputWindow(const QString &string, BuildStep::OutputFormat format,
|
||||||
|
BuildStep::OutputNewlineSetting newLineSetting)
|
||||||
{
|
{
|
||||||
d->m_outputWindow->appendText(string, format);
|
QString stringToWrite = string;
|
||||||
|
if (newLineSetting == BuildStep::DoAppendNewline)
|
||||||
|
stringToWrite += QLatin1Char('\n');
|
||||||
|
d->m_outputWindow->appendText(stringToWrite, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuildManager::nextBuildQueue()
|
void BuildManager::nextBuildQueue()
|
||||||
@@ -339,11 +338,7 @@ void BuildManager::nextBuildQueue()
|
|||||||
if (d->m_canceling)
|
if (d->m_canceling)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
disconnect(d->m_currentBuildStep, SIGNAL(addTask(ProjectExplorer::Task)),
|
disconnectOutput(d->m_currentBuildStep);
|
||||||
this, SLOT(addToTaskWindow(ProjectExplorer::Task)));
|
|
||||||
disconnect(d->m_currentBuildStep, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat)),
|
|
||||||
this, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat)));
|
|
||||||
|
|
||||||
++d->m_progress;
|
++d->m_progress;
|
||||||
d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, msgProgress(d->m_progress, d->m_maxProgress));
|
d->m_progressFutureInterface->setProgressValueAndText(d->m_progress*100, msgProgress(d->m_progress, d->m_maxProgress));
|
||||||
decrementActiveBuildSteps(d->m_currentBuildStep->buildConfiguration()->target()->project());
|
decrementActiveBuildSteps(d->m_currentBuildStep->buildConfiguration()->target()->project());
|
||||||
@@ -420,8 +415,8 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps)
|
|||||||
BuildStep *bs = steps.at(i);
|
BuildStep *bs = steps.at(i);
|
||||||
connect(bs, SIGNAL(addTask(ProjectExplorer::Task)),
|
connect(bs, SIGNAL(addTask(ProjectExplorer::Task)),
|
||||||
this, SLOT(addToTaskWindow(ProjectExplorer::Task)));
|
this, SLOT(addToTaskWindow(ProjectExplorer::Task)));
|
||||||
connect(bs, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat)),
|
connect(bs, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat, ProjectExplorer::BuildStep::OutputNewlineSetting)),
|
||||||
this, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat)));
|
this, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat, ProjectExplorer::BuildStep::OutputNewlineSetting)));
|
||||||
init = bs->init();
|
init = bs->init();
|
||||||
if (!init)
|
if (!init)
|
||||||
break;
|
break;
|
||||||
@@ -437,13 +432,8 @@ bool BuildManager::buildQueueAppend(QList<BuildStep *> steps)
|
|||||||
addToOutputWindow(tr("When executing build step '%1'").arg(bs->displayName()), BuildStep::ErrorOutput);
|
addToOutputWindow(tr("When executing build step '%1'").arg(bs->displayName()), BuildStep::ErrorOutput);
|
||||||
|
|
||||||
// disconnect the buildsteps again
|
// disconnect the buildsteps again
|
||||||
for (int j = 0; j <= i; ++j) {
|
for (int j = 0; j <= i; ++j)
|
||||||
BuildStep *bs = steps.at(j);
|
disconnectOutput(steps.at(j));
|
||||||
disconnect(bs, SIGNAL(addTask(ProjectExplorer::Task)),
|
|
||||||
this, SLOT(addToTaskWindow(ProjectExplorer::Task)));
|
|
||||||
disconnect(bs, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat)),
|
|
||||||
this, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat)));
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -535,4 +525,14 @@ void BuildManager::decrementActiveBuildSteps(Project *pro)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BuildManager::disconnectOutput(BuildStep *bs)
|
||||||
|
{
|
||||||
|
disconnect(bs, SIGNAL(addTask(ProjectExplorer::Task)),
|
||||||
|
this, SLOT(addToTaskWindow(ProjectExplorer::Task)));
|
||||||
|
disconnect(bs, SIGNAL(addOutput(QString, ProjectExplorer::BuildStep::OutputFormat,
|
||||||
|
ProjectExplorer::BuildStep::OutputNewlineSetting)),
|
||||||
|
this, SLOT(addToOutputWindow(QString, ProjectExplorer::BuildStep::OutputFormat,
|
||||||
|
ProjectExplorer::BuildStep::OutputNewlineSetting)));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ signals:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addToTaskWindow(const ProjectExplorer::Task &task);
|
void addToTaskWindow(const ProjectExplorer::Task &task);
|
||||||
void addToOutputWindow(const QString &string, ProjectExplorer::BuildStep::OutputFormat);
|
void addToOutputWindow(const QString &string, ProjectExplorer::BuildStep::OutputFormat,
|
||||||
|
ProjectExplorer::BuildStep::OutputNewlineSetting = BuildStep::DoAppendNewline);
|
||||||
|
|
||||||
void nextBuildQueue();
|
void nextBuildQueue();
|
||||||
void progressChanged();
|
void progressChanged();
|
||||||
@@ -102,6 +103,7 @@ private:
|
|||||||
bool buildQueueAppend(QList<BuildStep *> steps);
|
bool buildQueueAppend(QList<BuildStep *> steps);
|
||||||
void incrementActiveBuildSteps(Project *pro);
|
void incrementActiveBuildSteps(Project *pro);
|
||||||
void decrementActiveBuildSteps(Project *pro);
|
void decrementActiveBuildSteps(Project *pro);
|
||||||
|
void disconnectOutput(BuildStep *bs);
|
||||||
|
|
||||||
QScopedPointer<BuildManagerPrivate> d;
|
QScopedPointer<BuildManagerPrivate> d;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -106,14 +106,17 @@ public:
|
|||||||
Target *target() const;
|
Target *target() const;
|
||||||
|
|
||||||
enum OutputFormat { NormalOutput, ErrorOutput, MessageOutput, ErrorMessageOutput };
|
enum OutputFormat { NormalOutput, ErrorOutput, MessageOutput, ErrorMessageOutput };
|
||||||
|
enum OutputNewlineSetting { DoAppendNewline, DontAppendNewline };
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// Add a task.
|
// Add a task.
|
||||||
void addTask(const ProjectExplorer::Task &task);
|
void addTask(const ProjectExplorer::Task &task);
|
||||||
|
|
||||||
// The string is added to the generated output, usually in the output
|
// The string is added to the generated output, usually in the output
|
||||||
// window.
|
// window.
|
||||||
// It should be in plain text, with the format in the parameter
|
// It should be in plain text, with the format in the parameter
|
||||||
void addOutput(const QString &string, ProjectExplorer::BuildStep::OutputFormat format);
|
void addOutput(const QString &string, ProjectExplorer::BuildStep::OutputFormat format,
|
||||||
|
ProjectExplorer::BuildStep::OutputNewlineSetting newlineSetting = DoAppendNewline);
|
||||||
};
|
};
|
||||||
|
|
||||||
class PROJECTEXPLORER_EXPORT IBuildStepFactory :
|
class PROJECTEXPLORER_EXPORT IBuildStepFactory :
|
||||||
@@ -175,5 +178,6 @@ signals:
|
|||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(ProjectExplorer::BuildStep::OutputFormat)
|
Q_DECLARE_METATYPE(ProjectExplorer::BuildStep::OutputFormat)
|
||||||
|
Q_DECLARE_METATYPE(ProjectExplorer::BuildStep::OutputNewlineSetting)
|
||||||
|
|
||||||
#endif // BUILDSTEP_H
|
#endif // BUILDSTEP_H
|
||||||
|
|||||||
@@ -1691,6 +1691,12 @@ void ProjectExplorerPlugin::buildProjectOnly()
|
|||||||
queue(QList<Project *>() << session()->startupProject(), QStringList() << Constants::BUILDSTEPS_BUILD);
|
queue(QList<Project *>() << session()->startupProject(), QStringList() << Constants::BUILDSTEPS_BUILD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProjectExplorerPlugin::buildProject(ProjectExplorer::Project *p)
|
||||||
|
{
|
||||||
|
queue(d->m_session->projectOrder(p),
|
||||||
|
QStringList() << Constants::BUILDSTEPS_BUILD);
|
||||||
|
}
|
||||||
|
|
||||||
void ProjectExplorerPlugin::buildProject()
|
void ProjectExplorerPlugin::buildProject()
|
||||||
{
|
{
|
||||||
queue(d->m_session->projectOrder(session()->startupProject()),
|
queue(d->m_session->projectOrder(session()->startupProject()),
|
||||||
|
|||||||
@@ -124,6 +124,8 @@ public:
|
|||||||
void addExistingFiles(ProjectExplorer::ProjectNode *projectNode, const QStringList &filePaths);
|
void addExistingFiles(ProjectExplorer::ProjectNode *projectNode, const QStringList &filePaths);
|
||||||
void addExistingFiles(const QStringList &filePaths);
|
void addExistingFiles(const QStringList &filePaths);
|
||||||
|
|
||||||
|
void buildProject(ProjectExplorer::Project *p);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void aboutToShowContextMenu(ProjectExplorer::Project *project,
|
void aboutToShowContextMenu(ProjectExplorer::Project *project,
|
||||||
ProjectExplorer::Node *node);
|
ProjectExplorer::Node *node);
|
||||||
|
|||||||
@@ -190,9 +190,10 @@ void AbstractMaemoDeployStep::raiseError(const QString &errorString)
|
|||||||
emit error();
|
emit error();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractMaemoDeployStep::writeOutput(const QString &text, OutputFormat format)
|
void AbstractMaemoDeployStep::writeOutput(const QString &text, OutputFormat format,
|
||||||
|
OutputNewlineSetting newlineSetting)
|
||||||
{
|
{
|
||||||
emit addOutput(text, format);
|
emit addOutput(text, format, newlineSetting);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractMaemoDeployStep::stop()
|
void AbstractMaemoDeployStep::stop()
|
||||||
@@ -377,7 +378,7 @@ void AbstractMaemoDeployStep::handleRemoteStdout(const QString &output)
|
|||||||
switch (m_baseState) {
|
switch (m_baseState) {
|
||||||
case Deploying:
|
case Deploying:
|
||||||
case StopRequested:
|
case StopRequested:
|
||||||
writeOutput(output, NormalOutput);
|
writeOutput(output, NormalOutput, DontAppendNewline);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -391,7 +392,7 @@ void AbstractMaemoDeployStep::handleRemoteStderr(const QString &output)
|
|||||||
switch (m_baseState) {
|
switch (m_baseState) {
|
||||||
case Deploying:
|
case Deploying:
|
||||||
case StopRequested:
|
case StopRequested:
|
||||||
writeOutput(output, ErrorOutput);
|
writeOutput(output, ErrorOutput, DontAppendNewline);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -89,7 +89,8 @@ protected:
|
|||||||
BaseState baseState() const { return m_baseState; }
|
BaseState baseState() const { return m_baseState; }
|
||||||
|
|
||||||
void raiseError(const QString &error);
|
void raiseError(const QString &error);
|
||||||
void writeOutput(const QString &text, OutputFormat = MessageOutput);
|
void writeOutput(const QString &text, OutputFormat format = MessageOutput,
|
||||||
|
OutputNewlineSetting newlineSetting = DoAppendNewline);
|
||||||
void setDeploymentFinished();
|
void setDeploymentFinished();
|
||||||
const AbstractMaemoPackageCreationStep *packagingStep() const;
|
const AbstractMaemoPackageCreationStep *packagingStep() const;
|
||||||
QString deployMountPoint() const;
|
QString deployMountPoint() const;
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ void AbstractMaemoDeployByMountStep::handleMountDebugOutput(const QString &outpu
|
|||||||
ASSERT_BASE_STATE(QList<BaseState>() << Deploying << StopRequested);
|
ASSERT_BASE_STATE(QList<BaseState>() << Deploying << StopRequested);
|
||||||
|
|
||||||
if (m_extendedState != Inactive)
|
if (m_extendedState != Inactive)
|
||||||
writeOutput(output, ErrorOutput);
|
writeOutput(output, ErrorOutput, DontAppendNewline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractMaemoDeployByMountStep::mount()
|
void AbstractMaemoDeployByMountStep::mount()
|
||||||
|
|||||||
@@ -144,11 +144,13 @@ void AbstractMaemoPackageCreationStep::handleBuildOutput()
|
|||||||
QByteArray stdOut = buildProc->readAllStandardOutput();
|
QByteArray stdOut = buildProc->readAllStandardOutput();
|
||||||
stdOut.replace('\0', QByteArray()); // Output contains NUL characters.
|
stdOut.replace('\0', QByteArray()); // Output contains NUL characters.
|
||||||
if (!stdOut.isEmpty())
|
if (!stdOut.isEmpty())
|
||||||
emit addOutput(QString::fromLocal8Bit(stdOut), BuildStep::NormalOutput);
|
emit addOutput(QString::fromLocal8Bit(stdOut), BuildStep::NormalOutput,
|
||||||
|
BuildStep::DontAppendNewline);
|
||||||
QByteArray errorOut = buildProc->readAllStandardError();
|
QByteArray errorOut = buildProc->readAllStandardError();
|
||||||
errorOut.replace('\0', QByteArray());
|
errorOut.replace('\0', QByteArray());
|
||||||
if (!errorOut.isEmpty()) {
|
if (!errorOut.isEmpty()) {
|
||||||
emit addOutput(QString::fromLocal8Bit(errorOut), BuildStep::ErrorOutput);
|
emit addOutput(QString::fromLocal8Bit(errorOut), BuildStep::ErrorOutput,
|
||||||
|
BuildStep::DontAppendNewline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -583,7 +583,7 @@ void S60CreatePackageStep::stdOutput(const QString &line)
|
|||||||
{
|
{
|
||||||
if (m_outputParserChain)
|
if (m_outputParserChain)
|
||||||
m_outputParserChain->stdOutput(line);
|
m_outputParserChain->stdOutput(line);
|
||||||
emit addOutput(line, BuildStep::NormalOutput);
|
emit addOutput(line, BuildStep::NormalOutput, BuildStep::DontAppendNewline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60CreatePackageStep::processReadyReadStdError()
|
void S60CreatePackageStep::processReadyReadStdError()
|
||||||
@@ -599,7 +599,7 @@ void S60CreatePackageStep::stdError(const QString &line)
|
|||||||
{
|
{
|
||||||
if (m_outputParserChain)
|
if (m_outputParserChain)
|
||||||
m_outputParserChain->stdError(line);
|
m_outputParserChain->stdError(line);
|
||||||
emit addOutput(line, BuildStep::ErrorOutput);
|
emit addOutput(line, BuildStep::ErrorOutput, BuildStep::DontAppendNewline);
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60CreatePackageStep::checkForCancel()
|
void S60CreatePackageStep::checkForCancel()
|
||||||
|
|||||||
Reference in New Issue
Block a user