Diffstat (limited to 'noncore/apps/opie-bartender/bartender.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-bartender/bartender.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp index e6cb515..59fc242 100644 --- a/noncore/apps/opie-bartender/bartender.cpp +++ b/noncore/apps/opie-bartender/bartender.cpp | |||
@@ -17,10 +17,11 @@ | |||
17 | #include "bac.h" | 17 | #include "bac.h" |
18 | 18 | ||
19 | #include <qtoolbar.h> | 19 | /* OPIE */ |
20 | #include <qmenubar.h> | 20 | #include <opie2/odebug.h> |
21 | //#include <opie2/colorpopupmenu.h> | ||
22 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
23 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
23 | using namespace Opie::Core; | ||
24 | 24 | ||
25 | /* QT */ | ||
25 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
26 | #include <qdir.h> | 27 | #include <qdir.h> |
@@ -34,5 +35,8 @@ | |||
34 | #include <qlistview.h> | 35 | #include <qlistview.h> |
35 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qtoolbar.h> | ||
38 | #include <qmenubar.h> | ||
36 | 39 | ||
40 | /* STD */ | ||
37 | #include <fcntl.h> | 41 | #include <fcntl.h> |
38 | #include <unistd.h> | 42 | #include <unistd.h> |
@@ -41,5 +45,4 @@ | |||
41 | #include <errno.h> | 45 | #include <errno.h> |
42 | 46 | ||
43 | |||
44 | Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) | 47 | Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) |
45 | : QMainWindow( parent, name, fl ) { | 48 | : QMainWindow( parent, name, fl ) { |
@@ -145,5 +148,5 @@ void Bartender::fillList() { | |||
145 | s = t.readLine(); | 148 | s = t.readLine(); |
146 | if(s.find("#",0,TRUE) != -1) { | 149 | if(s.find("#",0,TRUE) != -1) { |
147 | // qDebug(s.right(s.length()-2)); | 150 | // odebug << s.right(s.length()-2) << oendl; |
148 | item= new QListViewItem( DrinkView, 0 ); | 151 | item= new QListViewItem( DrinkView, 0 ); |
149 | item->setText( 0, s.right(s.length()-2)); | 152 | item->setText( 0, s.right(s.length()-2)); |
@@ -151,5 +154,5 @@ void Bartender::fillList() { | |||
151 | } | 154 | } |
152 | } | 155 | } |
153 | qDebug("there are currently %d of drinks", i); | 156 | odebug << "there are currently " << i << " of drinks" << oendl; |
154 | } | 157 | } |
155 | 158 | ||
@@ -172,5 +175,5 @@ void Bartender::fileNew() { | |||
172 | QString newDrink="\n# "+newName+"\n"; | 175 | QString newDrink="\n# "+newName+"\n"; |
173 | newDrink.append(newIng+"\n"); | 176 | newDrink.append(newIng+"\n"); |
174 | qDebug("writing "+newDrink); | 177 | odebug << "writing "+newDrink << oendl; |
175 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); | 178 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); |
176 | clearList(); | 179 | clearList(); |
@@ -208,5 +211,5 @@ void Bartender::showDrink( QListViewItem *item) { | |||
208 | s2 = t.readLine(); | 211 | s2 = t.readLine(); |
209 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { | 212 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { |
210 | // qDebug(s2); | 213 | // odebug << s2 << oendl; |
211 | showDrinks->MultiLineEdit1->append(s2); | 214 | showDrinks->MultiLineEdit1->append(s2); |
212 | } | 215 | } |
@@ -249,5 +252,5 @@ void Bartender::doSearchByName() { | |||
249 | for ( ; it.current(); ++it ) { | 252 | for ( ; it.current(); ++it ) { |
250 | if ( it.current()->text(0).find( searchForDrinkName, 0, TRUE) != -1 ) { | 253 | if ( it.current()->text(0).find( searchForDrinkName, 0, TRUE) != -1 ) { |
251 | // qDebug( it.current()->text(0)); | 254 | // odebug << it.current()->text(0) << oendl; |
252 | searchList.append(it.current()->text(0)); | 255 | searchList.append(it.current()->text(0)); |
253 | } | 256 | } |
@@ -280,8 +283,8 @@ void Bartender::doSearchByDrink() { | |||
280 | if(s.find("#",0,TRUE) != -1) { | 283 | if(s.find("#",0,TRUE) != -1) { |
281 | lastDrinkName=s.right(s.length()-2); | 284 | lastDrinkName=s.right(s.length()-2); |
282 | // qDebug("last drink name "+lastDrinkName); | 285 | // odebug << "last drink name "+lastDrinkName << oendl; |
283 | } | 286 | } |
284 | else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { | 287 | else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { |
285 | // qDebug("appending "+lastDrinkName); | 288 | // odebug << "appending "+lastDrinkName << oendl; |
286 | searchList.append( lastDrinkName); | 289 | searchList.append( lastDrinkName); |
287 | tempName=lastDrinkName; | 290 | tempName=lastDrinkName; |
@@ -314,5 +317,5 @@ void Bartender::showSearchResult(QStringList &searchList) { | |||
314 | for ( ; it2.current(); ++it2 ) { | 317 | for ( ; it2.current(); ++it2 ) { |
315 | if ( it2.current()->text(0)== result ) { | 318 | if ( it2.current()->text(0)== result ) { |
316 | // qDebug( it2.current()->text(0)); | 319 | // odebug << it2.current()->text(0) << oendl; |
317 | showDrink(it2.current()); | 320 | showDrink(it2.current()); |
318 | } | 321 | } |
@@ -344,5 +347,5 @@ void Bartender::doEdit() { | |||
344 | s2 = t.readLine(); | 347 | s2 = t.readLine(); |
345 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { | 348 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { |
346 | // qDebug(s2); | 349 | // odebug << s2 << oendl; |
347 | newDrinks->MultiLineEdit1->append(s2); | 350 | newDrinks->MultiLineEdit1->append(s2); |
348 | newDrinks->LineEdit1->setText(myDrink); | 351 | newDrinks->LineEdit1->setText(myDrink); |
@@ -371,5 +374,5 @@ void Bartender::doEdit() { | |||
371 | QString newDrink="# "+newName+"\n"; | 374 | QString newDrink="# "+newName+"\n"; |
372 | newDrink.append(newIng+"\n"); | 375 | newDrink.append(newIng+"\n"); |
373 | qDebug("writing "+newDrink); | 376 | odebug << "writing "+newDrink << oendl; |
374 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); | 377 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); |
375 | clearList(); | 378 | clearList(); |
@@ -398,5 +401,5 @@ void Bartender::openCurrentDrink() { | |||
398 | 401 | ||
399 | void Bartender::fileMenuActivated( int item) { | 402 | void Bartender::fileMenuActivated( int item) { |
400 | qDebug("Item %d", item); | 403 | odebug << "Item " << item << "" << oendl; |
401 | switch(item) { | 404 | switch(item) { |
402 | case -3: // new -3 | 405 | case -3: // new -3 |
@@ -419,5 +422,5 @@ void Bartender::fileMenuActivated( int item) { | |||
419 | 422 | ||
420 | void Bartender::editMenuActivated(int item) { | 423 | void Bartender::editMenuActivated(int item) { |
421 | qDebug("Item %d", item); | 424 | odebug << "Item " << item << "" << oendl; |
422 | /* | 425 | /* |
423 | edit -8 | 426 | edit -8 |