Diffstat (limited to 'noncore/apps/confedit/listviewitemconfigentry.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/confedit/listviewitemconfigentry.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/noncore/apps/confedit/listviewitemconfigentry.cpp b/noncore/apps/confedit/listviewitemconfigentry.cpp index 77ce17d..b947514 100644 --- a/noncore/apps/confedit/listviewitemconfigentry.cpp +++ b/noncore/apps/confedit/listviewitemconfigentry.cpp @@ -16,12 +16,15 @@ ListViewItemConfigEntry::ListViewItemConfigEntry(ListViewItemConfFile *parent, Q : ListViewItemConf(parent) { _fileItem = parent; _file = parent->fileName(); _group = group; setKey(key); + _groupOrig = group; + _keyOrig = _key; + _valueOrig = _value; _fileItem->unchanged(); } ListViewItemConfigEntry::~ListViewItemConfigEntry() { } @@ -104,12 +107,18 @@ void ListViewItemConfigEntry::changed() { _changed=true; displayText(); _fileItem->changed(); } + +void ListViewItemConfigEntry::remove() +{ + delete this; +} + void ListViewItemConfigEntry::save(QTextStream *t) { QString s; if (isGroup()) { s += "["+_group+"]"; @@ -122,7 +131,16 @@ void ListViewItemConfigEntry::save(QTextStream *t) (*t) << s; _changed = false; for (QListViewItem *it = firstChild(); it!=0;it = it->nextSibling()) { ((ListViewItemConfigEntry*)it)->save(t); } +} + +void ListViewItemConfigEntry::revert() +{ + _group = _groupOrig; + _key = _keyOrig; + _value = _valueOrig; + _changed=false; + displayText(); }
\ No newline at end of file |