forked from qt-creator/qt-creator
qmljseditor: do not complete private properties
Private properties (starting with __) are not offered as completion unless one has already typed __* Change-log: [Qml/JS Support] Do not show properties starting with "__" in auto-completion. Change-Id: Iecf4c2ee5c14f12a45a26479328862d6a50b3ffb Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -974,6 +974,19 @@ struct QmlJSLessThan
|
||||
// -------------------------
|
||||
// QmlJSAssistProposalModel
|
||||
// -------------------------
|
||||
void QmlJSAssistProposalModel::filter(const QString &prefix)
|
||||
{
|
||||
BasicProposalItemListModel::filter(prefix);
|
||||
if (prefix.startsWith(QLatin1String("__")))
|
||||
return;
|
||||
QList<BasicProposalItem *> newCurrentItems;
|
||||
newCurrentItems.reserve(m_currentItems.size());
|
||||
foreach (BasicProposalItem *item, m_currentItems)
|
||||
if (!item->text().startsWith(QLatin1String("__")))
|
||||
newCurrentItems << item;
|
||||
m_currentItems = newCurrentItems;
|
||||
}
|
||||
|
||||
void QmlJSAssistProposalModel::sort()
|
||||
{
|
||||
qSort(currentItems().first, currentItems().second, QmlJSLessThan());
|
||||
|
||||
Reference in New Issue
Block a user