author | zecke <zecke> | 2004-09-12 18:55:56 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-12 18:55:56 (UTC) |
commit | 46a2a6d2f0046b6971cae371453705f6177fc93e (patch) (side-by-side diff) | |
tree | efb29d94d733716631f65820249e81691ff55761 /core/obex/receiver.cpp | |
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/receiver.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
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 @@ -73,23 +73,21 @@ void Receiver::tidyUp( QString& _file, const QString& ending) { int fd = ::mkstemp(foo); if ( fd == -1 ) 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; if (file.right(4) == ".vcs" ) { ret = Datebook; ending = QString::fromLatin1(".vcs"); @@ -108,13 +106,12 @@ 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 ); - owarn << "check it now " << ret << "" << oendl; return ret; } /* TRANSLATOR OpieObex::OtherHandler */ OtherHandler::OtherHandler() @@ -149,13 +146,12 @@ OtherHandler::~OtherHandler() { } void OtherHandler::handle( const QString& file ) { m_file = 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() ); m_view->setText( str ); } /* @@ -192,17 +188,11 @@ QString OtherHandler::targetName( const QString& file ) { return newFile; } /* 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 } |