forked from qt-creator/qt-creator
Merge commit 'origin/1.3'
Conflicts: src/plugins/qt4projectmanager/qt4project.cpp
This commit is contained in:
@@ -1124,14 +1124,6 @@ bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &ba
|
||||
m_completionOperator,
|
||||
&replacedDotOperator);
|
||||
|
||||
if (replacedDotOperator) {
|
||||
// Replace . with ->
|
||||
int length = m_editor->position() - m_startPosition + 1;
|
||||
m_editor->setCurPos(m_startPosition - 1);
|
||||
m_editor->replace(length, QLatin1String("->"));
|
||||
++m_startPosition;
|
||||
}
|
||||
|
||||
QList<Symbol *> classObjectCandidates;
|
||||
foreach (const TypeOfExpression::Result &r, classObjectResults) {
|
||||
FullySpecifiedType ty = r.first.simplified();
|
||||
@@ -1150,6 +1142,14 @@ bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &ba
|
||||
}
|
||||
}
|
||||
|
||||
if (replacedDotOperator && ! classObjectCandidates.isEmpty()) {
|
||||
// Replace . with ->
|
||||
int length = m_editor->position() - m_startPosition + 1;
|
||||
m_editor->setCurPos(m_startPosition - 1);
|
||||
m_editor->replace(length, QLatin1String("->"));
|
||||
++m_startPosition;
|
||||
}
|
||||
|
||||
completeClass(classObjectCandidates, context, /*static lookup = */ false);
|
||||
if (! m_completions.isEmpty())
|
||||
return true;
|
||||
|
||||
@@ -62,7 +62,8 @@ using namespace CppTools::Internal;
|
||||
using namespace CPlusPlus;
|
||||
|
||||
CppFindReferences::CppFindReferences(CppTools::CppModelManagerInterface *modelManager)
|
||||
: _modelManager(modelManager),
|
||||
: QObject(modelManager),
|
||||
_modelManager(modelManager),
|
||||
_resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>())
|
||||
{
|
||||
m_watcher.setPendingResultsLimit(1);
|
||||
@@ -249,7 +250,21 @@ static void applyChanges(QTextDocument *doc, const QString &text, const QList<Fi
|
||||
foreach (const Find::SearchResultItem &item, items) {
|
||||
const int blockNumber = item.lineNumber - 1;
|
||||
QTextCursor tc(doc->findBlockByNumber(blockNumber));
|
||||
tc.setPosition(tc.position() + item.searchTermStart);
|
||||
|
||||
const int cursorPosition = tc.position() + item.searchTermStart;
|
||||
|
||||
int cursorIndex = 0;
|
||||
for (; cursorIndex < cursors.size(); ++cursorIndex) {
|
||||
const QTextCursor &tc = cursors.at(cursorIndex);
|
||||
|
||||
if (tc.position() == cursorPosition)
|
||||
break;
|
||||
}
|
||||
|
||||
if (cursorIndex != cursors.size())
|
||||
continue; // skip this change.
|
||||
|
||||
tc.setPosition(cursorPosition);
|
||||
tc.setPosition(tc.position() + item.searchTermLength,
|
||||
QTextCursor::KeepAnchor);
|
||||
cursors.append(tc);
|
||||
@@ -335,6 +350,7 @@ void CppFindReferences::displayResult(int index)
|
||||
|
||||
void CppFindReferences::searchFinished()
|
||||
{
|
||||
_resultWindow->finishSearch();
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user