author | erik <erik> | 2007-01-29 21:53:48 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-29 21:53:48 (UTC) |
commit | 02ef45be75a3024df11365956e1cce6392d9103c (patch) (side-by-side diff) | |
tree | 42fd5c909d67a473f57a607e01d32e01b3dd2511 /noncore/apps/confedit/listviewitemconffile.cpp | |
parent | b2c306a99b8dc82c981390f02db859149fac8cf0 (diff) | |
download | opie-02ef45be75a3024df11365956e1cce6392d9103c.zip opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.gz opie-02ef45be75a3024df11365956e1cce6392d9103c.tar.bz2 |
Each file in this commit has an issue where the initial value of a variable
is assumed to be something but no initial value is given.
This commit changes that by either assigning an initial value or removing
the assumption on an initial value (usually the former).
Diffstat (limited to 'noncore/apps/confedit/listviewitemconffile.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/confedit/listviewitemconffile.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp index 2958cf5..a7d6b00 100644 --- a/noncore/apps/confedit/listviewitemconffile.cpp +++ b/noncore/apps/confedit/listviewitemconffile.cpp @@ -50,10 +50,11 @@ void ListViewItemConfFile::parseFile() 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 ); QString s; QString group; - ListViewItemConfigEntry *groupItem; + ListViewItemConfigEntry *groupItem = 0; ListViewItemConfigEntry *item; while ( !t.atEnd() ) { @@ -63,19 +64,23 @@ void ListViewItemConfFile::parseFile() { _valid = false; break; - }else - if ( s[0] == '[' && s[s.length()-1] == ']' ) + } + else if ( s[0] == '[' && s[s.length()-1] == ']' ) { // odebug << "got group"+s << oendl; group = s.mid(1,s.length()-2); - if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); + if (!groupItem) + groupItem = new ListViewItemConfigEntry(this, tr("no group") ); + groupItem = new ListViewItemConfigEntry(this, group ); insertItem( groupItem ); - } else - if ( int pos = s.find('=') ) + } + else if ( int pos = s.find('=') ) { // odebug << "got key"+s << oendl; - if (!groupItem) odebug << "PANIK NO GROUP! >" << group.latin1() << "<" << oendl; + if (!groupItem) + odebug << "PANIC! no group >" << group.latin1() << "<" << oendl; + item = new ListViewItemConfigEntry(this, group, s ); groupItem->insertItem( item ); } |