-rw-r--r-- | noncore/apps/confedit/listviewitemconffile.cpp | 9 | ||||
-rw-r--r-- | noncore/apps/confedit/listviewitemconfigentry.cpp | 21 | ||||
-rw-r--r-- | noncore/apps/confedit/listviewitemconfigentry.h | 3 | ||||
-rw-r--r-- | noncore/apps/confedit/mainwindow.cpp | 24 |
4 files changed, 44 insertions, 13 deletions
diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp index a8fd770..858726d 100644 --- a/noncore/apps/confedit/listviewitemconffile.cpp +++ b/noncore/apps/confedit/listviewitemconffile.cpp | |||
@@ -94,4 +94,11 @@ void ListViewItemConfFile::save() | |||
94 | back.close(); | 94 | back.close(); |
95 | |||
96 | 95 | ||
96 | |||
97 | if (!conf.open(IO_WriteOnly)) return; | ||
98 | QTextStream *t = new QTextStream( &conf ); | ||
99 | for (QListViewItem *it = firstChild(); it!=0;it = it->nextSibling()) | ||
100 | { | ||
101 | ((ListViewItemConfigEntry*)it)->save(t); | ||
102 | } | ||
103 | conf.close(); | ||
97 | qDebug("no saveing yet..."); | 104 | qDebug("no saveing yet..."); |
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 | |||
@@ -12,2 +12,3 @@ | |||
12 | #include "listviewitemconffile.h" | 12 | #include "listviewitemconffile.h" |
13 | #include <qtextstream.h> | ||
13 | 14 | ||
@@ -106,2 +107,22 @@ void ListViewItemConfigEntry::changed() | |||
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 |
diff --git a/noncore/apps/confedit/listviewitemconfigentry.h b/noncore/apps/confedit/listviewitemconfigentry.h index d2b331f..1ff0491 100644 --- a/noncore/apps/confedit/listviewitemconfigentry.h +++ b/noncore/apps/confedit/listviewitemconfigentry.h | |||
@@ -18,2 +18,4 @@ | |||
18 | 18 | ||
19 | class QTextStream; | ||
20 | |||
19 | class ListViewItemConfigEntry : public ListViewItemConf { | 21 | class ListViewItemConfigEntry : public ListViewItemConf { |
@@ -34,2 +36,3 @@ public: | |||
34 | virtual void changed(); | 36 | virtual void changed(); |
37 | void save(QTextStream*); | ||
35 | private: | 38 | private: |
diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp index 30dfdf7..47d9518 100644 --- a/noncore/apps/confedit/mainwindow.cpp +++ b/noncore/apps/confedit/mainwindow.cpp | |||
@@ -57,16 +57,16 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
57 | 57 | ||
58 | connect (settingList, SIGNAL( currentChanged(QListViewItem*) ), | 58 | connect(settingList, SIGNAL( pressed(QListViewItem*) ), |
59 | this, SLOT(setCurrent(QListViewItem*))); | 59 | this, SLOT(setCurrent(QListViewItem*))); |
60 | 60 | ||
61 | connect( popupTimer, SIGNAL(timeout()), | 61 | connect( popupTimer, SIGNAL(timeout()), |
62 | this, SLOT(showPopup()) ); | 62 | this, SLOT(showPopup()) ); |
63 | connect( this, SIGNAL( clicked( QListViewItem* ) ), | 63 | connect( settingList, SIGNAL( clicked( QListViewItem* ) ), |
64 | this, SLOT( stopTimer( QListViewItem* ) ) ); | 64 | this, SLOT( stopTimer( QListViewItem* ) ) ); |
65 | 65 | ||
66 | connect( editor->LineEditGroup, SIGNAL( textChanged(const QString&) ), | 66 | connect( editor->LineEditGroup, SIGNAL( textChanged(const QString&) ), |
67 | SLOT( groupChanged(const QString&) ) ); | 67 | SLOT( groupChanged(const QString&) ) ); |
68 | connect( editor->LineEditKey, SIGNAL( textChanged(const QString&) ), | 68 | connect( editor->LineEditKey, SIGNAL( textChanged(const QString&) ), |
69 | SLOT( keyChanged(const QString&) ) ); | 69 | SLOT( keyChanged(const QString&) ) ); |
70 | connect( editor->LineEditValue, SIGNAL( textChanged(const QString&) ), | 70 | connect( editor->LineEditValue, SIGNAL( textChanged(const QString&) ), |
71 | SLOT( valueChanged(const QString&) ) ); | 71 | SLOT( valueChanged(const QString&) ) ); |
72 | makeMenu(); | 72 | makeMenu(); |