From c92049007eaf6615a059425073b03a827d11831e Mon Sep 17 00:00:00 2001 From: tille Date: Mon, 08 Jul 2002 14:12:26 +0000 Subject: parse files when needed an other oipkg test ;) --- (limited to 'noncore/apps') 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 @@ -90,10 +90,9 @@ void ListViewItemConfFile::remove() void ListViewItemConfFile::revert() { - if (_changed) + if (!_changed) { - parseFile(); - }else{ + // read the backup file QFile conf(confFileInfo->absFilePath()); QFile back(backupFileName()); @@ -106,6 +105,8 @@ void ListViewItemConfFile::revert() conf.close(); back.close(); } + parseFile(); + expand(); } void ListViewItemConfFile::save() @@ -147,5 +148,13 @@ QString ListViewItemConfFile::backupFileName() void ListViewItemConfFile::expand() { + QListViewItem *subItem = firstChild(); + QListViewItem *toDel; + while(subItem) + { + toDel = subItem; + subItem = subItem->nextSibling(); + delete toDel; + } parseFile(); } diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp index 6de8741..c91c846 100644 --- a/noncore/apps/confedit/mainwindow.cpp +++ b/noncore/apps/confedit/mainwindow.cpp @@ -73,6 +73,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : SLOT( valueChanged(const QString&) ) ); setCurrent(0); + editor->layoutType(EditWidget::File); } void MainWindow::makeMenu() -- cgit v0.9.0.2