diff options
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/windows/functionseditormodel.h')
| -rw-r--r-- | SQLiteStudio3/guiSQLiteStudio/windows/functionseditormodel.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/windows/functionseditormodel.h b/SQLiteStudio3/guiSQLiteStudio/windows/functionseditormodel.h index 7caf06c..2f90bcc 100644 --- a/SQLiteStudio3/guiSQLiteStudio/windows/functionseditormodel.h +++ b/SQLiteStudio3/guiSQLiteStudio/windows/functionseditormodel.h @@ -60,17 +60,28 @@ class GUI_API_EXPORT FunctionsEditorModel : public QAbstractListModel QList<FunctionManager::ScriptFunction*> generateFunctions() const; QStringList getFunctionNames() const; void validateNames(); - bool isAllowedName(int rowToSkip, const QString& nameToValidate); + bool isAllowedName(int rowToSkip, const QString& nameToValidate, const QStringList &argList, bool undefinedArgs); bool isValidRowIndex(int row) const; int rowCount(const QModelIndex& parent = QModelIndex()) const; QVariant data(const QModelIndex& index, int role) const; private: + struct UniqueFunctionName + { + QString name; + QStringList arguments; + bool undefArg; + + int argCount() const; + bool operator==(const UniqueFunctionName& other) const; + }; + struct Function { Function(); Function(FunctionManager::ScriptFunction* other); + UniqueFunctionName toUniqueName() const; FunctionManager::ScriptFunction data; bool modified = false; @@ -80,6 +91,9 @@ class GUI_API_EXPORT FunctionsEditorModel : public QAbstractListModel void init(); void emitDataChanged(int row); + QList<UniqueFunctionName> getUniqueFunctionNames() const; + + friend int qHash(FunctionsEditorModel::UniqueFunctionName fnName); QList<Function*> functionList; @@ -96,4 +110,6 @@ class GUI_API_EXPORT FunctionsEditorModel : public QAbstractListModel bool listModified = false; }; +int qHash(FunctionsEditorModel::UniqueFunctionName fnName); + #endif // FUNCTIONSEDITORMODEL_H |
