author | zecke <zecke> | 2004-09-12 18:55:56 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-12 18:55:56 (UTC) |
commit | 46a2a6d2f0046b6971cae371453705f6177fc93e (patch) (unidiff) | |
tree | efb29d94d733716631f65820249e81691ff55761 | |
parent | 36a4f75e1f4e5a3858749779ea26a3fe3154d1f0 (diff) | |
download | opie-46a2a6d2f0046b6971cae371453705f6177fc93e.zip opie-46a2a6d2f0046b6971cae371453705f6177fc93e.tar.gz opie-46a2a6d2f0046b6971cae371453705f6177fc93e.tar.bz2 |
-Kill all owarn statements as they're not needed/useful anymore
-Kill all hardcoding to latin1 and use the system encoding/decoding
-rw-r--r-- | core/obex/obex.cc | 28 | ||||
-rw-r--r-- | core/obex/obexsend.cpp | 7 | ||||
-rw-r--r-- | core/obex/receiver.cpp | 18 |
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 | |||
@@ -36,3 +36,2 @@ void Obex::receive() { | |||
36 | m_outp = QString::null; | 36 | m_outp = QString::null; |
37 | owarn << "Receive" << oendl; | ||
38 | m_rec = new OProcess(); | 37 | m_rec = new OProcess(); |
@@ -47,3 +46,2 @@ void Obex::receive() { | |||
47 | if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { | 46 | if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { |
48 | owarn << "could not start :(" oendl; | ||
49 | emit done( false ); | 47 | emit done( false ); |
@@ -52,5 +50,4 @@ void Obex::receive() { | |||
52 | } | 50 | } |
53 | // emit currentTry(m_count ); | ||
54 | |||
55 | } | 51 | } |
52 | |||
56 | void Obex::send( const QString& fileName) { // if currently receiving stop it send receive | 53 | void Obex::send( const QString& fileName) { // if currently receiving stop it send receive |
@@ -58,8 +55,5 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se | |||
58 | m_file = fileName; | 55 | m_file = fileName; |
59 | owarn << "send " << fileName.latin1() << oendl; | ||
60 | if (m_rec != 0 ) { | 56 | if (m_rec != 0 ) { |
61 | owarn << "running" oendl; | ||
62 | if (m_rec->isRunning() ) { | 57 | if (m_rec->isRunning() ) { |
63 | emit error(-1 ); | 58 | emit error(-1 ); |
64 | owarn << "is running" << oendl; | ||
65 | delete m_rec; | 59 | delete m_rec; |
@@ -68,3 +62,2 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se | |||
68 | }else{ | 62 | }else{ |
69 | owarn << "is not running" << oendl; | ||
70 | emit error( -1 ); // we did not delete yet but it's not running slotExited is pending | 63 | emit error( -1 ); // we did not delete yet but it's not running slotExited is pending |
@@ -76,3 +69,2 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se | |||
76 | void Obex::sendNow(){ | 69 | void Obex::sendNow(){ |
77 | owarn << "sendNow" << oendl; | ||
78 | if ( m_count >= 25 ) { // could not send | 70 | if ( m_count >= 25 ) { // could not send |
@@ -95,3 +87,2 @@ void Obex::sendNow(){ | |||
95 | if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { | 87 | if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { |
96 | owarn << "could not send" << oendl; | ||
97 | m_count = 25; | 88 | m_count = 25; |
@@ -107,7 +98,7 @@ void Obex::sendNow(){ | |||
107 | void Obex::slotExited(OProcess* proc ){ | 98 | void Obex::slotExited(OProcess* proc ){ |
108 | if (proc == m_rec ) { // receive process | 99 | if (proc == m_rec ) // receive process |
109 | received(); | 100 | received(); |
110 | }else if ( proc == m_send ) { | 101 | else if ( proc == m_send ) |
111 | sendEnd(); | 102 | sendEnd(); |
112 | } | 103 | |
113 | } | 104 | } |
@@ -117,3 +108,2 @@ void Obex::slotStdOut(OProcess* proc, char* buf, int len){ | |||
117 | memcpy( ar.data(), buf, len ); | 108 | memcpy( ar.data(), buf, len ); |
118 | owarn << "parsed: " << ar.data() << oendl; | ||
119 | m_outp.append( ar ); | 109 | m_outp.append( ar ); |
@@ -126,3 +116,2 @@ void Obex::received() { | |||
126 | QString filename = parseOut(); | 116 | QString filename = parseOut(); |
127 | owarn << "ACHTUNG " << filename.latin1() << oendl; | ||
128 | emit receivedFile( filename ); | 117 | emit receivedFile( filename ); |
@@ -142,3 +131,2 @@ void Obex::sendEnd() { | |||
142 | m_send=0; | 131 | m_send=0; |
143 | owarn << "done" << oendl; | ||
144 | emit sent(true); | 132 | emit sent(true); |
@@ -148,3 +136,2 @@ void Obex::sendEnd() { | |||
148 | m_send = 0; | 136 | m_send = 0; |
149 | owarn << "try sending again" << oendl; | ||
150 | sendNow(); | 137 | sendNow(); |
@@ -165,10 +152,6 @@ QString Obex::parseOut( ){ | |||
165 | if ( pos > 0 ) { | 152 | if ( pos > 0 ) { |
166 | owarn << pos << " " << (*it).mid(6 ).latin1() << oendl; | ||
167 | owarn << (*it).length() << " " << (*it).length()-pos << oendl; | ||
168 | 153 | ||
169 | path = (*it).remove( pos, (*it).length() - pos ); | 154 | path = (*it).remove( pos, (*it).length() - pos ); |
170 | owarn << path.latin1() << oendl; | ||
171 | path = path.mid(6 ); | 155 | path = path.mid(6 ); |
172 | path = path.stripWhiteSpace(); | 156 | path = path.stripWhiteSpace(); |
173 | owarn << "path " << path.latin1() << oendl; | ||
174 | } | 157 | } |
@@ -182,3 +165,2 @@ QString Obex::parseOut( ){ | |||
182 | void Obex::slotError() { | 165 | void Obex::slotError() { |
183 | owarn << "slotError" << oendl; | ||
184 | if ( m_receive ) | 166 | if ( m_receive ) |
@@ -195,6 +177,4 @@ void Obex::shutDownReceive() { | |||
195 | if (m_rec != 0 ) { | 177 | if (m_rec != 0 ) { |
196 | owarn << "running" << oendl; | ||
197 | if (m_rec->isRunning() ) { | 178 | if (m_rec->isRunning() ) { |
198 | emit error(-1 ); | 179 | emit error(-1 ); |
199 | owarn << "is running" << oendl; | ||
200 | delete m_rec; | 180 | delete m_rec; |
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 | |||
@@ -107,3 +107,2 @@ void SendWidget::send( const QString& file, const QString& desc ) { | |||
107 | void SendWidget::slotIrDaDevices( const QStringList& list) { | 107 | void SendWidget::slotIrDaDevices( const QStringList& list) { |
108 | owarn << "slot it irda devices " << oendl; | ||
109 | for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { | 108 | for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { |
@@ -125,4 +124,3 @@ void SendWidget::slotBTDevices( const QMap<QString, QString>& str ) { | |||
125 | } | 124 | } |
126 | void SendWidget::slotSelectedDevice( int name, int dev ) { | 125 | void SendWidget::slotSelectedDevice( int name, int ) { |
127 | owarn << "Start beam? " << name << " " << dev << "" << oendl; | ||
128 | if ( name == m_irDeSearch ) { | 126 | if ( name == m_irDeSearch ) { |
@@ -135,3 +133,2 @@ void SendWidget::slotSelectedDevice( int name, int dev ) { | |||
135 | void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) { | 133 | void SendWidget::dispatchIrda( const QCString& str, const QByteArray& ar ) { |
136 | owarn << "dispatch irda " << str.data() << "" << oendl; | ||
137 | if ( str == "devices(QStringList)" ) { | 134 | if ( str == "devices(QStringList)" ) { |
@@ -150,3 +147,2 @@ void SendWidget::slotIrError( int ) { | |||
150 | void SendWidget::slotIrSent( bool b) { | 147 | void SendWidget::slotIrSent( bool b) { |
151 | owarn << "irda sent!!" << oendl; | ||
152 | QString text = b ? tr("Sent") : tr("Failure"); | 148 | QString text = b ? tr("Sent") : tr("Failure"); |
@@ -207,3 +203,2 @@ void DeviceBox::setStatus( int id, const QString& status ) { | |||
207 | void DeviceBox::setSource( const QString& str ) { | 203 | void DeviceBox::setSource( const QString& str ) { |
208 | owarn << "SetSource:" << str.toInt() << "" << oendl; | ||
209 | int id = str.toInt(); | 204 | int id = str.toInt(); |
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 | |||
@@ -78,13 +78,11 @@ void Receiver::tidyUp( QString& _file, const QString& ending) { | |||
78 | 78 | ||
79 | (void)::strncat( foo, ending.latin1(), 4 ); | 79 | (void)::strncat( foo, QFile::encodeName(ending), 4 ); |
80 | _file = QString::fromLatin1( foo ); | 80 | _file = QString::fromLocal8Bit( foo ); |
81 | QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) ); | 81 | QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) ); |
82 | owarn << "Executing: " << cmd << "" << oendl; | 82 | (void)::system( QFile::encodeName(cmd) ); |
83 | (void)::system( cmd.latin1() ); | ||
84 | 83 | ||
85 | cmd = QString("rm %1").arg( Global::shellQuote(file) ); | 84 | cmd = QString("rm %1").arg( Global::shellQuote(file) ); |
86 | (void)::system( cmd.latin1() ); | 85 | (void)::system( QFile::encodeName(cmd) ); |
87 | } | 86 | } |
88 | int Receiver::checkFile( QString& file ) { | 87 | int Receiver::checkFile( QString& file ) { |
89 | owarn << "check file!! " << file << "" << oendl; | ||
90 | int ret; | 88 | int ret; |
@@ -113,3 +111,2 @@ int Receiver::checkFile( QString& file ) { | |||
113 | 111 | ||
114 | owarn << "check it now " << ret << "" << oendl; | ||
115 | return ret; | 112 | return ret; |
@@ -154,3 +151,2 @@ void OtherHandler::handle( const QString& file ) { | |||
154 | DocLnk lnk(file); | 151 | DocLnk lnk(file); |
155 | owarn << " " << lnk.type() << " " << lnk.icon() << "" << oendl; | ||
156 | 152 | ||
@@ -197,3 +193,2 @@ QString OtherHandler::targetName( const QString& file ) { | |||
197 | void OtherHandler::copy(const QString& src, const QString& file) { | 193 | void OtherHandler::copy(const QString& src, const QString& file) { |
198 | owarn << "src " << src << ", dest " << file << "" << oendl; | ||
199 | FileManager *fm; | 194 | FileManager *fm; |
@@ -202,7 +197,2 @@ void OtherHandler::copy(const QString& src, const QString& file) { | |||
202 | } | 197 | } |
203 | |||
204 | // QString cmd = QString("mv %1 %2").arg( Global::shellQuote( src )). | ||
205 | // arg( Global::shellQuote( file ) ); | ||
206 | // ::system( cmd.latin1() ); | ||
207 | // done | ||
208 | } | 198 | } |