summaryrefslogtreecommitdiff
path: root/core/obex
Side-by-side diff
Diffstat (limited to 'core/obex') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/obex.cc28
-rw-r--r--core/obex/obexsend.cpp7
-rw-r--r--core/obex/receiver.cpp18
3 files changed, 9 insertions, 44 deletions
diff --git a/core/obex/obex.cc b/core/obex/obex.cc
index 7c40b90..5dfcfb5 100644
--- a/core/obex/obex.cc
+++ b/core/obex/obex.cc
@@ -35,5 +35,4 @@ void Obex::receive() {
m_receive = true;
m_outp = QString::null;
- owarn << "Receive" << oendl;
m_rec = new OProcess();
*m_rec << "irobex_palm3";
@@ -46,26 +45,20 @@ void Obex::receive() {
if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
- owarn << "could not start :(" oendl;
emit done( false );
delete m_rec;
m_rec = 0;
}
-// emit currentTry(m_count );
-
}
+
void Obex::send( const QString& fileName) { // if currently receiving stop it send receive
m_count = 0;
m_file = fileName;
- owarn << "send " << fileName.latin1() << oendl;
if (m_rec != 0 ) {
- owarn << "running" oendl;
if (m_rec->isRunning() ) {
emit error(-1 );
- owarn << "is running" << oendl;
delete m_rec;
m_rec = 0;
}else{
- owarn << "is not running" << oendl;
emit error( -1 ); // we did not delete yet but it's not running slotExited is pending
return;
@@ -75,5 +68,4 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se
}
void Obex::sendNow(){
- owarn << "sendNow" << oendl;
if ( m_count >= 25 ) { // could not send
emit error(-1 );
@@ -94,5 +86,4 @@ void Obex::sendNow(){
// now start it
if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) {
- owarn << "could not send" << oendl;
m_count = 25;
emit error(-1 );
@@ -106,9 +97,9 @@ void Obex::sendNow(){
void Obex::slotExited(OProcess* proc ){
- if (proc == m_rec ) { // receive process
+ if (proc == m_rec ) // receive process
received();
- }else if ( proc == m_send ) {
+ else if ( proc == m_send )
sendEnd();
- }
+
}
void Obex::slotStdOut(OProcess* proc, char* buf, int len){
@@ -116,5 +107,4 @@ void Obex::slotStdOut(OProcess* proc, char* buf, int len){
QByteArray ar( len );
memcpy( ar.data(), buf, len );
- owarn << "parsed: " << ar.data() << oendl;
m_outp.append( ar );
}
@@ -125,5 +115,4 @@ void Obex::received() {
if ( m_rec->exitStatus() == 0 ) { // we got one
QString filename = parseOut();
- owarn << "ACHTUNG " << filename.latin1() << oendl;
emit receivedFile( filename );
}
@@ -141,5 +130,4 @@ void Obex::sendEnd() {
delete m_send;
m_send=0;
- owarn << "done" << oendl;
emit sent(true);
}else if (m_send->exitStatus() == 255 ) { // it failed maybe the other side wasn't ready
@@ -147,5 +135,4 @@ void Obex::sendEnd() {
delete m_send;
m_send = 0;
- owarn << "try sending again" << oendl;
sendNow();
}
@@ -164,12 +151,8 @@ QString Obex::parseOut( ){
int pos = (*it).findRev('(' );
if ( pos > 0 ) {
- owarn << pos << " " << (*it).mid(6 ).latin1() << oendl;
- owarn << (*it).length() << " " << (*it).length()-pos << oendl;
path = (*it).remove( pos, (*it).length() - pos );
- owarn << path.latin1() << oendl;
path = path.mid(6 );
path = path.stripWhiteSpace();
- owarn << "path " << path.latin1() << oendl;
}
}
@@ -181,5 +164,4 @@ QString Obex::parseOut( ){
*/
void Obex::slotError() {
- owarn << "slotError" << oendl;
if ( m_receive )
receive();
@@ -194,8 +176,6 @@ void Obex::setReceiveEnabled( bool receive ) {
void Obex::shutDownReceive() {
if (m_rec != 0 ) {
- owarn << "running" << oendl;
if (m_rec->isRunning() ) {
emit error(-1 );
- owarn << "is running" << oendl;
delete m_rec;
m_rec = 0;
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp
index f3dd11c..675c5e4 100644
--- a/core/obex/obexsend.cpp
+++ b/core/obex/obexsend.cpp
@@ -106,5 +106,4 @@ void SendWidget::send( const QString& file, const QString& desc ) {
}
void SendWidget::slotIrDaDevices( const QStringList& list) {
- 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.") );
@@ -124,6 +123,5 @@ void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) {
m_devBox->removeDevice( m_btDeSearch );
}
-void SendWidget::slotSelectedDevice( int name, int dev ) {
- owarn << "Start beam? " << name << " " << dev << "" << oendl;
+void SendWidget::slotSelectedDevice( int name, int ) {
if ( name == m_irDeSearch ) {
for (QMap<int, QString>::Iterator it= m_irDa.begin(); it != m_irDa.end(); ++it )
@@ -134,5 +132,4 @@ void SendWidget::slotSelectedDevice( int name, int dev ) {
}
void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) {
- owarn << "dispatch irda " << str.data() << "" << oendl;
if ( str == "devices(QStringList)" ) {
QDataStream stream( ar, IO_ReadOnly );
@@ -149,5 +146,4 @@ void SendWidget::slotIrError( int ) {
}
void SendWidget::slotIrSent( bool b) {
- owarn << "irda sent!!" << oendl;
QString text = b ? tr("Sent") : tr("Failure");
m_devBox->setStatus( m_irDaIt.key(), text );
@@ -206,5 +202,4 @@ void DeviceBox::setStatus( int id, const QString& status ) {
}
void DeviceBox::setSource( const QString& str ) {
- owarn << "SetSource:" << str.toInt() << "" << oendl;
int id = str.toInt();
emit selectedDevice( id, m_dev[id].device() );
diff --git a/core/obex/receiver.cpp b/core/obex/receiver.cpp
index d4ae323..7d9a42a 100644
--- a/core/obex/receiver.cpp
+++ b/core/obex/receiver.cpp
@@ -77,15 +77,13 @@ void Receiver::tidyUp( QString& _file, const QString& ending) {
return;
- (void)::strncat( foo, ending.latin1(), 4 );
- _file = QString::fromLatin1( foo );
+ (void)::strncat( foo, QFile::encodeName(ending), 4 );
+ _file = QString::fromLocal8Bit( foo );
QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) );
- owarn << "Executing: " << cmd << "" << oendl;
- (void)::system( cmd.latin1() );
+ (void)::system( QFile::encodeName(cmd) );
cmd = QString("rm %1").arg( Global::shellQuote(file) );
- (void)::system( cmd.latin1() );
+ (void)::system( QFile::encodeName(cmd) );
}
int Receiver::checkFile( QString& file ) {
- owarn << "check file!! " << file << "" << oendl;
int ret;
QString ending;
@@ -112,5 +110,4 @@ int Receiver::checkFile( QString& file ) {
tidyUp( file, ending );
- owarn << "check it now " << ret << "" << oendl;
return ret;
}
@@ -153,5 +150,4 @@ void OtherHandler::handle( const QString& file ) {
m_na->setText(file);
DocLnk lnk(file);
- 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() );
@@ -196,13 +192,7 @@ QString OtherHandler::targetName( const QString& file ) {
/* fast cpy */
void OtherHandler::copy(const QString& src, const QString& file) {
- owarn << "src " << src << ", dest " << file << "" << oendl;
FileManager *fm;
if(!fm->copyFile(src,file)) {
owarn << "Copy failed" << oendl;
}
-
-// QString cmd = QString("mv %1 %2").arg( Global::shellQuote( src )).
-// arg( Global::shellQuote( file ) );
-// ::system( cmd.latin1() );
- // done
}