Commit bc137f36 authored by David Schulz's avatar David Schulz
Browse files

Editor: Removed useless local variable.



No need to create local variables for pointers
which are used just once.

Change-Id: If917689019ac1319b9f9d3aee8fa15ec5a34d751
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent a1ef043b
...@@ -929,9 +929,6 @@ int CppCompletionAssistProcessor::startCompletionHelper() ...@@ -929,9 +929,6 @@ int CppCompletionAssistProcessor::startCompletionHelper()
&m_model->m_completionOperator, &m_model->m_completionOperator,
/*want function call =*/ true); /*want function call =*/ true);
const Core::IDocument *document = m_interface->document();
QString fileName = document->fileName();
if (m_model->m_completionOperator == T_DOXY_COMMENT) { if (m_model->m_completionOperator == T_DOXY_COMMENT) {
for (int i = 1; i < T_DOXY_LAST_TAG; ++i) for (int i = 1; i < T_DOXY_LAST_TAG; ++i)
addCompletionItem(QString::fromLatin1(doxygenTagSpell(i)), m_icons.keywordIcon()); addCompletionItem(QString::fromLatin1(doxygenTagSpell(i)), m_icons.keywordIcon());
...@@ -1003,6 +1000,7 @@ int CppCompletionAssistProcessor::startCompletionHelper() ...@@ -1003,6 +1000,7 @@ int CppCompletionAssistProcessor::startCompletionHelper()
int line = 0, column = 0; int line = 0, column = 0;
Convenience::convertPosition(m_interface->textDocument(), startOfExpression, &line, &column); Convenience::convertPosition(m_interface->textDocument(), startOfExpression, &line, &column);
const QString fileName = m_interface->document()->fileName();
return startCompletionInternal(fileName, line, column, expression, endOfExpression); return startCompletionInternal(fileName, line, column, expression, endOfExpression);
} }
...@@ -1231,8 +1229,7 @@ bool CppCompletionAssistProcessor::objcKeywordsWanted() const ...@@ -1231,8 +1229,7 @@ bool CppCompletionAssistProcessor::objcKeywordsWanted() const
if (!m_objcEnabled) if (!m_objcEnabled)
return false; return false;
const Core::IDocument *document = m_interface->document(); const QString fileName = m_interface->document()->fileName();
QString fileName = document->fileName();
const Core::MimeDatabase *mdb = Core::ICore::mimeDatabase(); const Core::MimeDatabase *mdb = Core::ICore::mimeDatabase();
return mdb->findByFile(fileName).type() == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE); return mdb->findByFile(fileName).type() == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment