summaryrefslogtreecommitdiff
path: root/core/obex/receiver.cpp
Unidiff
Diffstat (limited to 'core/obex/receiver.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/obex/receiver.cpp18
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) {
73 73
74 int fd = ::mkstemp(foo); 74 int fd = ::mkstemp(foo);
75 75
76 if ( fd == -1 ) 76 if ( fd == -1 )
77 return; 77 return;
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}
88int Receiver::checkFile( QString& file ) { 87int Receiver::checkFile( QString& file ) {
89 owarn << "check file!! " << file << "" << oendl;
90 int ret; 88 int ret;
91 QString ending; 89 QString ending;
92 90
93 if (file.right(4) == ".vcs" ) { 91 if (file.right(4) == ".vcs" ) {
94 ret = Datebook; 92 ret = Datebook;
95 ending = QString::fromLatin1(".vcs"); 93 ending = QString::fromLatin1(".vcs");
@@ -108,13 +106,12 @@ int Receiver::checkFile( QString& file ) {
108 * and M$ likes to send that. So we will executed a small 106 * and M$ likes to send that. So we will executed a small
109 * tidy up system sed script 107 * tidy up system sed script
110 * At this point we can also remove umlaute from the filename 108 * At this point we can also remove umlaute from the filename
111 */ 109 */
112 tidyUp( file, ending ); 110 tidyUp( file, ending );
113 111
114 owarn << "check it now " << ret << "" << oendl;
115 return ret; 112 return ret;
116} 113}
117 114
118/* TRANSLATOR OpieObex::OtherHandler */ 115/* TRANSLATOR OpieObex::OtherHandler */
119 116
120OtherHandler::OtherHandler() 117OtherHandler::OtherHandler()
@@ -149,13 +146,12 @@ OtherHandler::~OtherHandler() {
149 146
150} 147}
151void OtherHandler::handle( const QString& file ) { 148void OtherHandler::handle( const QString& file ) {
152 m_file = file; 149 m_file = file;
153 m_na->setText(file); 150 m_na->setText(file);
154 DocLnk lnk(file); 151 DocLnk lnk(file);
155 owarn << " " << lnk.type() << " " << lnk.icon() << "" << oendl;
156 152
157 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() ); 153 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() );
158 m_view->setText( str ); 154 m_view->setText( str );
159} 155}
160 156
161/* 157/*
@@ -192,17 +188,11 @@ QString OtherHandler::targetName( const QString& file ) {
192 188
193 return newFile; 189 return newFile;
194} 190}
195 191
196/* fast cpy */ 192/* fast cpy */
197void OtherHandler::copy(const QString& src, const QString& file) { 193void OtherHandler::copy(const QString& src, const QString& file) {
198 owarn << "src " << src << ", dest " << file << "" << oendl;
199 FileManager *fm; 194 FileManager *fm;
200 if(!fm->copyFile(src,file)) { 195 if(!fm->copyFile(src,file)) {
201 owarn << "Copy failed" << oendl; 196 owarn << "Copy failed" << oendl;
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}