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:
Fawzi Mohamed
2013-02-11 13:27:59 +01:00
parent 234b4bd928
commit d078c31bfa
4 changed files with 17 additions and 3 deletions

View File

@@ -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());