summaryrefslogtreecommitdiff
path: root/core/obex/obex.cc
Side-by-side diff
Diffstat (limited to 'core/obex/obex.cc') (more/less context) (show whitespace changes)
-rw-r--r--core/obex/obex.cc47
1 files changed, 26 insertions, 21 deletions
diff --git a/core/obex/obex.cc b/core/obex/obex.cc
index 3c99af6..7c40b90 100644
--- a/core/obex/obex.cc
+++ b/core/obex/obex.cc
@@ -1,2 +1,9 @@
+#include "obex.h"
+
+/* OPIE */
+#include <opie2/oprocess.h>
+#include <opie2/odebug.h>
+
+/* QT */
#include <qfileinfo.h>
@@ -4,4 +11,2 @@
-#include <opie2/oprocess.h>
-#include "obex.h"
@@ -31,3 +36,3 @@ void Obex::receive() {
m_outp = QString::null;
- qWarning("Receive" );
+ owarn << "Receive" << oendl;
m_rec = new OProcess();
@@ -42,3 +47,3 @@ void Obex::receive() {
if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
- qWarning("could not start :(");
+ owarn << "could not start :(" oendl;
emit done( false );
@@ -53,8 +58,8 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se
m_file = fileName;
- qWarning("send %s", fileName.latin1() );
+ owarn << "send " << fileName.latin1() << oendl;
if (m_rec != 0 ) {
- qWarning("running");
+ owarn << "running" oendl;
if (m_rec->isRunning() ) {
emit error(-1 );
- qWarning("is running");
+ owarn << "is running" << oendl;
delete m_rec;
@@ -63,3 +68,3 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se
}else{
- qWarning("is not running");
+ owarn << "is not running" << oendl;
emit error( -1 ); // we did not delete yet but it's not running slotExited is pending
@@ -71,3 +76,3 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se
void Obex::sendNow(){
- qWarning("sendNow");
+ owarn << "sendNow" << oendl;
if ( m_count >= 25 ) { // could not send
@@ -90,3 +95,3 @@ void Obex::sendNow(){
if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) {
- qWarning("could not send" );
+ owarn << "could not send" << oendl;
m_count = 25;
@@ -112,3 +117,3 @@ void Obex::slotStdOut(OProcess* proc, char* buf, int len){
memcpy( ar.data(), buf, len );
- qWarning("parsed: %s", ar.data() );
+ owarn << "parsed: " << ar.data() << oendl;
m_outp.append( ar );
@@ -121,3 +126,3 @@ void Obex::received() {
QString filename = parseOut();
- qWarning("ACHTUNG %s", filename.latin1() );
+ owarn << "ACHTUNG " << filename.latin1() << oendl;
emit receivedFile( filename );
@@ -137,3 +142,3 @@ void Obex::sendEnd() {
m_send=0;
- qWarning("done" );
+ owarn << "done" << oendl;
emit sent(true);
@@ -143,3 +148,3 @@ void Obex::sendEnd() {
m_send = 0;
- qWarning("try sending again" );
+ owarn << "try sending again" << oendl;
sendNow();
@@ -160,10 +165,10 @@ QString Obex::parseOut( ){
if ( pos > 0 ) {
- qWarning( "%d %s", pos, (*it).mid(6 ).latin1() ) ;
- qWarning("%d %d", (*it).length(), (*it).length()-pos );
+ owarn << pos << " " << (*it).mid(6 ).latin1() << oendl;
+ owarn << (*it).length() << " " << (*it).length()-pos << oendl;
path = (*it).remove( pos, (*it).length() - pos );
- qWarning("%s", path.latin1() );
+ owarn << path.latin1() << oendl;
path = path.mid(6 );
path = path.stripWhiteSpace();
- qWarning("path %s", path.latin1() );
+ owarn << "path " << path.latin1() << oendl;
}
@@ -177,3 +182,3 @@ QString Obex::parseOut( ){
void Obex::slotError() {
- qWarning("slotError");
+ owarn << "slotError" << oendl;
if ( m_receive )
@@ -190,6 +195,6 @@ void Obex::shutDownReceive() {
if (m_rec != 0 ) {
- qWarning("running");
+ owarn << "running" << oendl;
if (m_rec->isRunning() ) {
emit error(-1 );
- qWarning("is running");
+ owarn << "is running" << oendl;
delete m_rec;