forked from qt-creator/qt-creator
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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user