void QSnippetEdit::on_leSnippetName_editingFinished() { if ( m_editedSnippet < 0 ) return; QSnippet *snip = m_manager->snippet(m_editedSnippet); snip->setName(leSnippetName->text()); lwSnippets->item(m_editedSnippet + 1)->setText(snip->name()); }
bool QSnippetManager::loadSnippetFromString(const QString& name, const QString& s, const QString& type) { QSnippetPatternLoader *pl = patternLoader(type); QSnippet *snip = pl->loadSnippet(s); if ( snip ) snip->setName(name); addSnippet(snip); return snip; }