summaryrefslogtreecommitdiff
path: root/src/plugins/projectexplorer
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/projectexplorer')
-rw-r--r--src/plugins/projectexplorer/buildsettingspropertiespage.cpp3
-rw-r--r--src/plugins/projectexplorer/projectnodes.cpp5
-rw-r--r--src/plugins/projectexplorer/projectnodes.h2
-rw-r--r--src/plugins/projectexplorer/projecttreewidget.cpp8
-rw-r--r--src/plugins/projectexplorer/taskhub.cpp2
5 files changed, 15 insertions, 5 deletions
diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp
index c3e3548b5e..adfcc54c28 100644
--- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp
+++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp
@@ -240,7 +240,8 @@ void BuildSettingsWidget::updateBuildSettings()
// Add pages
NamedWidget *generalConfigWidget = m_buildConfiguration->createConfigWidget();
- addSubWidget(generalConfigWidget);
+ if (generalConfigWidget)
+ addSubWidget(generalConfigWidget);
addSubWidget(new BuildStepsPage(m_buildConfiguration, Core::Id(Constants::BUILDSTEPS_BUILD)));
addSubWidget(new BuildStepsPage(m_buildConfiguration, Core::Id(Constants::BUILDSTEPS_CLEAN)));
diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp
index 696ca553e8..f493856ce9 100644
--- a/src/plugins/projectexplorer/projectnodes.cpp
+++ b/src/plugins/projectexplorer/projectnodes.cpp
@@ -102,6 +102,11 @@ QString Node::path() const
return m_path;
}
+int Node::line() const
+{
+ return -1;
+}
+
QString Node::displayName() const
{
return QFileInfo(path()).fileName();
diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h
index 0b2f2e0945..bc1e13774c 100644
--- a/src/plugins/projectexplorer/projectnodes.h
+++ b/src/plugins/projectexplorer/projectnodes.h
@@ -85,6 +85,7 @@ public:
ProjectNode *projectNode() const; // managing project
FolderNode *parentFolderNode() const; // parent folder or project
QString path() const; // file system path
+ virtual int line() const;
virtual QString displayName() const;
virtual QString vcsTopic() const;
virtual QString tooltip() const;
@@ -331,7 +332,6 @@ private:
friend class Node;
};
-
} // namespace ProjectExplorer
// HACK: THERE SHOULD BE ONE PLACE TO MAKE THE FILE ENDING->FILE TYPE ASSOCIATION
diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp
index 8e72e423cb..0da156558e 100644
--- a/src/plugins/projectexplorer/projecttreewidget.cpp
+++ b/src/plugins/projectexplorer/projecttreewidget.cpp
@@ -40,6 +40,7 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
+#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/icontext.h>
#include <utils/qtcassert.h>
@@ -374,8 +375,11 @@ void ProjectTreeWidget::initView()
void ProjectTreeWidget::openItem(const QModelIndex &mainIndex)
{
Node *node = m_model->nodeForIndex(mainIndex);
- if (node->nodeType() == FileNodeType)
- EditorManager::openEditor(node->path(), Id(), EditorManager::ModeSwitch);
+ if (node->nodeType() != FileNodeType)
+ return;
+ Core::IEditor *editor = Core::EditorManager::openEditor(node->path(), Core::Id(), Core::EditorManager::ModeSwitch);
+ if (node->line() >= 0)
+ editor->gotoLine(node->line());
}
void ProjectTreeWidget::setProjectFilter(bool filter)
diff --git a/src/plugins/projectexplorer/taskhub.cpp b/src/plugins/projectexplorer/taskhub.cpp
index 99200097f1..0f505a7f51 100644
--- a/src/plugins/projectexplorer/taskhub.cpp
+++ b/src/plugins/projectexplorer/taskhub.cpp
@@ -102,7 +102,7 @@ void TaskHub::addCategory(const Core::Id &categoryId, const QString &displayName
void TaskHub::addTask(Task task)
{
- if (task.line != -1 && !task.file.isEmpty()) {
+ if (task.line >= 0 && !task.file.isEmpty()) {
bool visible = (task.type == Task::Warning || task.type == Task::Error);
TaskMark *mark = new TaskMark(task.taskId, task.file.toString(), task.line, visible);
mark->setIcon(taskTypeIcon(task.type));