diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/cppeditor/cppfollowsymbolundercursor.cpp | 10 | ||||
-rw-r--r-- | src/plugins/cpptools/cppmodelmanagerinterface.cpp | 5 | ||||
-rw-r--r-- | src/plugins/cpptools/cppmodelmanagerinterface.h | 1 | ||||
-rw-r--r-- | src/plugins/cpptools/cppsnapshotupdater.cpp | 3 |
4 files changed, 14 insertions, 5 deletions
diff --git a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp index bd2acf05ab..ad4a8c3012 100644 --- a/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp +++ b/src/plugins/cppeditor/cppfollowsymbolundercursor.cpp @@ -454,16 +454,18 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor & const QByteArray name = CPPEditorWidget::identifierUnderCursor(¯oCursor).toLatin1(); if (macro->name() == name) return link; //already on definition! - } else { - const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1); - if (use && use->macro().fileName() != CppModelManagerInterface::configurationFileName()) { + } else if (const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1)) { + const QString fileName = use->macro().fileName(); + if (fileName == CppModelManagerInterface::editorConfigurationFileName()) { + m_widget->showPreProcessorWidget(); + } else if (fileName != CppModelManagerInterface::configurationFileName()) { const Macro ¯o = use->macro(); link.targetFileName = macro.fileName(); link.targetLine = macro.line(); link.linkTextStart = use->begin(); link.linkTextEnd = use->end(); - return link; } + return link; } // Find the last symbol up to the cursor position diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.cpp b/src/plugins/cpptools/cppmodelmanagerinterface.cpp index e2a7c6f10e..31f1b55e18 100644 --- a/src/plugins/cpptools/cppmodelmanagerinterface.cpp +++ b/src/plugins/cpptools/cppmodelmanagerinterface.cpp @@ -175,6 +175,11 @@ static CppModelManagerInterface *g_instance = 0; const QString CppModelManagerInterface::configurationFileName() { return CPlusPlus::Preprocessor::configurationFileName; } +const QString CppModelManagerInterface::editorConfigurationFileName() +{ + return QLatin1String("<per-editor-defines>"); +} + CppModelManagerInterface::CppModelManagerInterface(QObject *parent) : QObject(parent) { diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.h b/src/plugins/cpptools/cppmodelmanagerinterface.h index eacfa6f756..bb6787bd2f 100644 --- a/src/plugins/cpptools/cppmodelmanagerinterface.h +++ b/src/plugins/cpptools/cppmodelmanagerinterface.h @@ -216,6 +216,7 @@ public: public: static const QString configurationFileName(); + static const QString editorConfigurationFileName(); public: CppModelManagerInterface(QObject *parent = 0); diff --git a/src/plugins/cpptools/cppsnapshotupdater.cpp b/src/plugins/cpptools/cppsnapshotupdater.cpp index cf4a7cec74..4b3e9fedb4 100644 --- a/src/plugins/cpptools/cppsnapshotupdater.cpp +++ b/src/plugins/cpptools/cppsnapshotupdater.cpp @@ -138,7 +138,8 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy) workingCopy.insert(configurationFileName, m_configFile); m_snapshot.remove(m_fileInEditor); - static const QString editorDefinesFileName = QLatin1String("<per-editor-defines>"); + static const QString editorDefinesFileName + = CppModelManagerInterface::editorConfigurationFileName(); if (editorDefinesChanged) { m_snapshot.remove(editorDefinesFileName); workingCopy.insert(editorDefinesFileName, m_editorDefines); |