forked from qt-creator/qt-creator
Merge remote branch 'origin/1.3'
Conflicts: src/libs/cplusplus/CheckUndefinedSymbols.cpp src/plugins/qmleditor/qmlcodecompletion.cpp
This commit is contained in:
@@ -105,7 +105,7 @@ int QmlCodeCompletion::startCompletion(TextEditor::ITextEditable *editor)
|
||||
continue;
|
||||
|
||||
TextEditor::CompletionItem item(this);
|
||||
item.m_text = word;
|
||||
item.text = word;
|
||||
m_completions.append(item);
|
||||
}
|
||||
}
|
||||
@@ -154,9 +154,9 @@ void QmlCodeCompletion::completions(QList<TextEditor::CompletionItem> *completio
|
||||
const QRegExp regExp(keyRegExp, Qt::CaseSensitive);
|
||||
|
||||
foreach (TextEditor::CompletionItem item, m_completions) {
|
||||
if (regExp.indexIn(item.m_text) == 0) {
|
||||
item.m_relevance = (key.length() > 0 &&
|
||||
item.m_text.startsWith(key, Qt::CaseInsensitive)) ? 1 : 0;
|
||||
if (regExp.indexIn(item.text) == 0) {
|
||||
item.relevance = (key.length() > 0 &&
|
||||
item.text.startsWith(key, Qt::CaseInsensitive)) ? 1 : 0;
|
||||
(*completions) << item;
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ void QmlCodeCompletion::completions(QList<TextEditor::CompletionItem> *completio
|
||||
|
||||
void QmlCodeCompletion::complete(const TextEditor::CompletionItem &item)
|
||||
{
|
||||
const QString toInsert = item.m_text;
|
||||
const QString toInsert = item.text;
|
||||
const int length = m_editor->position() - m_startPosition;
|
||||
m_editor->setCurPos(m_startPosition);
|
||||
m_editor->replace(length, toInsert);
|
||||
@@ -178,8 +178,8 @@ bool QmlCodeCompletion::partiallyComplete(const QList<TextEditor::CompletionItem
|
||||
return true;
|
||||
} else {
|
||||
// Compute common prefix
|
||||
QString firstKey = completionItems.first().m_text;
|
||||
QString lastKey = completionItems.last().m_text;
|
||||
QString firstKey = completionItems.first().text;
|
||||
QString lastKey = completionItems.last().text;
|
||||
const int length = qMin(firstKey.length(), lastKey.length());
|
||||
firstKey.truncate(length);
|
||||
lastKey.truncate(length);
|
||||
|
||||
Reference in New Issue
Block a user