diff options
author | Leandro Melo <leandro.melo@nokia.com> | 2010-12-02 17:02:23 +0100 |
---|---|---|
committer | Leandro Melo <leandro.melo@nokia.com> | 2010-12-08 17:22:13 +0100 |
commit | 1175705bfc8934909db3c74385a17c8d0daba4b3 (patch) | |
tree | 00a4ae81753f9bfba452d66a54f316f9ab2b488a /src/plugins/texteditor/snippets/snippet.h | |
parent | fdbb34adb8a1301d7567d4c70952ab5e0fc85c0c (diff) | |
download | qt-creator-1175705bfc8934909db3c74385a17c8d0daba4b3.tar.gz |
Snippets: Make it easier for plugins to add snippets groups
Groups are no longer enum values but identified from snippet providers.
Diffstat (limited to 'src/plugins/texteditor/snippets/snippet.h')
-rw-r--r-- | src/plugins/texteditor/snippets/snippet.h | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/plugins/texteditor/snippets/snippet.h b/src/plugins/texteditor/snippets/snippet.h index 984da3e7f9..2ec985408b 100644 --- a/src/plugins/texteditor/snippets/snippet.h +++ b/src/plugins/texteditor/snippets/snippet.h @@ -40,18 +40,11 @@ namespace TextEditor { class TEXTEDITOR_EXPORT Snippet { public: - Snippet(const QString &id = QString()); + Snippet(const QString &groupId = QString(), const QString &id = QString()); ~Snippet(); - // Values from this enumeration need to be contiguous (they are used as indexes). - enum Group { - Cpp = 0, - Qml, - PlainText, - GroupSize - }; - const QString &id() const; + const QString &groupId() const; bool isBuiltIn() const; @@ -70,9 +63,6 @@ public: void setIsModified(bool modified); bool isModified() const; - void setGroup(Group group); - Group group() const; - QString generateTip() const; static const QChar kVariableDelimiter; @@ -80,19 +70,13 @@ public: private: bool m_isRemoved; bool m_isModified; + QString m_groupId; QString m_id; // Only built-in snippets have an id. QString m_trigger; QString m_content; QString m_complement; - Group m_group; }; -inline Snippet::Group& operator++(Snippet::Group& group) -{ - group = Snippet::Group(group + 1); - return group; -} - } // TextEditor #endif // SNIPPET_H |