author | ar <ar> | 2004-05-15 22:36:18 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-15 22:36:18 (UTC) |
commit | 736a153edfac343d0794ecafc5dc2f2c405260a7 (patch) (side-by-side diff) | |
tree | ebb41331403fa78769df2a344bfe12bbd1df6c46 /noncore | |
parent | d4a82558ff3ae6ed7bbc5dbc9857461057eb3da3 (diff) | |
download | opie-736a153edfac343d0794ecafc5dc2f2c405260a7.zip opie-736a153edfac343d0794ecafc5dc2f2c405260a7.tar.gz opie-736a153edfac343d0794ecafc5dc2f2c405260a7.tar.bz2 |
- convert qDebug to odebug
-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/modem.cpp | 52 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 29 |
3 files changed, 43 insertions, 42 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index f918767..9638686 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp @@ -38,8 +38,9 @@ /* OPIE */ #include <opie2/odevice.h> #include <opie2/ofiledialog.h> #include <opie2/otabwidget.h> +#include <opie2/odebug.h> #include <qpe/config.h> #include <qpe/global.h> #include <qpe/qpeapplication.h> @@ -831,9 +832,10 @@ public: setText ( it-> pattern ( )); setGeometry ( x, y, w, h ); - qDebug ( "ExEdit: [%s] at %d,%d %d,%d", it->text(2).latin1(),x,y,w,h); + odebug << "ExEdit: [" << it->text(2).latin1() << "] at " + << x << "," << y << " " << w << "," << h << oendl; m_out = true; show ( ); diff --git a/noncore/settings/networksettings/ppp/modem.cpp b/noncore/settings/networksettings/ppp/modem.cpp index 5913a22..3bc7d43 100644 --- a/noncore/settings/networksettings/ppp/modem.cpp +++ b/noncore/settings/networksettings/ppp/modem.cpp @@ -169,9 +169,9 @@ bool Modem::opentty() { //begin if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { close(modemfd); device = _pppdata->modemDevice(); if ((modemfd = open(device, O_RDWR|O_NDELAY|O_NOCTTY)) == -1) { - odebug << "error opening modem device !" << oendl; + odebug << "error opening modem device !" << oendl; errmsg = QObject::tr("Unable to open modem."); return false; } //bend if((modemfd = Requester::rq->openModem(gpppdata.modemDevice()))<0) { @@ -310,11 +310,11 @@ void Modem::startNotifier() { if(modemfd >= 0) { if(sn == 0) { sn = new QSocketNotifier(modemfd, QSocketNotifier::Read, this); connect(sn, SIGNAL(activated(int)), SLOT(readtty(int))); - odebug << "QSocketNotifier started!" << oendl; + odebug << "QSocketNotifier started!" << oendl; } else { - odebug << "QSocketNotifier re-enabled!" << oendl; + odebug << "QSocketNotifier re-enabled!" << oendl; sn->setEnabled(true); } } } @@ -325,9 +325,9 @@ void Modem::stopNotifier() { sn->setEnabled(false); disconnect(sn); delete sn; sn = 0; - odebug << "QSocketNotifier stopped!" << oendl; + odebug << "QSocketNotifier stopped!" << oendl; } } @@ -341,9 +341,9 @@ bool Modem::writeChar(unsigned char c) { int s; do { s = write(modemfd, &c, 1); if (s < 0) { - oerr << "write() in Modem::writeChar failed" << oendl; + oerr << "write() in Modem::writeChar failed" << oendl; return false; } } while(s == 0); @@ -369,9 +369,9 @@ bool Modem::writeLine(const char *buf) { while(l) { int wr = write(modemfd, &b[len-l], l); if(wr < 0) { // TODO do something meaningful with the error code (or ignore it - oerr << "write() in Modem::writeLine failed" << oendl; + oerr << "write() in Modem::writeLine failed" << oendl; delete[] b; return false; } l -= wr; @@ -478,9 +478,9 @@ QString Modem::parseModemSpeed(const QString &s) { int tx = -1; int i; QString result; - odebug << "Modem reported result string: " << s.latin1() << "" << oendl; + odebug << "Modem reported result string: " << s.latin1() << "" << oendl; const int RXMAX = 7; const int TXMAX = 2; QRegExp rrx[RXMAX] = { @@ -564,9 +564,9 @@ QString Modem::parseModemSpeed(const QString &s) { result.setNum(tx); else result.sprintf("%d/%d", rx, tx); - odebug << "The parsed result is: " << result.latin1() << "" << oendl; + odebug << "The parsed result is: " << result.latin1() << "" << oendl; return result; } @@ -577,9 +577,9 @@ int Modem::lockdevice() { int fd; char newlock[80]=""; // safe if(!_pppdata->modemLockFile()) { - odebug << "The user doesn't want a lockfile." << oendl; + odebug << "The user doesn't want a lockfile." << oendl; return 0; } if (modem_is_locked) @@ -599,9 +599,9 @@ if ((fd = openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) { if (sz <= 0) return 1; oldlock[sz] = '\0'; - odebug << "Device is locked by: " << oldlock << "" << oendl; + odebug << "Device is locked by: " << oldlock << "" << oendl; int oldpid; int match = sscanf(oldlock, "%d", &oldpid); @@ -612,16 +612,16 @@ if ((fd = openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) { // check if process exists if (kill((pid_t)oldpid, 0) == 0 || errno != ESRCH) return 1; - odebug << "lockfile is stale" << oendl; + odebug << "lockfile is stale" << oendl; } } fd = openLockfile(_pppdata->modemDevice(),O_WRONLY|O_TRUNC|O_CREAT); if(fd >= 0) { sprintf(newlock,"%010d\n", getpid()); - odebug << "Locking Device: " << newlock << "" << oendl; + odebug << "Locking Device: " << newlock << "" << oendl; write(fd, newlock, strlen(newlock)); close(fd); modem_is_locked=true; @@ -636,9 +636,9 @@ if ((fd = openLockfile(QFile::encodeName(lockfile), O_RDONLY)) >= 0) { // UnLock modem device void Modem::unlockdevice() { if (modem_is_locked) { - odebug << "UnLocking Modem Device" << oendl; + odebug << "UnLocking Modem Device" << oendl; close(modemfd); modemfd = -1; unlink(lockfile); lockfile[0] = '\0'; @@ -658,9 +658,9 @@ int Modem::openLockfile( QString lockfile, int flags) lockfile = LOCK_DIR; lockfile += "/LCK.."; lockfile += device.right( device.length() - device.findRev("/") -1 ); - odebug << "lockfile >" << lockfile.latin1() << "<" << oendl; + odebug << "lockfile >" << lockfile.latin1() << "<" << oendl; // TODO: // struct stat st; // if(stat(lockfile.data(), &st) == -1) { // if(errno == EBADF) @@ -670,9 +670,9 @@ int Modem::openLockfile( QString lockfile, int flags) // if(!S_ISREG(st.st_mode)) // return -1; // } if ((fd = open(lockfile, flags, mode)) == -1) { - odebug << "error opening lockfile!" << oendl; + odebug << "error opening lockfile!" << oendl; lockfile = QString::null; fd = open(DEVNULL, O_RDONLY); } else fchown(fd, 0, 0); @@ -931,17 +931,17 @@ bool Modem::execpppd(const char *arguments) { _exit(0); break; default: - odebug << "In parent: pppd pid " << pppdPid << "\n" << oendl; + odebug << "In parent: pppd pid " << pppdPid << "\n" << oendl; close(modemfd); ::close( m_pppdLOG[1] ); // set it to nonblocking io int flag = ::fcntl( m_pppdLOG[0], F_GETFL ); if ( !(flag & O_NONBLOCK) ) { - odebug << "Setting nonblocking io" << oendl; + odebug << "Setting nonblocking io" << oendl; flag |= O_NONBLOCK; ::fcntl(m_pppdLOG[0], F_SETFL, flag ); } @@ -958,17 +958,17 @@ bool Modem::execpppd(const char *arguments) { } bool Modem::killpppd() { - odebug << "In killpppd and pid is " << pppdPid << "" << oendl; + odebug << "In killpppd and pid is " << pppdPid << "" << oendl; if(pppdPid > 0) { delete m_modemDebug; m_modemDebug = 0; - odebug << "In killpppd(): Sending SIGTERM to " << pppdPid << "\n" << oendl; + odebug << "In killpppd(): Sending SIGTERM to " << pppdPid << "\n" << oendl; if(kill(pppdPid, SIGTERM) < 0) { - odebug << "Error terminating " << pppdPid << ". Sending SIGKILL\n" << oendl; + odebug << "Error terminating " << pppdPid << ". Sending SIGKILL\n" << oendl; if(kill(pppdPid, SIGKILL) < 0) { - odebug << "Error killing " << pppdPid << "\n" << oendl; + odebug << "Error killing " << pppdPid << "\n" << oendl; return false; } } } @@ -1003,13 +1003,13 @@ void Modem::parseargs(char* buf, char** args) { } if (!quotes) while ((*buf != '\0') && (*buf != '\n') && - (*buf != '\t') && (*buf != ' ')) - buf++; + (*buf != '\t') && (*buf != ' ')) + buf++; else { while ((*buf != '\0') && (*buf != quotes)) - buf++; + buf++; *buf++ = '\0'; } } @@ -1039,9 +1039,9 @@ int Modem::pppdExitStatus() int Modem::openResolv(int flags) { int fd; if ((fd = open(_PATH_RESCONF, flags)) == -1) { - odebug << "error opening resolv.conf!" << oendl; + odebug << "error opening resolv.conf!" << oendl; fd = open(DEVNULL, O_RDONLY); } return fd; } @@ -1060,9 +1060,9 @@ void Modem::setPPPDevice( const QString& dev ) { pid_t Modem::pppPID()const { return pppdPid; } void Modem::setPPPDPid( pid_t pid ) { - odebug << "Modem setting pid" << oendl; + odebug << "Modem setting pid" << oendl; _pppdExitStatus = -1; pppdPid = pid; modemfd = -1; } diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index 4294b12..d36a702 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp @@ -53,9 +53,9 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W // Check sanity - the existance of the wireless-tools if-pre-up script QFile file(QString(PREUP)); if (file.exists()) { - owarn << QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools") << oendl; + owarn << QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools") << oendl; } connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); connect( netView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( selectNetwork(QListViewItem*) ) ); @@ -234,9 +234,9 @@ void WLANImp::writeOpts() { return; } bool error = false; - odebug << "setting wlan interface " << interfaces->getInterfaceName( error ).latin1() << "" << oendl; + odebug << "setting wlan interface " << interfaces->getInterfaceName( error ).latin1() << "" << oendl; if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!"); interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); @@ -308,9 +308,9 @@ void WLANImp::writeOpts() { void WLANImp::rescanNeighbourhood() { QString name = interface->getInterfaceName(); - odebug << "rescanNeighbourhood via '" << name << "'" << oendl; + odebug << "rescanNeighbourhood via '" << name << "'" << oendl; OWirelessNetworkInterface* wiface = static_cast<OWirelessNetworkInterface*>( ONetwork::instance()->interface( name ) ); assert( wiface ); @@ -331,14 +331,14 @@ void WLANImp::rescanNeighbourhood() } } if ( devicetype.isEmpty() ) { - owarn << "rescanNeighbourhood(): couldn't guess device type :(" << oendl; + owarn << "rescanNeighbourhood(): couldn't guess device type :(" << oendl; return; } else { - odebug << "rescanNeighbourhood(): device type seems to be '" << devicetype << "'" << oendl; + odebug << "rescanNeighbourhood(): device type seems to be '" << devicetype << "'" << oendl; } // configure interface to receive 802.11 management frames @@ -350,25 +350,25 @@ void WLANImp::rescanNeighbourhood() else if ( devicetype == "wlan-ng" ) wiface->setMonitoring( new OWlanNGMonitoringInterface( wiface, false ) ); else if ( devicetype == "orinoco" ) wiface->setMonitoring( new OOrinocoMonitoringInterface( wiface, false ) ); else { - odebug << "rescanNeighbourhood(): unsupported device type for monitoring :(" << oendl; + odebug << "rescanNeighbourhood(): unsupported device type for monitoring :(" << oendl; return; } wiface->setMode( "monitor" ); if ( wiface->mode() != "monitor" ) { - owarn << "rescanNeighbourhood(): Unable to bring device into monitor mode (" << strerror( errno ) << ")." << oendl; + owarn << "rescanNeighbourhood(): Unable to bring device into monitor mode (" << strerror( errno ) << ")." << oendl; return; } // open a packet capturer OPacketCapturer* cap = new OPacketCapturer(); cap->open( name ); if ( !cap->isOpen() ) { - owarn << "rescanNeighbourhood(): Unable to open libpcap (" << strerror( errno ) << ")." << oendl; + owarn << "rescanNeighbourhood(): Unable to open libpcap (" << strerror( errno ) << ")." << oendl; return; } // display splash screen @@ -399,17 +399,17 @@ void WLANImp::rescanNeighbourhood() { wiface->setChannel( i ); pb->setProgress( i ); qApp->processEvents(); - odebug << "rescanNeighbourhood(): listening on channel " << i << "..." << oendl; + odebug << "rescanNeighbourhood(): listening on channel " << i << "..." << oendl; OPacket* p = cap->next( 1000 ); if ( !p ) { - odebug << "rescanNeighbourhood(): nothing received on channel " << i << "" << oendl; + odebug << "rescanNeighbourhood(): nothing received on channel " << i << "" << oendl; } else { - odebug << "rescanNeighbourhood(): TADAA - something came in on channel " << i << "" << oendl; + odebug << "rescanNeighbourhood(): TADAA - something came in on channel " << i << "" << oendl; handlePacket( p ); } } @@ -440,9 +440,9 @@ void WLANImp::handlePacket( OPacket* p ) type = "managed"; } else { - owarn << "handlePacket(): invalid frame [possibly noise] detected!" << oendl; + owarn << "handlePacket(): invalid frame [possibly noise] detected!" << oendl; return; } OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); @@ -457,11 +457,10 @@ void WLANImp::handlePacket( OPacket* p ) void WLANImp::displayFoundNetwork( const QString& mode, int channel, const QString& ssid, const OMacAddress& mac ) { - qDebug( "found network: <%s>, chn %d, ssid '%s', mac '%s'", (const char*) mode, channel, - (const char*) ssid, - (const char*) mac.toString() ); + odebug << "found network: <" << (const char*) mode << ">, chn " << channel + << ", ssid '" << (const char*) ssid << "', mac '" << (const char*) mac.toString() << "'" << oendl; QListViewItemIterator it( netView ); while ( it.current() && it.current()->text( col_ssid ) != ssid ) ++it; if ( !it.current() ) // ssid didn't show up yet |