Skip to content

Commit

Permalink
Use set for tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jul 6, 2021
1 parent 4acc1bd commit 2fc4799
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/gui/codeeditors/qgscodeeditorsql.cpp
Expand Up @@ -111,23 +111,23 @@ void QgsCodeEditorSQL::updateApis()

QStringList QgsCodeEditorSQL::extraKeywords() const
{
return mExtraKeywords;
return mExtraKeywords.values();
}

void QgsCodeEditorSQL::setExtraKeywords( const QStringList &extraKeywords )
{
mExtraKeywords = extraKeywords;
mExtraKeywords = extraKeywords.toSet();
updateApis();
}

QStringList QgsCodeEditorSQL::fieldNames() const
{
return mFieldNames;
return mFieldNames.values();
}

void QgsCodeEditorSQL::setFieldNames( const QStringList &fieldNames )
{
mFieldNames = fieldNames;
mFieldNames = fieldNames.toSet();
updateApis();
}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/codeeditors/qgscodeeditorsql.h
Expand Up @@ -90,9 +90,9 @@ class GUI_EXPORT QgsCodeEditorSQL : public QgsCodeEditor
void updateApis();
QsciAPIs *mApis = nullptr;
QsciLexerSQL *mSqlLexer = nullptr;
QStringList mExtraKeywords;
QSet<QString> mExtraKeywords;

QStringList mFieldNames;
QSet<QString> mFieldNames;

friend class TestQgsQueryResultWidget;
};
Expand Down

0 comments on commit 2fc4799

Please sign in to comment.