summaryrefslogtreecommitdiff
path: root/src/plugins/designer/qtcreatorintegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/designer/qtcreatorintegration.cpp')
-rw-r--r--src/plugins/designer/qtcreatorintegration.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp
index 1ed02b4ffa..fbfad6ca16 100644
--- a/src/plugins/designer/qtcreatorintegration.cpp
+++ b/src/plugins/designer/qtcreatorintegration.cpp
@@ -252,15 +252,14 @@ static Function *findDeclaration(const Class *cl, const QString &functionName)
// TODO: remove me, this is taken from cppeditor.cpp. Find some common place for this function
static Document::Ptr findDefinition(Function *functionDeclaration, int *line)
{
- if (CppTools::CppModelManager *cppModelManager = CppTools::CppModelManager::instance()) {
- const Snapshot snapshot = cppModelManager->snapshot();
- CppTools::SymbolFinder symbolFinder;
- if (Function *fun = symbolFinder.findMatchingDefinition(functionDeclaration, snapshot)) {
- if (line)
- *line = fun->line();
-
- return snapshot.document(QString::fromUtf8(fun->fileName(), fun->fileNameLength()));
- }
+ CppTools::CppModelManager *cppModelManager = CppTools::CppModelManager::instance();
+ const Snapshot snapshot = cppModelManager->snapshot();
+ CppTools::SymbolFinder symbolFinder;
+ if (Function *fun = symbolFinder.findMatchingDefinition(functionDeclaration, snapshot)) {
+ if (line)
+ *line = fun->line();
+
+ return snapshot.document(QString::fromUtf8(fun->fileName(), fun->fileNameLength()));
}
return Document::Ptr();