Diffstat (limited to 'noncore/apps/confedit/listviewitemconfigentry.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/confedit/listviewitemconfigentry.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/noncore/apps/confedit/listviewitemconfigentry.cpp b/noncore/apps/confedit/listviewitemconfigentry.cpp index 16be46e..77ce17d 100644 --- a/noncore/apps/confedit/listviewitemconfigentry.cpp +++ b/noncore/apps/confedit/listviewitemconfigentry.cpp | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include "listviewitemconfigentry.h" | 11 | #include "listviewitemconfigentry.h" |
12 | #include "listviewitemconffile.h" | 12 | #include "listviewitemconffile.h" |
13 | #include <qtextstream.h> | ||
13 | 14 | ||
14 | ListViewItemConfigEntry::ListViewItemConfigEntry(ListViewItemConfFile *parent, QString group, QString key) | 15 | ListViewItemConfigEntry::ListViewItemConfigEntry(ListViewItemConfFile *parent, QString group, QString key) |
15 | : ListViewItemConf(parent) | 16 | : ListViewItemConf(parent) |
@@ -104,4 +105,24 @@ void ListViewItemConfigEntry::changed() | |||
104 | _changed=true; | 105 | _changed=true; |
105 | displayText(); | 106 | displayText(); |
106 | _fileItem->changed(); | 107 | _fileItem->changed(); |
108 | } | ||
109 | |||
110 | void ListViewItemConfigEntry::save(QTextStream *t) | ||
111 | { | ||
112 | QString s; | ||
113 | if (isGroup()) | ||
114 | { | ||
115 | s += "["+_group+"]"; | ||
116 | _type = Group; | ||
117 | }else{ | ||
118 | s += _key+" = "+_value; | ||
119 | _type = Key; | ||
120 | } | ||
121 | s += "\n"; | ||
122 | (*t) << s; | ||
123 | _changed = false; | ||
124 | for (QListViewItem *it = firstChild(); it!=0;it = it->nextSibling()) | ||
125 | { | ||
126 | ((ListViewItemConfigEntry*)it)->save(t); | ||
127 | } | ||
107 | } \ No newline at end of file | 128 | } \ No newline at end of file |