author | ar <ar> | 2004-05-12 21:05:31 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-12 21:05:31 (UTC) |
commit | 0a35373310b1e8dc1967db71b6bf5673d832bb13 (patch) (side-by-side diff) | |
tree | a50e61a142f213e678f0077894c7435ddd1a0776 | |
parent | 4b9dcabe79d0d3e73d638981ea045c4969bf21fc (diff) | |
download | opie-0a35373310b1e8dc1967db71b6bf5673d832bb13.zip opie-0a35373310b1e8dc1967db71b6bf5673d832bb13.tar.gz opie-0a35373310b1e8dc1967db71b6bf5673d832bb13.tar.bz2 |
- convert qDebug to odebug
-rw-r--r-- | noncore/net/mail/composemail.cpp | 20 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/hciconfwrapper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/rfcommconfhandler.cpp | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 17 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 9 |
5 files changed, 25 insertions, 25 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp index b15e692..449fdf1 100644 --- a/noncore/net/mail/composemail.cpp +++ b/noncore/net/mail/composemail.cpp @@ -1,63 +1,67 @@ -#include <qt.h> +#include "composemail.h" + +#include <libmailwrapper/smtpwrapper.h> +#include <libmailwrapper/storemail.h> +#include <libmailwrapper/abstractmail.h> +#include <libmailwrapper/mailtypes.h> + +/* OPIE */ #include <opie2/ofiledialog.h> #include <opie2/odebug.h> #include <qpe/resource.h> #include <qpe/config.h> #include <qpe/global.h> #include <qpe/contact.h> -#include "composemail.h" +/* QT */ +#include <qt.h> -#include <libmailwrapper/smtpwrapper.h> -#include <libmailwrapper/storemail.h> -#include <libmailwrapper/abstractmail.h> -#include <libmailwrapper/mailtypes.h> using namespace Opie::Core; using namespace Opie::Ui; ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) : ComposeMailUI( parent, name, modal, flags ) { settings = s; m_replyid = ""; QString vfilename = Global::applicationFileName("addressbook", "businesscard.vcf"); Contact c; if (QFile::exists(vfilename)) { c = Contact::readVCard( vfilename )[0]; } QStringList mails = c.emailList(); QString defmail = c.defaultEmail(); if (defmail.length()!=0) { fromBox->insertItem(defmail); } QStringList::ConstIterator sit = mails.begin(); for (;sit!=mails.end();++sit) { if ( (*sit)==defmail) continue; fromBox->insertItem((*sit)); } senderNameEdit->setText(c.firstName()+" "+c.lastName()); Config cfg( "mail" ); cfg.setGroup( "Compose" ); checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); attList->addColumn( tr( "Name" ) ); attList->addColumn( tr( "Size" ) ); QList<Account> accounts = settings->getAccounts(); Account *it; for ( it = accounts.first(); it; it = accounts.next() ) { if ( it->getType()==MAILLIB::A_SMTP ) { SMTPaccount *smtp = static_cast<SMTPaccount *>(it); smtpAccountBox->insertItem( smtp->getAccountName() ); smtpAccounts.append( smtp ); } } if ( smtpAccounts.count() > 0 ) { @@ -143,98 +147,98 @@ void ComposeMail::fillValues( int ) bccLine->setText( smtp->getBCC() ); } replyLine->clear(); if ( smtp->getUseReply() ) { replyLine->setText( smtp->getReply() ); } sigMultiLine->setText( smtp->getSignature() ); #endif } void ComposeMail::slotAdjustColumns() { int currPage = tabWidget->currentPageIndex(); tabWidget->showPage( attachTab ); attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); attList->setColumnWidth( 1, 80 ); tabWidget->setCurrentPage( currPage ); } void ComposeMail::addAttachment() { DocLnk lnk = OFileDialog::getOpenFileName( 1, "/" ); if ( !lnk.name().isEmpty() ) { Attachment *att = new Attachment( lnk ); (void) new AttachViewItem( attList, att ); } } void ComposeMail::removeAttachment() { if ( !attList->currentItem() ) { QMessageBox::information( this, tr( "Error" ), tr( "<p>Please select a File.</p>" ), tr( "Ok" ) ); } else { attList->takeItem( attList->currentItem() ); } } void ComposeMail::accept() { if ( checkBoxLater->isChecked() ) { odebug << "Send later" << oendl; } #if 0 - qDebug( "Sending Mail with " + - smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); + odebug << "Sending Mail with " + << smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() << oendl; #endif Opie::Core::OSmartPointer<Mail> mail=new Mail; SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); mail->setMail(fromBox->currentText()); if ( !toLine->text().isEmpty() ) { mail->setTo( toLine->text() ); } else { QMessageBox::warning(0,tr("Sending mail"), tr("No Receiver spezified" ) ); return; } mail->setName(senderNameEdit->text()); mail->setCC( ccLine->text() ); mail->setBCC( bccLine->text() ); mail->setReply( replyLine->text() ); mail->setSubject( subjectLine->text() ); if (!m_replyid.isEmpty()) { QStringList ids; ids.append(m_replyid); mail->setInreply(ids); } QString txt = message->text(); if ( !sigMultiLine->text().isEmpty() ) { txt.append( "\n--\n" ); txt.append( sigMultiLine->text() ); } mail->setMessage( txt ); AttachViewItem *it = (AttachViewItem *) attList->firstChild(); while ( it != NULL ) { mail->addAttachment( it->getAttachment() ); it = (AttachViewItem *) it->nextSibling(); } SMTPwrapper wrapper( smtp ); wrapper.sendMail( mail,checkBoxLater->isChecked() ); QDialog::accept(); } void ComposeMail::reject() { int yesno = QMessageBox::warning(0,tr("Store message"), tr("Store message into drafts?"), tr("Yes"), tr("No"),QString::null,0,1); diff --git a/noncore/net/opietooth/manager/hciconfwrapper.cpp b/noncore/net/opietooth/manager/hciconfwrapper.cpp index ca2e7bd..47e170e 100644 --- a/noncore/net/opietooth/manager/hciconfwrapper.cpp +++ b/noncore/net/opietooth/manager/hciconfwrapper.cpp @@ -1,74 +1,74 @@ #include "hciconfwrapper.h" #include <qfile.h> #include <qtextstream.h> #include <qregexp.h> #include <opie2/odebug.h> using namespace Opie::Core; namespace OpieTooth { HciConfWrapper::HciConfWrapper( const QString &fileName) { m_fileName = fileName; } HciConfWrapper::~HciConfWrapper() { } void HciConfWrapper::setPinHelper( const QString& app ) { setValue( "pin_helper" , app ); } void HciConfWrapper::setName( const QString &name ) { - qDebug ("NAME : " + name); + odebug << "NAME : " << name << oendl; setValue( "name" , "\"" + name + "\"" ); } void HciConfWrapper::setIscan( bool enable) { if ( enable ) { setValue( "iscan" , "enable" ); } else { setValue( "iscan" , "disable" ); } } void HciConfWrapper::setPscan( bool enable) { if ( enable ) { setValue( "pscan" , "enable" ); } else { setValue( "pscan" , "disable" ); } } void HciConfWrapper::setAuth( bool enable) { if ( enable ) { setValue( "auth" , "enable" ); } else { setValue( "auth" , "disable" ); } } void HciConfWrapper::setEncrypt( bool enable) { if ( enable ) { setValue( "encrypt" , "enable" ); } else { setValue( "encrypt" , "disable" ); } } void HciConfWrapper::setValue(const QString &key, const QString &value ) { if (m_file.isEmpty() ) // load first return; QStringList::Iterator it; diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.cpp b/noncore/net/opietooth/manager/rfcommconfhandler.cpp index 1f7ba65..f82d2c8 100644 --- a/noncore/net/opietooth/manager/rfcommconfhandler.cpp +++ b/noncore/net/opietooth/manager/rfcommconfhandler.cpp @@ -58,59 +58,59 @@ void RfCommConfHandler::save( QMap<QString, RfCommConfObject*> devices ) { QMap<QString, RfCommConfObject*>::Iterator it; for( it = devices.begin(); it != devices.end(); ++it ) { outStream << "rfcomm" + QString("%1").arg( it.data()->number() ) + " {\n"; outStream << " device " + it.data()->mac() + ";\n"; outStream << " channel " + QString( "%1" ).arg( it.data()->channel() ) + ";\n"; outStream << " comment \"" + it.data()->comment() + "\";\n"; outStream << "}\n\n"; } rfCommConf.close(); } } QMap<QString, RfCommConfObject*> RfCommConfHandler::foundEntries() { return m_foundEntries; } void RfCommConfHandler::load() { QFile rfCommConf( m_filename ); if ( rfCommConf.open( IO_ReadOnly ) ) { QStringList list; QTextStream inStream( &rfCommConf ); list = QStringList::split( "\n", inStream.read() ); QString number; QString mac; QString channel; QString comment; for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) { QString tmpLine = ( *line ).stripWhiteSpace(); if ( tmpLine.startsWith("rfcomm") ) { QString number = tmpLine.mid( 6,1 ); odebug << tmpLine << oendl; odebug << "TEST " + number << oendl; } else if ( tmpLine.startsWith( "}" ) ) { m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) ); } else if ( tmpLine.startsWith( "device" ) ) { mac = tmpLine.mid( 7, 17 ); odebug << "mac" + mac << oendl; } else if ( tmpLine.startsWith( "channel" ) ) { channel = tmpLine.mid( 8, 1 ); - qDebug ( "Channel :" + channel ); + odebug << "Channel :" << channel << oendl; } else if ( tmpLine.startsWith( "comment" ) ) { comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 ); odebug << "Comment: " + comment << oendl; } } rfCommConf.close(); } save( m_foundEntries ); odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl; } diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index c605111..9e8aa72 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp @@ -84,98 +84,99 @@ MScanListView::MScanListView( QWidget* parent, const char* name ) connect( this, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); #ifdef QWS QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); #endif }; MScanListView::~MScanListView() { }; OListViewItem* MScanListView::childFactory() { return new MScanListItem( this ); } void MScanListView::serializeTo( QDataStream& s) const { odebug << "serializing MScanListView" << oendl; OListView::serializeTo( s ); } void MScanListView::serializeFrom( QDataStream& s) { odebug << "serializing MScanListView" << oendl; OListView::serializeFrom( s ); } void MScanListView::addNewItem( const QString& type, const QString& essid, const OMacAddress& mac, bool wep, int channel, int signal, const GpsLocation& loc, bool probe ) { QString macaddr = mac.toString(true); #ifdef DEBUG - qDebug( "MScanList::addNewItem( %s / %s / %s [%d]", (const char*) type, - (const char*) essid, (const char*) macaddr, channel ); + odebug << "MScanList::addNewItem( " << (const char*) type << " / " + << (const char*) essid << " / " << (const char*) macaddr + << " [" << channel << "]" << oendl; #endif // search, if we already have seen this net QString s; MScanListItem* network; MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); while ( item && ( item->text( col_essid ) != essid ) ) { #ifdef DEBUG odebug << "itemtext: " << item->text( col_essid ) << "" << oendl; #endif item = static_cast<MScanListItem*> ( item->nextSibling() ); } if ( item ) { // we have already seen this net, check all childs if MAC exists network = item; item = static_cast<MScanListItem*> ( item->firstChild() ); assert( item ); // this shouldn't fail while ( item && ( item->text( col_ap ) != macaddr ) ) { #ifdef DEBUG odebug << "subitemtext: " << item->text( col_ap ) << "" << oendl; #endif item = static_cast<MScanListItem*> ( item->nextSibling() ); } if ( item ) { // we have already seen this item, it's a dupe #ifdef DEBUG odebug << "" << macaddr << " is a dupe - ignoring..." << oendl; #endif item->receivedBeacon(); return; } } else { s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid ); MLogWindow::logwindow()->log( s ); network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe ); } @@ -349,196 +350,194 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr, // (Hmm, didn't I already start something in this direction?) QListViewItemIterator it( this ); for ( ; it.current(); ++it ) { if ( it.current()->text( col_ap ) == macaddr.toString(true) ) { MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() ); while ( subitem && ( subitem->text( col_essid ) != name ) ) { #ifdef DEBUG odebug << "subitemtext: " << subitem->text( col_essid ) << "" << oendl; #endif subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); } if ( subitem ) { // we have already seen this item, it's a dupe #ifdef DEBUG odebug << "" << name << " is a dupe - ignoring..." << oendl; #endif subitem->receivedBeacon(); //FIXME: sent data bit return; } // never seen that - add new item MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 ); item->setText( col_essid, name ); return; } } odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", (const char*) macaddr.toString(), (const char*) ip ) ); } void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) { if ( !item ) return; MScanListItem* itm = static_cast<MScanListItem*>( item ); - qDebug( "contextMenuRequested on item '%s' (%s) in column: '%d'", - (const char*) itm->text(0), (const char*) itm->type, col ); + odebug << "contextMenuRequested on item '" << (const char*) itm->text(0) << "' (" + << (const char*) itm->type << ") in column: '" << col << "'" << oendl; if ( itm->type == "adhoc" || itm->type == "managed" ) { QString entry = QString().sprintf( "&Join %s Net '%s'...", (const char*) itm->type, (const char*) itm->essid() ); QPopupMenu m( this ); m.insertItem( entry, 37773, 0 ); int result = m.exec( QCursor::pos() ); if ( result == 37773 ) emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() ); } } //============================================================ // MScanListItem //============================================================ MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr, bool wep, int channel, int signal, bool probed ) :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), _channel( channel ), _signal( signal ), _beacons( 1 ) { #ifdef DEBUG odebug << "creating scanlist item" << oendl; #endif if ( WellenreiterConfigWindow::instance() ) WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here decorateItem( type, essid, macaddr, wep, channel, signal, probed ); } MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr, bool wep, int channel, int signal ) :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) { #ifdef DEBUG odebug << "creating scanlist item" << oendl; #endif if ( WellenreiterConfigWindow::instance() ) WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here decorateItem( type, essid, macaddr, wep, channel, signal, false ); } const QString& MScanListItem::essid() const { if ( type == "network" ) return _essid; else return ( (MScanListItem*) parent() )->essid(); } OListViewItem* MScanListItem::childFactory() { return new MScanListItem( this ); } void MScanListItem::serializeTo( QDataStream& s ) const { #ifdef DEBUG odebug << "serializing MScanListItem" << oendl; #endif OListViewItem::serializeTo( s ); s << _type; s << (Q_UINT8) ( _wep ? 'y' : 'n' ); } void MScanListItem::serializeFrom( QDataStream& s ) { #ifdef DEBUG odebug << "serializing MScanListItem" << oendl; #endif OListViewItem::serializeFrom( s ); Q_UINT8 wep; s >> _type; s >> wep; _wep = (wep == 'y'); QString name; name.sprintf( "wellenreiter/%s", (const char*) _type ); setPixmap( col_type, Resource::loadPixmap( name ) ); if ( _wep ) setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! listView()->triggerUpdate(); } void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ) { #ifdef DEBUG - qDebug( "decorating scanlist item %s / %s / %s [%d]", - (const char*) type, - (const char*) essid, - (const char*) macaddr, - channel ); + odebug << "decorating scanlist item " << (const char*) type << " / " + << (const char*) essid << " / " << (const char*) macaddr + << "[" << channel << "]" << oendl; #endif // set icon for managed or adhoc mode QString name; name.sprintf( "wellenreiter/%s", (const char*) type ); setPixmap( col_type, Resource::loadPixmap( name ) ); // special case for probed networks FIXME: This is ugly at present if ( type == "network" && probed ) { setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) ); } // set icon for wep (wireless encryption protocol) if ( wep ) setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! // set channel and signal text if ( signal != -1 ) setText( col_sig, QString::number( signal ) ); if ( channel != -1 ) setText( col_channel, QString::number( channel ) ); setText( col_firstseen, QTime::currentTime().toString() ); //setText( col_lastseen, QTime::currentTime().toString() ); listView()->triggerUpdate(); this->type = type; _type = type; _essid = essid; _macaddr = macaddr; _channel = channel; _beacons = 1; _signal = 0; if ( WellenreiterConfigWindow::instance()->openTree->isChecked() ) { listView()->ensureItemVisible( this ); } } void MScanListItem::setManufacturer( const QString& manufacturer ) { setText( col_manuf, manufacturer ); diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 2f85790..e801ce7 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -697,73 +697,70 @@ void Wellenreiter::timerEvent( QTimerEvent* ) else { receivePacket( p ); // We no longer delete packets here. Ownership of the packets is // transferred to the PacketView. //delete p; } } void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) { #ifdef QWS if ( action == "TouchSound" ) ODevice::inst()->playTouchSound(); else if ( action == "AlarmSound" ) ODevice::inst()->playAlarmSound(); else if ( action == "KeySound" ) ODevice::inst()->playKeySound(); else if ( action == "LedOn" ) ODevice::inst()->setLedState( Led_Mail, Led_On ); else if ( action == "LedOff" ) ODevice::inst()->setLedState( Led_Mail, Led_Off ); else if ( action == "LogMessage" ) logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); else if ( action == "MessageBox" ) QMessageBox::information( this, "Notification!", QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); #else #warning Actions do not work with Qt/X11 yet #endif } void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr) { #ifdef QWS if ( !iface ) { QMessageBox::warning( this, tr( "Can't do that!" ), tr( "No wireless\ninterface available." ) ); return; } if ( sniffing ) { QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) ); return; } - qDebug( "joinNetwork() with Interface %s: %s, %s, %d, %s", - (const char*) iface->name(), - (const char*) type, - (const char*) essid, - channel, - (const char*) macaddr ); + odebug << "joinNetwork() with Interface " << (const char*) iface->name() + << ": " << (const char*) type << ", " << (const char*) essid + << ", " << channel << ", " << (const char*) macaddr << oendl; QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); int count = 3; odebug << "sending " << count << " messages" << oendl; msg << QString("count") << QString::number(count); odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl; msg << QString(iface->name()) << QString("Mode") << type; odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl; msg << QString(iface->name()) << QString("ESSID") << essid; odebug << "msg >" << iface->name() << "< channel >" << channel << "<" << oendl; msg << QString(iface->name()) << QString("Channel") << channel; // odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl; // msg << QString(iface->name()) << QString("MacAddr") << macaddr; #else QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) ); #endif } |