From cf6e4b8dcbc42adc3c3717728edcaf7952f1784b Mon Sep 17 00:00:00 2001 From: Andreas Pakulat Date: Mon, 2 Jun 2014 10:37:17 +0200 Subject: Fix matching of partial paths on Windows The paths against which the match is done always have forward slashes (i.e. uniform separator on all platforms). However the needle passed in has backward slashes on Windows usually, since this is how the paths are shown to the users and what is natural on windows too. Even explicitly using forward slash in the needle does not work here, since then the needle is not detected as containing a path (hasPathSeparator is false since it uses the native separator). Since it seems that the code internally favors the 'uniform' separators using slashes, simply convert the needle from native to uniform separators and use the forward slash to decide whether the needle has a path in it. Side effect of this is that it is now possible to use forward slashes when typing into the locator UI on windows. The opposite does not work on Unix though. That could be considered a feature though for cross-platform developers. Task-number: QTCREATORBUG-12007 Change-Id: I5064bd9c60936466dd04671ef42a578df26ea7b8 Reviewed-by: David Schulz --- src/plugins/coreplugin/locator/basefilefilter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/coreplugin/locator/basefilefilter.cpp b/src/plugins/coreplugin/locator/basefilefilter.cpp index 920f5b570d..ff6afc088d 100644 --- a/src/plugins/coreplugin/locator/basefilefilter.cpp +++ b/src/plugins/coreplugin/locator/basefilefilter.cpp @@ -49,14 +49,14 @@ QList BaseFileFilter::matchesFor(QFutureInterface betterEntries; QList goodEntries; - QString needle = trimWildcards(origEntry); + QString needle = trimWildcards(QDir::fromNativeSeparators(origEntry)); const QString lineNoSuffix = EditorManager::splitLineNumber(&needle); QStringMatcher matcher(needle, Qt::CaseInsensitive); const QChar asterisk = QLatin1Char('*'); QRegExp regexp(asterisk + needle+ asterisk, Qt::CaseInsensitive, QRegExp::Wildcard); if (!regexp.isValid()) return betterEntries; - const QChar pathSeparator = QDir::separator(); + const QChar pathSeparator(QLatin1Char('/')); const bool hasPathSeparator = needle.contains(pathSeparator); const bool hasWildcard = needle.contains(asterisk) || needle.contains(QLatin1Char('?')); QStringList searchListPaths; -- cgit v1.2.1 From e017a1dc8b2030e509d6198315e9f6a9869667e7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 22 May 2014 15:21:36 +0200 Subject: avoid that a bad qmakespec path crashes the evaluator assigning a relative path to QMAKESPEC or QMAKESPEC_ORIGINAL (in the qt4 windows legacy code) would lead to an assert further down the line. just ignore such attempts silently. Task-number: QTCREATORBUG-8477 Change-Id: Ie53d0ef004c743284b85de4e89f112e0161ff4b7 Reviewed-by: Daniel Teske --- src/shared/proparser/qmakeevaluator.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp index 0cefb493e2..262985f174 100644 --- a/src/shared/proparser/qmakeevaluator.cpp +++ b/src/shared/proparser/qmakeevaluator.cpp @@ -914,8 +914,11 @@ void QMakeEvaluator::visitProVariable( m_featureRoots = 0; else if (varName == statics.strQMAKESPEC) { if (!values(varName).isEmpty()) { - m_qmakespec = values(varName).first().toQString(); - m_featureRoots = 0; + QString spec = values(varName).first().toQString(); + if (IoUtils::isAbsolutePath(spec)) { + m_qmakespec = spec; + m_featureRoots = 0; + } } } #ifdef PROEVALUATOR_FULL @@ -1129,8 +1132,11 @@ bool QMakeEvaluator::loadSpecInternal() // the source of the qmake.conf at the end of the default/qmake.conf in // the QMAKESPEC_ORIGINAL variable. const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL")); - if (!orig_spec.isEmpty()) - m_qmakespec = orig_spec.toQString(); + if (!orig_spec.isEmpty()) { + QString spec = orig_spec.toQString(); + if (IoUtils::isAbsolutePath(spec)) + m_qmakespec = spec; + } # endif #endif valuesRef(ProKey("QMAKESPEC")) = ProString(m_qmakespec); -- cgit v1.2.1 From e8e4df0ff93cfef2fb7256aec3a9e5b6720fd679 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 3 Jun 2014 09:53:25 +0200 Subject: Core: Fix locator file filter test. Use forward slashes as separator in the test data. Change-Id: Ib832f0c72dc1694b2b2e230e32a274b96956c44b Reviewed-by: Christian Stenger --- src/plugins/coreplugin/locator/locator_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/plugins/coreplugin/locator/locator_test.cpp b/src/plugins/coreplugin/locator/locator_test.cpp index c7b59288c4..c9bcdb880b 100644 --- a/src/plugins/coreplugin/locator/locator_test.cpp +++ b/src/plugins/coreplugin/locator/locator_test.cpp @@ -105,9 +105,9 @@ void Core::Internal::CorePlugin::test_basefilefilter_data() const QChar pathSeparator = QDir::separator(); const MyTestDataDir testDir(QLatin1String("testdata_basic")); const QStringList testFiles = QStringList() - << QDir::toNativeSeparators(testDir.file(QLatin1String("file.cpp"))) - << QDir::toNativeSeparators(testDir.file(QLatin1String("main.cpp"))) - << QDir::toNativeSeparators(testDir.file(QLatin1String("subdir/main.cpp"))); + << QDir::fromNativeSeparators(testDir.file(QLatin1String("file.cpp"))) + << QDir::fromNativeSeparators(testDir.file(QLatin1String("main.cpp"))) + << QDir::fromNativeSeparators(testDir.file(QLatin1String("subdir/main.cpp"))); QStringList testFilesShort; foreach (const QString &file, testFiles) testFilesShort << Utils::FileUtils::shortNativePath(Utils::FileName::fromString(file)); -- cgit v1.2.1 From 712b13f60771e7dff77514e220748f087cde43d3 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Mon, 2 Jun 2014 15:09:25 +0200 Subject: ResourceNode: Fix matching on '/' node A ResourceTopLevelNode should only prioritize it's own child '/' node. Task-number: QTCREATORBUG-12297 Change-Id: Ia9834d7111622d4558e1a2c21b602b11ff5db139 Reviewed-by: Eike Ziller --- src/plugins/resourceeditor/resourcenode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index c2ca90a436..40299b0735 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -256,7 +256,7 @@ ProjectExplorer::FolderNode::AddNewInformation ResourceTopLevelNode::addNewInfor // two nodes would be responsible for '/' // Thus also return a high priority for it if (ResourceFolderNode *rfn = qobject_cast(context)) - if (rfn->prefix() == QLatin1String("/")) + if (rfn->prefix() == QLatin1String("/") && rfn->parentFolderNode() == this) p = 150; } -- cgit v1.2.1 From bd197fbb77c5cfcf3b80951cb6f07f8579306084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 19 May 2014 09:16:34 +0200 Subject: Prevent flicker on MiniProjectTargetSelector show Reproducible on Mac OS X. Set position before changing the visible state. Change-Id: I8a7e73dae94ceb865ea8a7ef4cec4112220888de Reviewed-by: Daniel Teske Reviewed-by: Eike Ziller --- src/plugins/projectexplorer/miniprojecttargetselector.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 269290f11f..f8b9f9a12a 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -852,7 +852,7 @@ void MiniProjectTargetSelector::doLayout(bool keepSize) int oldSummaryLabelY = m_summaryLabel->y(); - int kitAreaHeight = m_kitAreaWidget->isVisible() ? m_kitAreaWidget->sizeHint().height() : 0; + int kitAreaHeight = m_kitAreaWidget->isVisibleTo(this) ? m_kitAreaWidget->sizeHint().height() : 0; // 1. Calculate the summary label height int summaryLabelY = 1 + kitAreaHeight; @@ -959,11 +959,9 @@ void MiniProjectTargetSelector::doLayout(bool keepSize) setFixedSize(m_summaryLabel->width() + 1, heightWithoutKitArea + kitAreaHeight); //1 extra pixel for the border } - if (isVisibleTo(parentWidget())) { - QPoint moveTo = statusBar->mapToGlobal(QPoint(0,0)); - moveTo -= QPoint(0, height()); - move(moveTo); - } + QPoint moveTo = statusBar->mapToGlobal(QPoint(0,0)); + moveTo -= QPoint(0, height()); + move(moveTo); } void MiniProjectTargetSelector::setActiveTarget(ProjectExplorer::ProjectConfiguration *pc) @@ -1403,10 +1401,10 @@ void MiniProjectTargetSelector::activeRunConfigurationChanged(ProjectExplorer::R void MiniProjectTargetSelector::setVisible(bool visible) { + doLayout(false); QWidget::setVisible(visible); m_projectAction->setChecked(visible); if (visible) { - doLayout(false); if (!focusWidget() || !focusWidget()->isVisibleTo(this)) { // Does the second part actually work? if (m_projectListWidget->isVisibleTo(this)) m_projectListWidget->setFocus(); -- cgit v1.2.1 From 6c473db09772c4626e046fd692f53d55ecb275da Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 3 Jun 2014 15:06:16 +0200 Subject: Fix setting DocumentManager::currentFile when clicking into split This broke when introducing delayed setting of the currentEditor when the context changes. Simply move the logic from the document manager to the editor manager, where it arguably belongs to anyway, and also set the currentFile delayed in that case. Task-number: QTCREATORBUG-12264 Change-Id: I67ee3f9a02e62cfa67671629c956a4290361cba8 Reviewed-by: Daniel Teske Reviewed-by: David Schulz --- src/plugins/coreplugin/documentmanager.cpp | 18 ------------------ src/plugins/coreplugin/documentmanager.h | 1 - src/plugins/coreplugin/editormanager/editormanager.cpp | 5 +++++ 3 files changed, 5 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 7e68576cc1..384e9f4070 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -216,8 +216,6 @@ DocumentManager::DocumentManager(QObject *parent) { d = new DocumentManagerPrivate; m_instance = this; - connect(ICore::instance(), SIGNAL(contextChanged(QList,Core::Context)), - this, SLOT(syncWithEditor(QList))); qApp->installEventFilter(this); readSettings(); @@ -1129,22 +1127,6 @@ void DocumentManager::checkForReload() // dump(); } -void DocumentManager::syncWithEditor(const QList &context) -{ - if (context.isEmpty()) - return; - - Core::IEditor *editor = Core::EditorManager::currentEditor(); - if (!editor || editor->document()->isTemporary()) - return; - foreach (IContext *c, context) { - if (editor->widget() == c->widget()) { - setCurrentFile(editor->document()->filePath()); - break; - } - } -} - /*! Adds the \a fileName to the list of recent files. Associates the file to be reopened with the editor that has the specified \a editorId, if possible. diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h index 1144a15d29..8fe47ba508 100644 --- a/src/plugins/coreplugin/documentmanager.h +++ b/src/plugins/coreplugin/documentmanager.h @@ -163,7 +163,6 @@ private slots: void checkForNewFileName(); void checkForReload(); void changedFile(const QString &file); - void syncWithEditor(const QList &context); private: explicit DocumentManager(QObject *parent); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 3b130c5120..172f98f3cc 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -526,6 +526,8 @@ void EditorManager::handleContextChange(const QList &context) d->m_scheduledCurrentEditor = editor; QTimer::singleShot(0, m_instance, SLOT(setCurrentEditorFromContextChange())); } else { + if (editor && !editor->document()->isTemporary()) + DocumentManager::setCurrentFile(editor->document()->filePath()); updateActions(); } } @@ -1027,6 +1029,9 @@ void EditorManager::setCurrentEditorFromContextChange() IEditor *newCurrent = d->m_scheduledCurrentEditor; d->m_scheduledCurrentEditor = 0; setCurrentEditor(newCurrent); + if (!newCurrent->document()->isTemporary()) + DocumentManager::setCurrentFile(newCurrent->document()->filePath()); + } void EditorManager::closeEditor(Core::IEditor *editor, bool askAboutModifiedEditors) -- cgit v1.2.1 From aae1abdaccb274bc5e88ca83b6da2c8330722955 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 5 Jun 2014 10:14:37 +0200 Subject: Help: Fix filtering in topic chooser Probably broke with a74de6af81b659ef0dcbbbe25f94d9b527c2be98 Change-Id: I6df2b7ae88d6bd337cd110d6788dbb68ca73eb16 Reviewed-by: Karsten Heimrich --- src/shared/help/topicchooser.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/shared/help/topicchooser.cpp b/src/shared/help/topicchooser.cpp index 308a316f27..7964b1a277 100644 --- a/src/shared/help/topicchooser.cpp +++ b/src/shared/help/topicchooser.cpp @@ -44,6 +44,7 @@ TopicChooser::TopicChooser(QWidget *parent, const QString &keyword, ui.setupUi(this); setFocusProxy(ui.lineEdit); + ui.lineEdit->setFiltering(true); ui.lineEdit->installEventFilter(this); ui.lineEdit->setPlaceholderText(tr("Filter")); ui.label->setText(tr("Choose a topic for %1:").arg(keyword)); -- cgit v1.2.1 From b90452e309dfeb308fd9b82b4fce8f32588caeb4 Mon Sep 17 00:00:00 2001 From: Przemyslaw Gorszkowski Date: Thu, 5 Jun 2014 09:05:41 +0200 Subject: C++: fix nested anonymous with __attribute__ Task-number: QTCREATORBUG-12345 Change-Id: Ib2316ebdc81393b38185b9cb659fb85b78753e7b Reviewed-by: Nikolai Kosjar Reviewed-by: Eike Ziller --- src/libs/3rdparty/cplusplus/Parser.cpp | 12 ++++++------ src/plugins/cpptools/cppcompletion_test.cpp | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp index bf19628fd2..dfdc260f6e 100644 --- a/src/libs/3rdparty/cplusplus/Parser.cpp +++ b/src/libs/3rdparty/cplusplus/Parser.cpp @@ -1988,12 +1988,6 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node) NameAST *name = 0; parseName(name); - if (! name && LA() == T_LBRACE && (LA(0) == T_CLASS || LA(0) == T_STRUCT || LA(0) == T_UNION || LA(0) == T_ENUM)) { - AnonymousNameAST *ast = new (_pool) AnonymousNameAST; - ast->class_token = classkey_token; - name = ast; - } - bool parsed = false; const bool previousInFunctionBody = _inFunctionBody; @@ -2010,6 +2004,12 @@ bool Parser::parseClassSpecifier(SpecifierListAST *&node) } if (LA() == T_COLON || LA() == T_LBRACE) { + if (!name) { + AnonymousNameAST *ast = new (_pool) AnonymousNameAST; + ast->class_token = classkey_token; + name = ast; + } + BaseSpecifierListAST *base_clause_list = 0; if (LA() == T_COLON) { diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 8679d3120a..0dde60e9f9 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -1856,6 +1856,20 @@ void CppToolsPlugin::test_completion_data() << QLatin1String("val2") << QLatin1String("val3")); + QTest::newRow("nested_anonymous_with___attribute__") << _( + "struct Enclosing\n" + "{\n" + " struct __attribute__((aligned(8)))\n" + " {\n" + " int i;\n" + " };\n" + "};\n" + "Enclosing e;\n" + "@\n" + ) << _("e.") << (QStringList() + << QLatin1String("Enclosing") + << QLatin1String("i")); + QTest::newRow("enum_inside_namespace") << _( "namespace Ns\n" "{\n" -- cgit v1.2.1 From cc64529fc4af97028a7fb195fc95a33fc9671f54 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 6 Jun 2014 15:25:55 +0200 Subject: CodePaster: Do not crash in case of invalid default protocol Task-number: QTCREATORBUG-12364 Change-Id: I6e9bf75dd6b8df187a6802e9d90c3d986cc86a5c Reviewed-by: Friedemann Kleint --- src/plugins/cpaster/pasteview.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/plugins/cpaster/pasteview.cpp b/src/plugins/cpaster/pasteview.cpp index 47a656984f..d196f66040 100644 --- a/src/plugins/cpaster/pasteview.cpp +++ b/src/plugins/cpaster/pasteview.cpp @@ -31,6 +31,7 @@ #include "protocol.h" #include +#include #include #include @@ -112,6 +113,7 @@ void PasteView::contentChanged() void PasteView::protocolChanged(int p) { + QTC_ASSERT(p >= 0 && p < m_protocols.size(), return); const unsigned caps = m_protocols.at(p)->capabilities(); m_ui.uiDescription->setEnabled(caps & Protocol::PostDescriptionCapability); m_ui.uiUsername->setEnabled(caps & Protocol::PostUserNameCapability); @@ -215,6 +217,8 @@ void PasteView::accept() void PasteView::setProtocol(const QString &protocol) { const int index = m_ui.protocolBox->findText(protocol); + if (index < 0) + return; m_ui.protocolBox->setCurrentIndex(index); if (index == m_ui.protocolBox->currentIndex()) protocolChanged(index); // Force enabling -- cgit v1.2.1 From 8496dad5d750ea745671e4aa8d18a8c114ce47cc Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 6 Jun 2014 15:34:38 +0200 Subject: QMake: Fix missing qrc files in locator/search/... The QMake project didn't put them into files() anymore since qrc nodes where made folders. Change-Id: I8e9354699cfccc4fdd4f5ce39baa30a9d61ce051 Reviewed-by: Daniel Teske --- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index d78f806467..fb186875ca 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -255,6 +256,9 @@ void ProjectFilesVisitor::visitProjectNode(ProjectNode *projectNode) void ProjectFilesVisitor::visitFolderNode(FolderNode *folderNode) { + if (qobject_cast(folderNode)) + m_files->files[ResourceType].push_back(folderNode->path()); + foreach (FileNode *fileNode, folderNode->fileNodes()) { const QString path = fileNode->path(); const int type = fileNode->fileType(); -- cgit v1.2.1 From a3dd4be35ad8082caf09b99d6db765b42dd2089e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 10 Jun 2014 15:34:53 +0200 Subject: Update qbs submodule. To the head of the 1.2 branch. Change-Id: I3646c499af05fc0488d6e712b99b9a53636ca935 Reviewed-by: Joerg Bornemann --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/shared/qbs b/src/shared/qbs index b300372f7e..a52f265fcd 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit b300372f7e6bb106e8b77adebaa40bfbfebebd3a +Subproject commit a52f265fcd70b51acc15b0fc5000014f1b1fed29 -- cgit v1.2.1 From 2ad3147542a45436733ddd7014993bcc3022a654 Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Mon, 2 Jun 2014 16:00:07 +0200 Subject: QmakeNodes::addNewInformation: Be responsible subfolder nodes And increase the priority for those too. Fixes the case: a.pro b.pri test c.pri Right click on test and add new file. In that case b.pri should be the node to which the file is added. Task-number: QTCREATORBUG-12272 Change-Id: I54d144861bc06545db8e71ed33513a0df971dae2 Reviewed-by: Eike Ziller --- src/plugins/qmakeprojectmanager/qmakenodes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 58762fbb7f..b0f7044190 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -1069,7 +1069,7 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil ProjectExplorer::FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const { Q_UNUSED(files) - return ProjectExplorer::FolderNode::AddNewInformation(QFileInfo(path()).fileName(), context == this ? 120 : 90); + return ProjectExplorer::FolderNode::AddNewInformation(QFileInfo(path()).fileName(), context->projectNode() == this ? 120 : 90); } bool QmakePriFileNode::priFileWritable(const QString &path) @@ -1576,7 +1576,7 @@ bool QmakeProFileNode::showInSimpleTree() const ProjectExplorer::FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const { Q_UNUSED(files) - return AddNewInformation(QFileInfo(path()).fileName(), context == this ? 120 : 100); + return AddNewInformation(QFileInfo(path()).fileName(), context->projectNode() == this ? 120 : 100); } bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const -- cgit v1.2.1 From 5933136b199d14530d20feea7182ecb83503f5cf Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 13 Jun 2014 08:52:23 +0200 Subject: Fix crash when adding files from window menu Introduced by 2ad3147542a45436733ddd7014993bcc3022a654 Task-number: QTCREATORBUG-12409 Change-Id: I422d315c5b9d22052251a0869d314adff7741af0 Sanity-Review: Qt Sanity Bot Reviewed-by: Christian Stenger --- src/plugins/qmakeprojectmanager/qmakenodes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index b0f7044190..369121c95e 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -1069,7 +1069,7 @@ bool QmakePriFileNode::renameFile(const QString &filePath, const QString &newFil ProjectExplorer::FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringList &files, Node *context) const { Q_UNUSED(files) - return ProjectExplorer::FolderNode::AddNewInformation(QFileInfo(path()).fileName(), context->projectNode() == this ? 120 : 90); + return ProjectExplorer::FolderNode::AddNewInformation(QFileInfo(path()).fileName(), context && context->projectNode() == this ? 120 : 90); } bool QmakePriFileNode::priFileWritable(const QString &path) @@ -1576,7 +1576,7 @@ bool QmakeProFileNode::showInSimpleTree() const ProjectExplorer::FolderNode::AddNewInformation QmakeProFileNode::addNewInformation(const QStringList &files, Node *context) const { Q_UNUSED(files) - return AddNewInformation(QFileInfo(path()).fileName(), context->projectNode() == this ? 120 : 100); + return AddNewInformation(QFileInfo(path()).fileName(), context && context->projectNode() == this ? 120 : 100); } bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const -- cgit v1.2.1