summaryrefslogtreecommitdiff
path: root/core/obex/receiver.cpp
Unidiff
Diffstat (limited to 'core/obex/receiver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/receiver.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/obex/receiver.cpp b/core/obex/receiver.cpp
index d5a7271..31c6afe 100644
--- a/core/obex/receiver.cpp
+++ b/core/obex/receiver.cpp
@@ -138,9 +138,9 @@ QString OtherHandler::targetName( const QString& file ) {
138 138
139 int trie = 0; 139 int trie = 0;
140 while (QFile::exists(newFile + info.extension() ) ) { 140 while (QFile::exists(newFile + "."+info.extension() ) ) {
141 newFile = newFileBase + "_"+QString::number(trie) ; 141 newFile = newFileBase + "_"+QString::number(trie) ;
142 trie++; 142 trie++;
143 } 143 }
144 newFile += info.extension(); 144 newFile += "." + info.extension();
145 145
146 return newFile; 146 return newFile;
@@ -149,4 +149,5 @@ QString OtherHandler::targetName( const QString& file ) {
149/* fast cpy */ 149/* fast cpy */
150void OtherHandler::copy(const QString& src, const QString& file) { 150void OtherHandler::copy(const QString& src, const QString& file) {
151 qWarning("src %s, dest %s", src.latin1(),file.latin1() );
151 int src_fd = ::open( QFile::encodeName( src ), O_RDONLY ); 152 int src_fd = ::open( QFile::encodeName( src ), O_RDONLY );
152 int to_fd = ::open( QFile::encodeName( file), O_RDWR| O_CREAT| O_TRUNC, 153 int to_fd = ::open( QFile::encodeName( file), O_RDWR| O_CREAT| O_TRUNC,
@@ -156,4 +157,5 @@ void OtherHandler::copy(const QString& src, const QString& file) {
156 ::fstat(src_fd, &stater ); 157 ::fstat(src_fd, &stater );
157 ::lseek(to_fd, stater.st_size-1, SEEK_SET ); 158 ::lseek(to_fd, stater.st_size-1, SEEK_SET );
159 ::write(to_fd, "", 1 );
158 160
159 void *src_addr, *dest_addr; 161 void *src_addr, *dest_addr;
@@ -163,5 +165,5 @@ void OtherHandler::copy(const QString& src, const QString& file) {
163 MAP_FILE | MAP_PRIVATE, to_fd, 0 ); 165 MAP_FILE | MAP_PRIVATE, to_fd, 0 );
164 166
165 ::memcpy(src_addr , dest_addr, stater.st_size ); 167 ::memcpy(dest_addr , src_addr, stater.st_size );
166 ::munmap(src_addr , stater.st_size ); 168 ::munmap(src_addr , stater.st_size );
167 ::munmap(dest_addr, stater.st_size ); 169 ::munmap(dest_addr, stater.st_size );