author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/tools | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
-rw-r--r-- | noncore/tools/calc2/engine.cpp | 10 | ||||
-rw-r--r-- | noncore/tools/calculator/calculator.pro | 4 | ||||
-rw-r--r-- | noncore/tools/calculator/calculatorimpl.cpp | 11 | ||||
-rw-r--r-- | noncore/tools/formatter/formatter.cpp | 36 | ||||
-rw-r--r-- | noncore/tools/formatter/formatter.pro | 10 |
5 files changed, 40 insertions, 31 deletions
diff --git a/noncore/tools/calc2/engine.cpp b/noncore/tools/calc2/engine.cpp index a9a47c4..e843e29 100644 --- a/noncore/tools/calc2/engine.cpp +++ b/noncore/tools/calc2/engine.cpp @@ -101,7 +101,7 @@ void Engine::pushValue (char v) }; if (!ok) { state = sError; - qDebug("pushValue() - num->string conversion"); + odebug << "pushValue() - num->string conversion" << oendl; } else { const QString constString = displayString; emit(display(constString)); @@ -127,7 +127,7 @@ void Engine::del () num.dbl=displayString.toDouble(&ok); break; case rFraction: - qDebug("not available"); + odebug << "not available" << oendl; break; default: displayString.truncate(displayString.length()); @@ -136,7 +136,7 @@ void Engine::del () if (!ok) { state = sError; - qDebug("del() - num->string conversion"); + odebug << "del() - num->string conversion" << oendl; } else { const QString constString = displayString; emit(display(constString)); @@ -149,7 +149,7 @@ void Engine::displayData(Data d) { displayString.setNum(d.dbl); break; case rFraction: - qDebug("fractional display not yet impl"); + odebug << "fractional display not yet impl" << oendl; break; default: displayString.setNum(d.i, calcBase()); @@ -172,7 +172,7 @@ int Engine::calcBase () { return 16; default: state = sError; - qDebug("Error - attempt to calc base for non-integer"); + odebug << "Error - attempt to calc base for non-integer" << oendl; return 10; }; } diff --git a/noncore/tools/calculator/calculator.pro b/noncore/tools/calculator/calculator.pro index ae6a666..78d4519 100644 --- a/noncore/tools/calculator/calculator.pro +++ b/noncore/tools/calculator/calculator.pro @@ -1,8 +1,8 @@ -CONFIG = qt warn_on quick-app +CONFIG = qt warn_on quick-app HEADERS = calculatorimpl.h SOURCES = calculatorimpl.cpp \ main.cpp -INCLUDEPATH += $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopiecore2 INTERFACES = calculator.ui diff --git a/noncore/tools/calculator/calculatorimpl.cpp b/noncore/tools/calculator/calculatorimpl.cpp index dead03d..05cb9b5 100644 --- a/noncore/tools/calculator/calculatorimpl.cpp +++ b/noncore/tools/calculator/calculatorimpl.cpp @@ -26,10 +26,14 @@ #include "calculatorimpl.h" +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/resource.h> #include <qpe/qmath.h> #include <qpe/qpeapplication.h> +using namespace Opie::Core; +/* QT */ #include <qpushbutton.h> #include <qcombobox.h> #include <qlabel.h> @@ -39,7 +43,10 @@ #include <qfile.h> #include <qtextstream.h> #include <qmessagebox.h> + +/* STD */ #include <math.h> + /* XPM */ static char *oneoverx_xpm[] = { /* width height num_colors chars_per_pixel */ @@ -233,7 +240,7 @@ CalculatorImpl::CalculatorImpl( QWidget * parent, const char * name, tmp += "etc/unit_conversion.dat"; QFile myfile(tmp); if ( !myfile.open( IO_Translate | IO_ReadOnly ) ) { - qDebug("Data file unit_conversion.dat not found\nNo conversion features will be available\n"+tmp); + odebug << "Data file unit_conversion.dat not found\nNo conversion features will be available\n"+tmp << oendl; // disable the f button if no conv file available ComboBoxFunction->setEnabled(FALSE); } @@ -507,7 +514,7 @@ void CalculatorImpl::execOp( Operation i ) return; processStack( oAdd ); if ( operationStack.top().operation != oOpenBrace ) - qDebug( "Calculator: internal Error" ); + odebug << "Calculator: internal Error" << oendl; operationStack.pop(); state = sNewNumber; numOpenBraces--; diff --git a/noncore/tools/formatter/formatter.cpp b/noncore/tools/formatter/formatter.cpp index 4204d73..642196e 100644 --- a/noncore/tools/formatter/formatter.cpp +++ b/noncore/tools/formatter/formatter.cpp @@ -11,13 +11,14 @@ #include "output.h" /* OPIE */ -#include <qtoolbar.h> +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qpe/config.h> #include <qpe/mimetype.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/storage.h> +using namespace Opie::Core; /* QT */ #include <qmenubar.h> @@ -35,6 +36,7 @@ #include <qlabel.h> #include <qlineedit.h> #include <qpushbutton.h> +#include <qtoolbar.h> #include <qtabwidget.h> #include <qwidget.h> #include <qlayout.h> @@ -238,12 +240,12 @@ void FormatterApp::doFormat() outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); sleep(1); - qDebug("Command is "+umountS); + odebug << "Command is "+umountS << oendl; fp = popen( (const char *) umountS, "r"); - // qDebug("%d", fp); + // odebug << "" << fp << "" << oendl; if ( !fp ) { - qDebug("Could not execute '" + umountS + "'! err=%d\n" +(QString)strerror(errno), err); + odebug << "Could not execute '" + umountS + "'! err=" << err << "\n" +(QString)strerror(errno) << oendl; QMessageBox::warning( this, tr("Formatter"), tr("umount failed!"), tr("&OK") ); pclose(fp); return; @@ -256,7 +258,7 @@ void FormatterApp::doFormat() { if( ((QString)line).find("busy",0,TRUE) != -1) { - qDebug("Could not find '" + umountS); + odebug << "Could not find '" + umountS << oendl; QMessageBox::warning( this, tr("Formatter"), tr("Could not umount.\nDevice is busy!"), tr("&OK") ); pclose(fp); return; @@ -272,7 +274,7 @@ void FormatterApp::doFormat() } pclose(fp); - qDebug("Command would be: "+cmd); + odebug << "Command would be: "+cmd << oendl; outDlg->OutputEdit->append( tr("Trying to format.") ); outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); @@ -281,7 +283,7 @@ void FormatterApp::doFormat() { if( ((QString)line).find("No such device",0,TRUE) != -1) { - qDebug("No such device '" + umountS); + odebug << "No such device '" + umountS << oendl; QMessageBox::warning( this, tr("Formatter"), tr("No such device!"), tr("&OK") ); pclose(fp); // outDlg->OutputEdit->append("No such device"); @@ -305,7 +307,7 @@ void FormatterApp::doFormat() fp = popen( (const char *) remountS, "r"); if ( !fp) { - qDebug("Could not execute '" + remountS + "'! err=%d\n" +(QString)strerror(errno), err); + odebug << "Could not execute '" + remountS + "'! err=" << err << "\n" +(QString)strerror(errno) << oendl; QMessageBox::warning( this, tr("Formatter"), tr("Card mount failed!"), tr("&OK") ); } @@ -380,7 +382,7 @@ void FormatterApp::storageComboSelected(int index ) currentText = currentText.right( currentText.length() - currentText.find(" -> ",0,TRUE) - 4); QString fsType = getFileSystemType((const QString &) currentText); - // qDebug(fsType); + // odebug << fsType << oendl; for(int i = 0; i < fileSystemsCombo->count(); i++) { if( fsType == fileSystemsCombo->text(i)) @@ -464,7 +466,7 @@ void FormatterApp::parsetab(const QString &fileName) & filesystemType.find("auto",0,TRUE) == -1) fsList << filesystemType; deviceList << deviceName; - qDebug(deviceName+"::"+filesystemType); + odebug << deviceName+"::"+filesystemType << oendl; fileSystemTypeList << deviceName+"::"+filesystemType; } } @@ -506,7 +508,7 @@ QString FormatterApp::getFileSystemType(const QString ¤tText) if( temp.find( currentText,0,TRUE) != -1) { return temp.right( temp.length() - temp.find("::",0,TRUE) - 2); - // qDebug(fsType); + // odebug << fsType << oendl; } } return ""; @@ -533,7 +535,7 @@ bool FormatterApp::doFsck() QString fsType = getFileSystemType((const QString &)selectedDevice); QString cmd; - qDebug( selectedDevice +" "+ fsType); + odebug << selectedDevice +" "+ fsType << oendl; if(fsType == "vfat") cmd = "dosfsck -vy "; if(fsType == "ext2") cmd = "e2fsck -cpvy "; cmd += selectedDevice + " 2>&1"; @@ -547,12 +549,12 @@ bool FormatterApp::doFsck() outDlg->OutputEdit->setCursorPosition(outDlg->OutputEdit->numLines() + 1,0,FALSE); sleep(1); - // qDebug("Command is "+umountS); + // odebug << "Command is "+umountS << oendl; fp = popen( (const char *) umountS, "r"); - // qDebug("%d", fp); + // odebug << "" << fp << "" << oendl; if ( !fp ) { - qDebug("Could not execute '" + umountS + "'!\n" +(QString)strerror(errno)); + odebug << "Could not execute '" + umountS + "'!\n" +(QString)strerror(errno) << oendl; QMessageBox::warning( this, tr("Formatter"), tr("umount failed!"), tr("&OK") ); pclose(fp); return false; @@ -565,7 +567,7 @@ bool FormatterApp::doFsck() { if( ((QString)line).find("busy",0,TRUE) != -1) { - qDebug("Could not find '" + umountS); + odebug << "Could not find '" + umountS << oendl; QMessageBox::warning( this, tr("Formatter"), tr("Could not umount.\nDevice is busy!"), tr("&OK") ); pclose(fp); @@ -587,7 +589,7 @@ bool FormatterApp::doFsck() { if( ((QString)line).find("No such device",0,TRUE) != -1) { - qDebug("No such device '" + umountS); + odebug << "No such device '" + umountS << oendl; QMessageBox::warning( this, tr("Formatter"), tr("No such device!"), tr("&OK") ); pclose(fp); // outDlg->OutputEdit->append("No such device"); diff --git a/noncore/tools/formatter/formatter.pro b/noncore/tools/formatter/formatter.pro index 913cca8..f6d34c7 100644 --- a/noncore/tools/formatter/formatter.pro +++ b/noncore/tools/formatter/formatter.pro @@ -1,9 +1,9 @@ -CONFIG += qt warn_on quick-app -HEADERS = formatter.h inputDialog.h output.h -SOURCES = formatter.cpp inputDialog.cpp output.cpp main.cpp -TARGET = formatter +CONFIG += qt warn_on quick-app +HEADERS = formatter.h inputDialog.h output.h +SOURCES = formatter.cpp inputDialog.cpp output.cpp main.cpp +TARGET = formatter INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiecore2 +LIBS += -lqpe -lopiecore2 include ( $(OPIEDIR)/include.pro ) |