summaryrefslogtreecommitdiff
path: root/noncore/apps/confedit/listviewitemconffile.cpp
authortille <tille>2002-07-08 14:12:26 (UTC)
committer tille <tille>2002-07-08 14:12:26 (UTC)
commitc92049007eaf6615a059425073b03a827d11831e (patch) (side-by-side diff)
tree6d4d0b05a597d46eb6969cd728174fa6345a1099 /noncore/apps/confedit/listviewitemconffile.cpp
parent0d6ff4c6b10524943b43240489182138694f2759 (diff)
downloadopie-c92049007eaf6615a059425073b03a827d11831e.zip
opie-c92049007eaf6615a059425073b03a827d11831e.tar.gz
opie-c92049007eaf6615a059425073b03a827d11831e.tar.bz2
parse files when needed
an other oipkg test ;)
Diffstat (limited to 'noncore/apps/confedit/listviewitemconffile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/confedit/listviewitemconffile.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp
index 1f85095..ce6504c 100644
--- a/noncore/apps/confedit/listviewitemconffile.cpp
+++ b/noncore/apps/confedit/listviewitemconffile.cpp
@@ -91,8 +91,7 @@ void ListViewItemConfFile::remove()
void ListViewItemConfFile::revert()
{
- if (_changed)
+ if (!_changed)
{
- parseFile();
- }else{
+ // read the backup file
QFile conf(confFileInfo->absFilePath());
QFile back(backupFileName());
@@ -107,4 +106,6 @@ void ListViewItemConfFile::revert()
back.close();
}
+ parseFile();
+ expand();
}
@@ -148,4 +149,12 @@ QString ListViewItemConfFile::backupFileName()
void ListViewItemConfFile::expand()
{
+ QListViewItem *subItem = firstChild();
+ QListViewItem *toDel;
+ while(subItem)
+ {
+ toDel = subItem;
+ subItem = subItem->nextSibling();
+ delete toDel;
+ }
parseFile();
}