summaryrefslogtreecommitdiff
path: root/noncore/apps/confedit/listviewitemconffile.cpp
Unidiff
Diffstat (limited to 'noncore/apps/confedit/listviewitemconffile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/confedit/listviewitemconffile.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp
index 1ff2c44..2958cf5 100644
--- a/noncore/apps/confedit/listviewitemconffile.cpp
+++ b/noncore/apps/confedit/listviewitemconffile.cpp
@@ -9,9 +9,15 @@
9// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 9// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
10 10
11#include "listviewitemconffile.h" 11#include "listviewitemconffile.h"
12#include "listviewitemconfigentry.h"
13
14/* OPIE */
15#include <opie2/odebug.h>
16using namespace Opie::Core;
17
18/* QT */
12#include <qmessagebox.h> 19#include <qmessagebox.h>
13#include <qtextstream.h> 20#include <qtextstream.h>
14#include "listviewitemconfigentry.h"
15 21
16#define tr QObject::tr 22#define tr QObject::tr
17 23
@@ -19,7 +25,7 @@ ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent)
19 : ListViewItemConf(parent), _valid(false) 25 : ListViewItemConf(parent), _valid(false)
20{ 26{
21 confFileInfo = file; 27 confFileInfo = file;
22// parseFile(); 28 // parseFile();
23 displayText(); 29 displayText();
24} 30}
25 31
@@ -40,8 +46,8 @@ QString ListViewItemConfFile::fileName()
40 46
41void ListViewItemConfFile::parseFile() 47void ListViewItemConfFile::parseFile()
42{ 48{
43 //qDebug("ListViewItemConfFile::parseFile BEGIN"); 49 //odebug << "ListViewItemConfFile::parseFile BEGIN" << oendl;
44 QFile confFile(confFileInfo->absFilePath()); 50 QFile confFile(confFileInfo->absFilePath());
45 if(! confFile.open(IO_ReadOnly)) 51 if(! confFile.open(IO_ReadOnly))
46 QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); 52 QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0);
47 QTextStream t( &confFile ); 53 QTextStream t( &confFile );
@@ -52,7 +58,7 @@ void ListViewItemConfFile::parseFile()
52 while ( !t.atEnd() ) 58 while ( !t.atEnd() )
53 { 59 {
54 s = t.readLine().stripWhiteSpace(); 60 s = t.readLine().stripWhiteSpace();
55 //qDebug( "line: >%s<\n", s.latin1() ); 61 //odebug << "line: >" << s.latin1() << "<\n" << oendl;
56 if (s.contains("<?xml")) 62 if (s.contains("<?xml"))
57 { 63 {
58 _valid = false; 64 _valid = false;
@@ -60,7 +66,7 @@ void ListViewItemConfFile::parseFile()
60 }else 66 }else
61 if ( s[0] == '[' && s[s.length()-1] == ']' ) 67 if ( s[0] == '[' && s[s.length()-1] == ']' )
62 { 68 {
63 // qDebug("got group"+s); 69 // odebug << "got group"+s << oendl;
64 group = s.mid(1,s.length()-2); 70 group = s.mid(1,s.length()-2);
65 if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); 71 if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") );
66 groupItem = new ListViewItemConfigEntry(this, group ); 72 groupItem = new ListViewItemConfigEntry(this, group );
@@ -68,15 +74,15 @@ void ListViewItemConfFile::parseFile()
68 } else 74 } else
69 if ( int pos = s.find('=') ) 75 if ( int pos = s.find('=') )
70 { 76 {
71// qDebug("got key"+s); 77// odebug << "got key"+s << oendl;
72 if (!groupItem) qDebug("PANIK NO GROUP! >%s<",group.latin1()); 78 if (!groupItem) odebug << "PANIK NO GROUP! >" << group.latin1() << "<" << oendl;
73 item = new ListViewItemConfigEntry(this, group, s ); 79 item = new ListViewItemConfigEntry(this, group, s );
74 groupItem->insertItem( item ); 80 groupItem->insertItem( item );
75 } 81 }
76 } 82 }
77 confFile.close(); 83 confFile.close();
78 setExpandable( _valid ); 84 setExpandable( _valid );
79 //qDebug("ListViewItemConfFile::parseFile END"); 85 //odebug << "ListViewItemConfFile::parseFile END" << oendl;
80} 86}
81 87
82 88