summaryrefslogtreecommitdiff
path: root/core/obex
authormickeyl <mickeyl>2004-04-05 12:48:49 (UTC)
committer mickeyl <mickeyl>2004-04-05 12:48:49 (UTC)
commitf1708be741dfb73ceaffb633b44093f2cb2b3d57 (patch) (side-by-side diff)
tree0bdcab2ac6c5f0e5cac67eb58807a50bb79d82e0 /core/obex
parent0b481957a2eebf28b05d9803780d05ad4232aa00 (diff)
downloadopie-f1708be741dfb73ceaffb633b44093f2cb2b3d57.zip
opie-f1708be741dfb73ceaffb633b44093f2cb2b3d57.tar.gz
opie-f1708be741dfb73ceaffb633b44093f2cb2b3d57.tar.bz2
convert core/applets/* to Opie debug framework
Diffstat (limited to 'core/obex') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/obexsend.cpp29
-rw-r--r--core/obex/receiver.cpp41
2 files changed, 37 insertions, 33 deletions
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp
index cd8d58e..f3dd11c 100644
--- a/core/obex/obexsend.cpp
+++ b/core/obex/obexsend.cpp
@@ -1,22 +1,23 @@
+#include "obex.h"
+#include "obexsend.h"
+using namespace OpieObex;
+
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/qcopenvelope_qws.h>
+using namespace Opie::Core;
+
+/* QT */
#include <qpushbutton.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qtimer.h>
-
-#include <qpe/qcopenvelope_qws.h>
-
-#include "obex.h"
-#include "obexsend.h"
-
-using namespace OpieObex;
-
/* TRANSLATOR OpieObex::SendWidget */
-
SendWidget::SendWidget( QWidget* parent, const char* name )
: QWidget( parent, name ) {
initUI();
}
SendWidget::~SendWidget() {
}
@@ -101,13 +102,13 @@ void SendWidget::send( const QString& file, const QString& desc ) {
QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()");
QCopEnvelope e2("QPE/IrDaApplet", "listDevices()");
QCopEnvelope e3("QPE/Bluetooth", "listDevices()");
}
}
void SendWidget::slotIrDaDevices( const QStringList& list) {
- qWarning("slot it irda devices ");
+ owarn << "slot it irda devices " << oendl;
for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
int id = m_devBox->addDevice( (*it), DeviceBox::IrDa, tr("Scheduling for beam.") );
m_irDa.insert( id, (*it) );
}
m_devBox->removeDevice( m_irDeSearch );
m_irDaIt = m_irDa.begin();
@@ -120,22 +121,22 @@ void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) {
int id = m_devBox->addDevice( it.key(), DeviceBox::BT, tr("Click to beam") );
m_bt.insert( id, Pair( it.key(), it.data() ) );
}
m_devBox->removeDevice( m_btDeSearch );
}
void SendWidget::slotSelectedDevice( int name, int dev ) {
- qWarning("Start beam? %d %d", name, dev );
+ owarn << "Start beam? " << name << " " << dev << "" << oendl;
if ( name == m_irDeSearch ) {
for (QMap<int, QString>::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it )
m_devBox->removeDevice( it.key() );
QCopEnvelope e2("QPE/IrDaApplet", "listDevices()");
}
}
void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) {
- qWarning("dispatch irda %s", str.data() );
+ owarn << "dispatch irda " << str.data() << "" << oendl;
if ( str == "devices(QStringList)" ) {
QDataStream stream( ar, IO_ReadOnly );
QStringList list;
stream >> list;
slotIrDaDevices( list );
}
@@ -144,13 +145,13 @@ void SendWidget::dispatchBt( const QCString&, const QByteArray& ) {
}
void SendWidget::slotIrError( int ) {
}
void SendWidget::slotIrSent( bool b) {
- qWarning("irda sent!!");
+ owarn << "irda sent!!" << oendl;
QString text = b ? tr("Sent") : tr("Failure");
m_devBox->setStatus( m_irDaIt.key(), text );
++m_irDaIt;
slotStartIrda();
}
void SendWidget::slotIrTry(unsigned int trI) {
@@ -201,13 +202,13 @@ void DeviceBox::removeDevice( int id ) {
void DeviceBox::setStatus( int id, const QString& status ) {
if ( !m_dev.contains(id) ) return;
m_dev[id].setStatus(status );
setText( allText() );
}
void DeviceBox::setSource( const QString& str ) {
- qWarning("SetSource:%d", str.toInt() );
+ owarn << "SetSource:" << str.toInt() << "" << oendl;
int id = str.toInt();
emit selectedDevice( id, m_dev[id].device() );
}
int DeviceBox::idFor ( int id ) {
static int irId = 1501;
static int irBT = 1001;
diff --git a/core/obex/receiver.cpp b/core/obex/receiver.cpp
index ee2668b..8885256 100644
--- a/core/obex/receiver.cpp
+++ b/core/obex/receiver.cpp
@@ -1,27 +1,30 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <stdlib.h> // int system
-#include <unistd.h>
+#include "obex.h"
+#include "receiver.h"
+using namespace OpieObex;
-#include <fcntl.h>
+/* OPIE */
+#include <opie2/odebug.h>
+#include <qpe/applnk.h>
+#include <qpe/qpeapplication.h>
+#include <qpe/qcopenvelope_qws.h>
+using namespace Opie::Core;
+/* QT */
#include <qfileinfo.h>
#include <qlabel.h>
#include <qtextview.h>
#include <qpushbutton.h>
-#include <qpe/applnk.h>
-#include <qpe/qpeapplication.h>
-#include <qpe/qcopenvelope_qws.h>
-
-#include "obex.h"
-#include "receiver.h"
-
-using namespace OpieObex;
+/* STD */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <stdlib.h> // int system
+#include <unistd.h>
+#include <fcntl.h>
/* TRANSLATOR OpieObex::Receiver */
Receiver::Receiver() {
m_obex = new Obex(this, "Receiver");
connect(m_obex, SIGNAL(receivedFile(const QString&) ),
@@ -72,20 +75,20 @@ void Receiver::tidyUp( QString& _file, const QString& ending) {
if ( fd == -1 )
return;
(void)::strncat( foo, ending.latin1(), 4 );
_file = QString::fromLatin1( foo );
QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) );
- qWarning("Executing: %s", cmd.latin1() );
+ owarn << "Executing: " << cmd << "" << oendl;
(void)::system( cmd.latin1() );
cmd = QString("rm %1").arg( Global::shellQuote(file) );
(void)::system( cmd.latin1() );
}
int Receiver::checkFile( QString& file ) {
- qWarning("check file!! %s", file.latin1() );
+ owarn << "check file!! " << file << "" << oendl;
int ret;
QString ending;
if (file.right(4) == ".vcs" ) {
ret = Datebook;
ending = QString::fromLatin1(".vcs");
@@ -104,13 +107,13 @@ int Receiver::checkFile( QString& file ) {
* and M$ likes to send that. So we will executed a small
* tidy up system sed script
* At this point we can also remove umlaute from the filename
*/
tidyUp( file, ending );
- qWarning("check it now %d", ret );
+ owarn << "check it now " << ret << "" << oendl;
return ret;
}
/* TRANSLATOR OpieObex::OtherHandler */
OtherHandler::OtherHandler()
@@ -145,13 +148,13 @@ OtherHandler::~OtherHandler() {
}
void OtherHandler::handle( const QString& file ) {
m_file = file;
m_na->setText(file);
DocLnk lnk(file);
- qWarning(" %s %s", lnk.type().latin1(), lnk.icon().latin1() );
+ owarn << " " << lnk.type() << " " << lnk.icon() << "" << oendl;
QString str = tr("<p>You received a file of type %1 (<img src=\"%2\"> )What do you want to do?").arg(lnk.type() ).arg(lnk.icon() );
m_view->setText( str );
}
/*
@@ -188,12 +191,12 @@ QString OtherHandler::targetName( const QString& file ) {
return newFile;
}
/* fast cpy */
void OtherHandler::copy(const QString& src, const QString& file) {
- qWarning("src %s, dest %s", src.latin1(),file.latin1() );
+ owarn << "src " << src << ", dest " << file << "" << oendl;
QString cmd = QString("mv %1 %2").arg( Global::shellQuote( src )).
arg( Global::shellQuote( file ) );
::system( cmd.latin1() );
// done
}