Diffstat (limited to 'noncore/apps/confedit/listviewitemconfigentry.cpp') (more/less context) (show 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 | |||
@@ -7,12 +7,13 @@ | |||
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> | 9 | // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> |
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) |
16 | { | 17 | { |
17 | _fileItem = parent; | 18 | _fileItem = parent; |
18 | _file = parent->fileName(); | 19 | _file = parent->fileName(); |
@@ -102,6 +103,26 @@ void ListViewItemConfigEntry::displayText() | |||
102 | void ListViewItemConfigEntry::changed() | 103 | void ListViewItemConfigEntry::changed() |
103 | { | 104 | { |
104 | _changed=true; | 105 | _changed=true; |
105 | displayText(); | 106 | displayText(); |
106 | _fileItem->changed(); | 107 | _fileItem->changed(); |
107 | } \ No newline at end of file | 108 | } \ No newline at end of file |
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 | } | ||
128 | } \ No newline at end of file | ||