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) (unidiff)
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,19 +1,20 @@
1#include "obex.h"
2#include "obexsend.h"
3using namespace OpieObex;
4
5/* OPIE */
6#include <opie2/odebug.h>
7#include <qpe/qcopenvelope_qws.h>
8using namespace Opie::Core;
9
10/* QT */
1#include <qpushbutton.h> 11#include <qpushbutton.h>
2#include <qlabel.h> 12#include <qlabel.h>
3#include <qlayout.h> 13#include <qlayout.h>
4#include <qtimer.h> 14#include <qtimer.h>
5 15
6
7#include <qpe/qcopenvelope_qws.h>
8
9#include "obex.h"
10#include "obexsend.h"
11
12using namespace OpieObex;
13
14/* TRANSLATOR OpieObex::SendWidget */ 16/* TRANSLATOR OpieObex::SendWidget */
15 17
16
17SendWidget::SendWidget( QWidget* parent, const char* name ) 18SendWidget::SendWidget( QWidget* parent, const char* name )
18 : QWidget( parent, name ) { 19 : QWidget( parent, name ) {
19 initUI(); 20 initUI();
@@ -104,7 +105,7 @@ void SendWidget::send( const QString& file, const QString& desc ) {
104 } 105 }
105} 106}
106void SendWidget::slotIrDaDevices( const QStringList& list) { 107void SendWidget::slotIrDaDevices( const QStringList& list) {
107 qWarning("slot it irda devices "); 108 owarn << "slot it irda devices " << oendl;
108 for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { 109 for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) {
109 int id = m_devBox->addDevice( (*it), DeviceBox::IrDa, tr("Scheduling for beam.") ); 110 int id = m_devBox->addDevice( (*it), DeviceBox::IrDa, tr("Scheduling for beam.") );
110 m_irDa.insert( id, (*it) ); 111 m_irDa.insert( id, (*it) );
@@ -123,7 +124,7 @@ void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) {
123 m_devBox->removeDevice( m_btDeSearch ); 124 m_devBox->removeDevice( m_btDeSearch );
124} 125}
125void SendWidget::slotSelectedDevice( int name, int dev ) { 126void SendWidget::slotSelectedDevice( int name, int dev ) {
126 qWarning("Start beam? %d %d", name, dev ); 127 owarn << "Start beam? " << name << " " << dev << "" << oendl;
127 if ( name == m_irDeSearch ) { 128 if ( name == m_irDeSearch ) {
128 for (QMap<int, QString>::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it ) 129 for (QMap<int, QString>::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it )
129 m_devBox->removeDevice( it.key() ); 130 m_devBox->removeDevice( it.key() );
@@ -132,7 +133,7 @@ void SendWidget::slotSelectedDevice( int name, int dev ) {
132 } 133 }
133} 134}
134void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) { 135void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) {
135 qWarning("dispatch irda %s", str.data() ); 136 owarn << "dispatch irda " << str.data() << "" << oendl;
136 if ( str == "devices(QStringList)" ) { 137 if ( str == "devices(QStringList)" ) {
137 QDataStream stream( ar, IO_ReadOnly ); 138 QDataStream stream( ar, IO_ReadOnly );
138 QStringList list; 139 QStringList list;
@@ -147,7 +148,7 @@ void SendWidget::slotIrError( int ) {
147 148
148} 149}
149void SendWidget::slotIrSent( bool b) { 150void SendWidget::slotIrSent( bool b) {
150 qWarning("irda sent!!"); 151 owarn << "irda sent!!" << oendl;
151 QString text = b ? tr("Sent") : tr("Failure"); 152 QString text = b ? tr("Sent") : tr("Failure");
152 m_devBox->setStatus( m_irDaIt.key(), text ); 153 m_devBox->setStatus( m_irDaIt.key(), text );
153 ++m_irDaIt; 154 ++m_irDaIt;
@@ -204,7 +205,7 @@ void DeviceBox::setStatus( int id, const QString& status ) {
204 setText( allText() ); 205 setText( allText() );
205} 206}
206void DeviceBox::setSource( const QString& str ) { 207void DeviceBox::setSource( const QString& str ) {
207 qWarning("SetSource:%d", str.toInt() ); 208 owarn << "SetSource:" << str.toInt() << "" << oendl;
208 int id = str.toInt(); 209 int id = str.toInt();
209 emit selectedDevice( id, m_dev[id].device() ); 210 emit selectedDevice( id, m_dev[id].device() );
210} 211}
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,24 +1,27 @@
1#include <sys/types.h> 1#include "obex.h"
2#include <sys/stat.h> 2#include "receiver.h"
3#include <sys/mman.h> 3using namespace OpieObex;
4#include <stdlib.h> // int system
5#include <unistd.h>
6 4
7#include <fcntl.h> 5/* OPIE */
6#include <opie2/odebug.h>
7#include <qpe/applnk.h>
8#include <qpe/qpeapplication.h>
9#include <qpe/qcopenvelope_qws.h>
10using namespace Opie::Core;
8 11
12/* QT */
9#include <qfileinfo.h> 13#include <qfileinfo.h>
10#include <qlabel.h> 14#include <qlabel.h>
11#include <qtextview.h> 15#include <qtextview.h>
12#include <qpushbutton.h> 16#include <qpushbutton.h>
13 17
14#include <qpe/applnk.h> 18/* STD */
15#include <qpe/qpeapplication.h> 19#include <sys/types.h>
16#include <qpe/qcopenvelope_qws.h> 20#include <sys/stat.h>
17 21#include <sys/mman.h>
18#include "obex.h" 22#include <stdlib.h> // int system
19#include "receiver.h" 23#include <unistd.h>
20 24#include <fcntl.h>
21using namespace OpieObex;
22 25
23/* TRANSLATOR OpieObex::Receiver */ 26/* TRANSLATOR OpieObex::Receiver */
24 27
@@ -75,14 +78,14 @@ void Receiver::tidyUp( QString& _file, const QString& ending) {
75 (void)::strncat( foo, ending.latin1(), 4 ); 78 (void)::strncat( foo, ending.latin1(), 4 );
76 _file = QString::fromLatin1( foo ); 79 _file = QString::fromLatin1( foo );
77 QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) ); 80 QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) );
78 qWarning("Executing: %s", cmd.latin1() ); 81 owarn << "Executing: " << cmd << "" << oendl;
79 (void)::system( cmd.latin1() ); 82 (void)::system( cmd.latin1() );
80 83
81 cmd = QString("rm %1").arg( Global::shellQuote(file) ); 84 cmd = QString("rm %1").arg( Global::shellQuote(file) );
82 (void)::system( cmd.latin1() ); 85 (void)::system( cmd.latin1() );
83} 86}
84int Receiver::checkFile( QString& file ) { 87int Receiver::checkFile( QString& file ) {
85 qWarning("check file!! %s", file.latin1() ); 88 owarn << "check file!! " << file << "" << oendl;
86 int ret; 89 int ret;
87 QString ending; 90 QString ending;
88 91
@@ -107,7 +110,7 @@ int Receiver::checkFile( QString& file ) {
107 */ 110 */
108 tidyUp( file, ending ); 111 tidyUp( file, ending );
109 112
110 qWarning("check it now %d", ret ); 113 owarn << "check it now " << ret << "" << oendl;
111 return ret; 114 return ret;
112} 115}
113 116
@@ -148,7 +151,7 @@ void OtherHandler::handle( const QString& file ) {
148 m_file = file; 151 m_file = file;
149 m_na->setText(file); 152 m_na->setText(file);
150 DocLnk lnk(file); 153 DocLnk lnk(file);
151 qWarning(" %s %s", lnk.type().latin1(), lnk.icon().latin1() ); 154 owarn << " " << lnk.type() << " " << lnk.icon() << "" << oendl;
152 155
153 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() ); 156 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() );
154 m_view->setText( str ); 157 m_view->setText( str );
@@ -191,7 +194,7 @@ QString OtherHandler::targetName( const QString& file ) {
191 194
192/* fast cpy */ 195/* fast cpy */
193void OtherHandler::copy(const QString& src, const QString& file) { 196void OtherHandler::copy(const QString& src, const QString& file) {
194 qWarning("src %s, dest %s", src.latin1(),file.latin1() ); 197 owarn << "src " << src << ", dest " << file << "" << oendl;
195 QString cmd = QString("mv %1 %2").arg( Global::shellQuote( src )). 198 QString cmd = QString("mv %1 %2").arg( Global::shellQuote( src )).
196 arg( Global::shellQuote( file ) ); 199 arg( Global::shellQuote( file ) );
197 ::system( cmd.latin1() ); 200 ::system( cmd.latin1() );