-rw-r--r-- | core/obex/receiver.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/obex/receiver.cpp b/core/obex/receiver.cpp index 8885256..d4ae323 100644 --- a/core/obex/receiver.cpp +++ b/core/obex/receiver.cpp @@ -1,33 +1,34 @@ #include "obex.h" #include "receiver.h" using namespace OpieObex; /* OPIE */ #include <opie2/odebug.h> #include <qpe/applnk.h> #include <qpe/qpeapplication.h> #include <qpe/qcopenvelope_qws.h> +#include <qpe/filemanager.h> using namespace Opie::Core; /* QT */ #include <qfileinfo.h> #include <qlabel.h> #include <qtextview.h> #include <qpushbutton.h> /* STD */ #include <sys/types.h> #include <sys/stat.h> #include <sys/mman.h> #include <stdlib.h> // int system #include <unistd.h> #include <fcntl.h> /* TRANSLATOR OpieObex::Receiver */ Receiver::Receiver() { m_obex = new Obex(this, "Receiver"); connect(m_obex, SIGNAL(receivedFile(const QString&) ), this, SLOT(slotReceived(const QString&) ) ); m_obex->receive(); } @@ -174,29 +175,34 @@ void OtherHandler::deny() { delete this; } QString OtherHandler::targetName( const QString& file ) { QFileInfo info( file ); /* $HOME needs to be set!!!! */ Global::createDocDir(); QString newFile = QPEApplication::documentDir()+ "/"+ info.baseName(); QString newFileBase = newFile; int trie = 0; while (QFile::exists(newFile + "."+info.extension() ) ) { newFile = newFileBase + "_"+QString::number(trie) ; trie++; } newFile += "." + info.extension(); return newFile; } /* fast cpy */ void OtherHandler::copy(const QString& src, const QString& file) { owarn << "src " << src << ", dest " << file << "" << oendl; - QString cmd = QString("mv %1 %2").arg( Global::shellQuote( src )). - arg( Global::shellQuote( file ) ); - ::system( cmd.latin1() ); + 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 } |