author | tille <tille> | 2002-07-07 17:18:50 (UTC) |
---|---|---|
committer | tille <tille> | 2002-07-07 17:18:50 (UTC) |
commit | 04f29267e391eb4ad7ff9fc86468f6ccd1bd8f6d (patch) (side-by-side diff) | |
tree | 91ed01ce29ec4dfd478f75239f874a22d1672a14 /noncore/apps/confedit/listviewitemconffile.cpp | |
parent | a72877e867e70784e3c865fa2948ac40f72b5c39 (diff) | |
download | opie-04f29267e391eb4ad7ff9fc86468f6ccd1bd8f6d.zip opie-04f29267e391eb4ad7ff9fc86468f6ccd1bd8f6d.tar.gz opie-04f29267e391eb4ad7ff9fc86468f6ccd1bd8f6d.tar.bz2 |
better layout
Diffstat (limited to 'noncore/apps/confedit/listviewitemconffile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/confedit/listviewitemconffile.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp index 228421b..1f85095 100644 --- a/noncore/apps/confedit/listviewitemconffile.cpp +++ b/noncore/apps/confedit/listviewitemconffile.cpp @@ -19,9 +19,9 @@ ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent) : ListViewItemConf(parent), _valid(false) { confFileInfo = file; - parseFile(); +// parseFile(); displayText(); } ListViewItemConfFile::~ListViewItemConfFile() @@ -40,8 +40,9 @@ QString ListViewItemConfFile::fileName() } void ListViewItemConfFile::parseFile() { + //qDebug("ListViewItemConfFile::parseFile BEGIN"); QFile confFile(confFileInfo->absFilePath()); if(! confFile.open(IO_ReadOnly)) QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); QTextStream t( &confFile ); @@ -51,9 +52,9 @@ void ListViewItemConfFile::parseFile() ListViewItemConfigEntry *item; while ( !t.atEnd() ) { s = t.readLine().stripWhiteSpace(); - // qDebug( "line: >%s<\n", s.latin1() ); + //qDebug( "line: >%s<\n", s.latin1() ); if (s.contains("<?xml")) { _valid = false; break; @@ -61,21 +62,23 @@ void ListViewItemConfFile::parseFile() if ( s[0] == '[' && s[s.length()-1] == ']' ) { // qDebug("got group"+s); group = s.mid(1,s.length()-2); + if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); groupItem = new ListViewItemConfigEntry(this, group ); insertItem( groupItem ); } else if ( int pos = s.find('=') ) { - // qDebug("got key"+s); +// qDebug("got key"+s); + if (!groupItem) qDebug("PANIK NO GROUP! >%s<",group.latin1()); item = new ListViewItemConfigEntry(this, group, s ); groupItem->insertItem( item ); } } confFile.close(); - unchanged(); setExpandable( _valid ); +// qDebug("ListViewItemConfFile::parseFile END"); } void ListViewItemConfFile::remove() @@ -139,4 +142,10 @@ bool ListViewItemConfFile::revertable() QString ListViewItemConfFile::backupFileName() { return confFileInfo->absFilePath()+"~"; } + + +void ListViewItemConfFile::expand() +{ + parseFile(); +} |