diff options
author | Eike Ziller <eike.ziller@digia.com> | 2014-06-13 10:51:51 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2014-06-13 10:51:51 +0200 |
commit | 2786250c172138c1ece456305264f7b5039b8f2a (patch) | |
tree | dd0a56d98aefe9e1c6a3042b5cbcc37e87bd903b /src | |
parent | e9d433a99a8fa4769df92f9caaaaaec049596c34 (diff) | |
parent | 27cc89eb4a1e157c68793718602416448547de20 (diff) | |
download | qt-creator-2786250c172138c1ece456305264f7b5039b8f2a.tar.gz |
Merge remote-tracking branch 'origin/3.1'
Conflicts:
qtcreator.pri
qtcreator.qbs
src/shared/qbs
Change-Id: Iba59e41db72e2afdf594f1f7003215d7d8d1e6d3
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Parser.cpp | 12 | ||||
-rw-r--r-- | src/plugins/coreplugin/documentmanager.cpp | 18 | ||||
-rw-r--r-- | src/plugins/coreplugin/documentmanager.h | 1 | ||||
-rw-r--r-- | src/plugins/coreplugin/editormanager/editormanager.cpp | 5 | ||||
-rw-r--r-- | src/plugins/coreplugin/locator/basefilefilter.cpp | 4 | ||||
-rw-r--r-- | src/plugins/coreplugin/locator/locator_test.cpp | 6 | ||||
-rw-r--r-- | src/plugins/cpaster/pasteview.cpp | 4 | ||||
-rw-r--r-- | src/plugins/cpptools/cppcompletion_test.cpp | 14 | ||||
-rw-r--r-- | src/plugins/projectexplorer/miniprojecttargetselector.cpp | 12 | ||||
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakenodes.cpp | 4 | ||||
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakeproject.cpp | 4 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourcenode.cpp | 2 | ||||
-rw-r--r-- | src/shared/help/topicchooser.cpp | 1 | ||||
-rw-r--r-- | src/shared/proparser/qmakeevaluator.cpp | 14 |
14 files changed, 57 insertions, 44 deletions
diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp index 35d8d917a0..876b138b6a 100644 --- a/src/libs/3rdparty/cplusplus/Parser.cpp +++ b/src/libs/3rdparty/cplusplus/Parser.cpp @@ -2003,12 +2003,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; @@ -2025,6 +2019,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/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index a983fc237f..fcf6a15be9 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::IContext*>,Core::Context)), - this, SLOT(syncWithEditor(QList<Core::IContext*>))); qApp->installEventFilter(this); readSettings(); @@ -1129,22 +1127,6 @@ void DocumentManager::checkForReload() // dump(); } -void DocumentManager::syncWithEditor(const QList<Core::IContext *> &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 de1616d09f..3dafb60271 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<Core::IContext *> &context); private: explicit DocumentManager(QObject *parent); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 129054b342..5ddf0b12d2 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -526,6 +526,8 @@ void EditorManager::handleContextChange(const QList<Core::IContext *> &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) 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<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<Core::Loca updateFiles(); QList<LocatorFilterEntry> betterEntries; QList<LocatorFilterEntry> 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; 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)); diff --git a/src/plugins/cpaster/pasteview.cpp b/src/plugins/cpaster/pasteview.cpp index 1bf9dee9a4..c7c90d90e6 100644 --- a/src/plugins/cpaster/pasteview.cpp +++ b/src/plugins/cpaster/pasteview.cpp @@ -31,6 +31,7 @@ #include "protocol.h" #include <coreplugin/icore.h> +#include <utils/qtcassert.h> #include <QPushButton> #include <QSettings> @@ -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 diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 1169ab7714..51f3359101 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -1857,6 +1857,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" diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 7d864413dc..75e677485f 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(); diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 7011ff819b..5601f92eca 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -1070,7 +1070,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 && context->projectNode() == this ? 120 : 90); } bool QmakePriFileNode::priFileWritable(const QString &path) @@ -1577,7 +1577,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 && context->projectNode() == this ? 120 : 100); } bool QmakeProFileNode::showInSimpleTree(QmakeProjectType projectType) const diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index b8e39bff09..162baf7d9f 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -58,6 +58,7 @@ #include <qtsupport/profilereader.h> #include <qtsupport/qtkitinformation.h> #include <qtsupport/uicodemodelsupport.h> +#include <resourceeditor/resourcenode.h> #include <QDebug> #include <QDir> @@ -255,6 +256,9 @@ void ProjectFilesVisitor::visitProjectNode(ProjectNode *projectNode) void ProjectFilesVisitor::visitFolderNode(FolderNode *folderNode) { + if (qobject_cast<ResourceEditor::ResourceTopLevelNode *>(folderNode)) + m_files->files[ResourceType].push_back(folderNode->path()); + foreach (FileNode *fileNode, folderNode->fileNodes()) { const QString path = fileNode->path(); const int type = fileNode->fileType(); diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index 1820c20a61..e27915a665 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -266,7 +266,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<ResourceFolderNode *>(context)) - if (rfn->prefix() == QLatin1String("/")) + if (rfn->prefix() == QLatin1String("/") && rfn->parentFolderNode() == this) p = 150; } diff --git a/src/shared/help/topicchooser.cpp b/src/shared/help/topicchooser.cpp index ec9dde695c..5a58811ed2 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 <b>%1</b>:").arg(keyword)); 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); |