Snippets: Make it easier for plugins to add snippets groups

Groups are no longer enum values but identified from snippet providers.
This commit is contained in:
Leandro Melo
2010-12-02 17:02:23 +01:00
parent fdbb34adb8
commit 1175705bfc
32 changed files with 411 additions and 272 deletions

View File

@@ -37,7 +37,8 @@ using namespace TextEditor;
const QChar Snippet::kVariableDelimiter(QLatin1Char('$'));
Snippet::Snippet(const QString &id) : m_isRemoved(false), m_isModified(false), m_id(id)
Snippet::Snippet(const QString &groupId, const QString &id) :
m_isRemoved(false), m_isModified(false), m_groupId(groupId), m_id(id)
{}
Snippet::~Snippet()
@@ -48,6 +49,11 @@ const QString &Snippet::id() const
return m_id;
}
const QString &Snippet::groupId() const
{
return m_groupId;
}
bool Snippet::isBuiltIn() const
{
return !m_id.isEmpty();
@@ -103,16 +109,6 @@ bool Snippet::isModified() const
return m_isModified;
}
void Snippet::setGroup(Group group)
{
m_group = group;
}
Snippet::Group Snippet::group() const
{
return m_group;
}
QString Snippet::generateTip() const
{
static const QLatin1Char kNewLine('\n');