author | kergoth <kergoth> | 2003-08-09 17:29:36 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 17:29:36 (UTC) |
commit | a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93 (patch) (unidiff) | |
tree | 5ce78e1a5dedd31b7851d53bf9f072bd44edd1b0 /core | |
parent | a7e015198a8c5ad3b6e144a9032b059086253e00 (diff) | |
download | opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.zip opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.gz opie-a0bab0e281fbaf6f6ebbb1a48e5c06426bfbbb93.tar.bz2 |
Merge from BRANCH_1_0
-rw-r--r-- | core/applets/batteryapplet/battery.cpp | 10 | ||||
-rw-r--r-- | core/applets/batteryapplet/batterystatus.cpp | 2 | ||||
-rw-r--r-- | core/applets/cardmon/cardmon.cpp | 4 | ||||
-rw-r--r-- | core/applets/homeapplet/home.h | 0 | ||||
-rw-r--r-- | core/applets/restartapplet2/.cvsignore | 1 | ||||
-rw-r--r-- | core/applets/suspendapplet/suspend.h | 0 | ||||
-rw-r--r-- | core/launcher/launcher.cpp | 158 | ||||
-rw-r--r-- | core/obex/obex.cc | 13 | ||||
-rw-r--r-- | core/obex/obexhandler.cpp | 2 | ||||
-rw-r--r-- | core/obex/obeximpl.cpp | 2 | ||||
-rw-r--r-- | core/obex/obexsend.cpp | 2 | ||||
-rw-r--r-- | core/obex/receiver.cpp | 73 | ||||
-rw-r--r-- | core/obex/receiver.h | 5 |
13 files changed, 130 insertions, 142 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp index 480d261..078ce8d 100644 --- a/core/applets/batteryapplet/battery.cpp +++ b/core/applets/batteryapplet/battery.cpp | |||
@@ -124,14 +124,4 @@ void BatteryMeter::paintEvent( QPaintEvent* ) | |||
124 | p.setFont( f ); | 124 | p.setFont( f ); |
125 | if ( percent > 98 ) { | ||
126 | p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "F" ) ); | ||
127 | } | ||
128 | else if ( percent < 5 ) | ||
129 | { | ||
130 | p.drawText( 0, 0, width(), height(), Qt::AlignCenter, tr( "E" ) ); | ||
131 | } | ||
132 | else | ||
133 | { | ||
134 | p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); | 125 | p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); |
135 | p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); | 126 | p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); |
136 | } | ||
137 | return; | 127 | return; |
diff --git a/core/applets/batteryapplet/batterystatus.cpp b/core/applets/batteryapplet/batterystatus.cpp index 092a48d..5936b5d 100644 --- a/core/applets/batteryapplet/batterystatus.cpp +++ b/core/applets/batteryapplet/batterystatus.cpp | |||
@@ -242,3 +242,3 @@ void BatteryStatus::paintEvent( QPaintEvent * ) { | |||
242 | 242 | ||
243 | int jackPerc = ( jackPercent / 100.0 ) * screenWidth - 47; | 243 | int jackPerc = ( jackPercent / 100.0 ) * ( screenWidth - 47 ) ; |
244 | 244 | ||
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp index b8c4553..4ed09b8 100644 --- a/core/applets/cardmon/cardmon.cpp +++ b/core/applets/cardmon/cardmon.cpp | |||
@@ -274,3 +274,5 @@ bool CardMonitor::getStatusPcmcia(int showPopUp) | |||
274 | } | 274 | } |
275 | #ifndef QT_NO_SOUND | ||
275 | QSound::play(Resource::findSound("cardmon/card" + what)); | 276 | QSound::play(Resource::findSound("cardmon/card" + what)); |
277 | #endif | ||
276 | } | 278 | } |
@@ -326,3 +328,5 @@ bool CardMonitor::getStatusSd(int showPopUp) | |||
326 | //qDebug("TEXT: " + text ); | 328 | //qDebug("TEXT: " + text ); |
329 | #ifndef QT_NO_SOUND | ||
327 | QSound::play(Resource::findSound("cardmon/card" + what)); | 330 | QSound::play(Resource::findSound("cardmon/card" + what)); |
331 | #endif | ||
328 | popUp(text, "cardmon/ide");// XX add SD pic | 332 | popUp(text, "cardmon/ide");// XX add SD pic |
diff --git a/core/applets/homeapplet/home.h b/core/applets/homeapplet/home.h index 64af97d..1186caf 100644 --- a/core/applets/homeapplet/home.h +++ b/core/applets/homeapplet/home.h | |||
diff --git a/core/applets/restartapplet2/.cvsignore b/core/applets/restartapplet2/.cvsignore index a403d26..4943911 100644 --- a/core/applets/restartapplet2/.cvsignore +++ b/core/applets/restartapplet2/.cvsignore | |||
@@ -6,2 +6 @@ moc_* | |||
6 | opieobjconfig.in | opieobjconfig.in | |
7 | opieobj | ||
diff --git a/core/applets/suspendapplet/suspend.h b/core/applets/suspendapplet/suspend.h index 0c92bcb..75467c1 100644 --- a/core/applets/suspendapplet/suspend.h +++ b/core/applets/suspendapplet/suspend.h | |||
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 0205622..8b2907a 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -24,4 +24,2 @@ | |||
24 | 24 | ||
25 | //#include <opie/ofiledialog.h> | ||
26 | #include <opie/ofileselector.h> | ||
27 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
@@ -167,31 +165,31 @@ void CategoryTabWidget::addItem( const QString& linkfile ) | |||
167 | { | 165 | { |
168 | // int i=0; | 166 | int i=0; |
169 | // AppLnk *app = new AppLnk(linkfile); | 167 | AppLnk *app = new AppLnk(linkfile); |
170 | // if ( !app->isValid() ) { | 168 | if ( !app->isValid() ) { |
171 | // delete app; | 169 | delete app; |
172 | // app=0; | 170 | app=0; |
173 | // } | 171 | } |
174 | // if ( !app || !app->file().isEmpty() ) { | 172 | if ( !app || !app->file().isEmpty() ) { |
175 | // A document | 173 | // A document |
176 | // delete app; | 174 | delete app; |
177 | // app = new DocLnk(linkfile); | 175 | app = new DocLnk(linkfile); |
178 | // if ( app->fileKnown() ) { | 176 | if ( app->fileKnown() ) { |
179 | // ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app); | 177 | ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app); |
180 | // } else { | 178 | } else { |
181 | // ((LauncherView*)(stack->widget(ids.count()-1)))->sort(); | 179 | ((LauncherView*)(stack->widget(ids.count()-1)))->sort(); |
182 | // delete app; | 180 | delete app; |
183 | // } | 181 | } |
184 | // return; | 182 | return; |
185 | // } | 183 | } |
186 | // An application | 184 | // An application |
187 | // for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) { | 185 | for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) { |
188 | // if ( !(*it).isEmpty() ) { | 186 | if ( !(*it).isEmpty() ) { |
189 | // QRegExp tf(*it,FALSE,TRUE); | 187 | QRegExp tf(*it,FALSE,TRUE); |
190 | // if ( tf.match(app->type()) >= 0 ) { | 188 | if ( tf.match(app->type()) >= 0 ) { |
191 | // ((LauncherView*)stack->widget(i))->addItem(app); | 189 | ((LauncherView*)stack->widget(i))->addItem(app); |
192 | // return; | 190 | return; |
193 | // } | 191 | } |
194 | // i++; | 192 | i++; |
195 | // } | 193 | } |
196 | // } | 194 | } |
197 | 195 | ||
@@ -201,3 +199,3 @@ void CategoryTabWidget::addItem( const QString& linkfile ) | |||
201 | void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | 199 | void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, |
202 | AppLnkSet* /*docFolder*/, const QList<FileSystem> & /*fs*/) | 200 | AppLnkSet* docFolder, const QList<FileSystem> &fs) |
203 | { | 201 | { |
@@ -255,19 +253,9 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | |||
255 | pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | 253 | pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
256 | 254 | docview = newView( "Documents", // No tr | |
257 | //ljpotter | 255 | pm, tr("Documents")); |
258 | CategoryTab *catTab ; | 256 | docview->populate( docFolder, QString::null ); |
259 | catTab = new CategoryTab( pm, "Documents" ); | 257 | docFolder->detachChildren(); |
260 | 258 | docview->setFileSystems(fs); | |
261 | categoryBar->addTab( catTab ); | 259 | docview->setToolsEnabled(TRUE); |
262 | 260 | setTabAppearance( "Documents", cfg ); // No tr | |
263 | fileSel = new DocumentTab( stack, 4, 0, "/",""); | ||
264 | stack->addWidget( fileSel, tabs++ ); | ||
265 | |||
266 | // fileSel->hide(); | ||
267 | |||
268 | connect( fileSel, SIGNAL( fileSelected( const DocLnk & )), | ||
269 | this, SLOT(clickie(const DocLnk&)) ); | ||
270 | |||
271 | // connect( fileSel, SIGNAL( fileSelected( const QString & )), | ||
272 | // this, SLOT(clickie(const QString&)) ); | ||
273 | 261 | ||
@@ -287,3 +275,2 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | |||
287 | 275 | ||
288 | |||
289 | QCopEnvelope e("QPE/TaskBar","reloadApps()"); | 276 | QCopEnvelope e("QPE/TaskBar","reloadApps()"); |
@@ -291,12 +278,2 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | |||
291 | 278 | ||
292 | void CategoryTabWidget::clickie(const DocLnk &lnk) { | ||
293 | lnk.execute(); | ||
294 | // fileSel->reparse(); | ||
295 | } | ||
296 | |||
297 | void CategoryTabWidget::clickie(const QString &appStr) { | ||
298 | // DocLnk lnk(appStr); | ||
299 | // lnk.execute(); | ||
300 | } | ||
301 | |||
302 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) | 279 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) |
@@ -343,6 +320,9 @@ void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) | |||
343 | 320 | ||
344 | //void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> & /*fs*/) | 321 | void CategoryTabWidget::updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs) |
345 | //{ | 322 | { |
346 | // docFolder->detachChildren(); | 323 | docview->populate( docFolder, QString::null ); |
347 | //} | 324 | docFolder->detachChildren(); |
325 | docview->setFileSystems(fs); | ||
326 | docview->updateTools(); | ||
327 | } | ||
348 | 328 | ||
@@ -365,3 +345,3 @@ QString CategoryTabWidget::getAllDocLinkInfo() const | |||
365 | { | 345 | { |
366 | return ""; | 346 | return docview->getAllDocLinkInfo(); |
367 | } | 347 | } |
@@ -383,10 +363,11 @@ void CategoryTabWidget::updateLink(const QString& linkfile) | |||
383 | { | 363 | { |
384 | // LauncherView* view; | 364 | int i=0; |
385 | qApp->processEvents(); | 365 | LauncherView* view; |
386 | // while ((view = (LauncherView*)stack->widget(i++))) { | 366 | //qApp->processEvents(); |
387 | // if ( view->removeLink(linkfile) ) | 367 | while ((view = (LauncherView*)stack->widget(i++))) { |
388 | // break; | 368 | if ( view->removeLink(linkfile) ) |
389 | // } | 369 | break; |
390 | // addItem(linkfile); | 370 | } |
391 | fileSel->reparse(); | 371 | addItem(linkfile); |
372 | docview->updateTools(); | ||
392 | } | 373 | } |
@@ -408,3 +389,3 @@ void CategoryTabWidget::setBusy(bool on) | |||
408 | else | 389 | else |
409 | for (int i=0; i<tabs-1; i++) | 390 | for (int i=0; i<tabs; i++) |
410 | ((LauncherView*)stack->widget(i))->setBusy(FALSE); | 391 | ((LauncherView*)stack->widget(i))->setBusy(FALSE); |
@@ -669,3 +650,2 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl ) | |||
669 | 650 | ||
670 | |||
671 | #if !defined(QT_NO_COP) | 651 | #if !defined(QT_NO_COP) |
@@ -754,2 +734,3 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: | |||
754 | { | 734 | { |
735 | |||
755 | OWait *owait = new OWait(); | 736 | OWait *owait = new OWait(); |
@@ -759,4 +740,6 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: | |||
759 | qApp->processEvents(); | 740 | qApp->processEvents(); |
760 | if(docsFolder) delete docsFolder; | 741 | |
742 | delete docsFolder; | ||
761 | docsFolder = new DocLnkSet; | 743 | docsFolder = new DocLnkSet; |
744 | |||
762 | DocLnkSet *tmp = 0; | 745 | DocLnkSet *tmp = 0; |
@@ -783,7 +766,5 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: | |||
783 | // a) -zecke we don't want to check | 766 | // a) -zecke we don't want to check |
784 | if(!mediumCfg.readBoolEntry("use", true ) ) { | 767 | if(!mediumCfg.readBoolEntry("use", true ) ) |
785 | owait->hide(); | ||
786 | delete owait; | ||
787 | return; | 768 | return; |
788 | } | 769 | |
789 | // find out wich filesystems are new in this round | 770 | // find out wich filesystems are new in this round |
@@ -806,4 +787,2 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global:: | |||
806 | } // done | 787 | } // done |
807 | owait->hide(); | ||
808 | delete owait; | ||
809 | return; // save the else | 788 | return; // save the else |
@@ -871,2 +850,3 @@ void Launcher::updateTabs() | |||
871 | MimeType::updateApplications(); // ### reads all applnks twice | 850 | MimeType::updateApplications(); // ### reads all applnks twice |
851 | |||
872 | delete rootFolder; | 852 | delete rootFolder; |
@@ -882,3 +862,3 @@ void Launcher::updateDocs() | |||
882 | loadDocs(); | 862 | loadDocs(); |
883 | // tabs->updateDocs(docsFolder,storage->fileSystems()); | 863 | tabs->updateDocs(docsFolder,storage->fileSystems()); |
884 | } | 864 | } |
@@ -1339,17 +1319 @@ void Launcher::preloadApps() | |||
1339 | } | } | |
1340 | |||
1341 | DocumentTab::DocumentTab( QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName) | ||
1342 | : OFileSelector(parent,mode,selector,dirName,fileName) | ||
1343 | { | ||
1344 | setYesCancelVisible(false); | ||
1345 | setToolbarVisible(false); | ||
1346 | setPermissionBarVisible(false); | ||
1347 | setLineEditVisible(false) ; | ||
1348 | //setChooserVisible( bool chooser ); | ||
1349 | |||
1350 | } | ||
1351 | |||
1352 | DocumentTab::~DocumentTab() { | ||
1353 | |||
1354 | } | ||
1355 | |||
diff --git a/core/obex/obex.cc b/core/obex/obex.cc index 595fed9..2a306de 100644 --- a/core/obex/obex.cc +++ b/core/obex/obex.cc | |||
@@ -13,2 +13,4 @@ using namespace OpieObex; | |||
13 | 13 | ||
14 | /* TRANSLATOR OpieObex::Obex */ | ||
15 | |||
14 | Obex::Obex( QObject *parent, const char* name ) | 16 | Obex::Obex( QObject *parent, const char* name ) |
@@ -111,6 +113,2 @@ void Obex::slotStdOut(OProcess* proc, char* buf, int len){ | |||
111 | if ( proc == m_rec ) { // only receive | 113 | if ( proc == m_rec ) { // only receive |
112 | for (int i = 0; i < len; i++ ) { | ||
113 | printf("%c", buf[i] ); | ||
114 | } | ||
115 | printf("\n"); | ||
116 | QByteArray ar( len ); | 114 | QByteArray ar( len ); |
@@ -127,9 +125,2 @@ void Obex::received() { | |||
127 | qWarning("ACHTUNG %s", filename.latin1() ); | 125 | qWarning("ACHTUNG %s", filename.latin1() ); |
128 | if (filename.contains( 'ö' ) || filename.contains( 'ä' ) || filename.contains('ü' ) ) { | ||
129 | qWarning("renaming!!!!"); | ||
130 | QFileInfo inf( filename ); | ||
131 | QString newName = "/tmp/opie-obex." + inf.extension(); | ||
132 | ::rename( QFile::encodeName( filename ).data(), newName ); | ||
133 | qWarning("name is %s", QFile::encodeName( filename ).data() ); | ||
134 | } | ||
135 | emit receivedFile( filename ); | 126 | emit receivedFile( filename ); |
diff --git a/core/obex/obexhandler.cpp b/core/obex/obexhandler.cpp index 6509d12..5aaf63c 100644 --- a/core/obex/obexhandler.cpp +++ b/core/obex/obexhandler.cpp | |||
@@ -10,2 +10,4 @@ using namespace OpieObex; | |||
10 | 10 | ||
11 | /* TRANSLATOR OpieObex::ObexHandler */ | ||
12 | |||
11 | ObexHandler::ObexHandler() { | 13 | ObexHandler::ObexHandler() { |
diff --git a/core/obex/obeximpl.cpp b/core/obex/obeximpl.cpp index 12a078f..5bfc779 100644 --- a/core/obex/obeximpl.cpp +++ b/core/obex/obeximpl.cpp | |||
@@ -5,2 +5,4 @@ using namespace OpieObex; | |||
5 | 5 | ||
6 | /* TRANSLATOR OpieObex::ObexImpl */ | ||
7 | |||
6 | ObexImpl::ObexImpl() { | 8 | ObexImpl::ObexImpl() { |
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp index 2931cf7..cf5d958 100644 --- a/core/obex/obexsend.cpp +++ b/core/obex/obexsend.cpp | |||
@@ -17,2 +17,4 @@ using namespace OpieObex; | |||
17 | 17 | ||
18 | /* TRANSLATOR OpieObex::SendWidget */ | ||
19 | |||
18 | 20 | ||
diff --git a/core/obex/receiver.cpp b/core/obex/receiver.cpp index 31c6afe..bf9e30c 100644 --- a/core/obex/receiver.cpp +++ b/core/obex/receiver.cpp | |||
@@ -3,2 +3,3 @@ | |||
3 | #include <sys/mman.h> | 3 | #include <sys/mman.h> |
4 | #include <stdlib.h> // int system | ||
4 | #include <unistd.h> | 5 | #include <unistd.h> |
@@ -11,2 +12,3 @@ | |||
11 | #include <qhbox.h> | 12 | #include <qhbox.h> |
13 | #include <qregexp.h> | ||
12 | #include <qtextview.h> | 14 | #include <qtextview.h> |
@@ -17,2 +19,3 @@ | |||
17 | #include <qpe/qcopenvelope_qws.h> | 19 | #include <qpe/qcopenvelope_qws.h> |
20 | #include <qpe/global.h> | ||
18 | 21 | ||
@@ -23,2 +26,4 @@ using namespace OpieObex; | |||
23 | 26 | ||
27 | /* TRANSLATOR OpieObex::Receiver */ | ||
28 | |||
24 | Receiver::Receiver() { | 29 | Receiver::Receiver() { |
@@ -33,3 +38,4 @@ Receiver::~Receiver() { | |||
33 | } | 38 | } |
34 | void Receiver::slotReceived( const QString& file ) { | 39 | void Receiver::slotReceived( const QString& _file ) { |
40 | QString file = _file; | ||
35 | int check = checkFile(file); | 41 | int check = checkFile(file); |
@@ -61,9 +67,33 @@ void Receiver::handleOther( const QString& other ) { | |||
61 | } | 67 | } |
62 | int Receiver::checkFile( const QString& file ) { | 68 | void Receiver::tidyUp( QString& _file, const QString& ending) { |
69 | /* libversit fails on BASE64 encoding we try to sed it away */ | ||
70 | QString file = _file; | ||
71 | char foo[24]; // big enough | ||
72 | (void)::strcpy(foo, "/tmp/opie-XXXXXX"); | ||
73 | |||
74 | int fd = ::mkstemp(foo); | ||
75 | |||
76 | if ( fd == -1 ) | ||
77 | return; | ||
78 | |||
79 | (void)::strncat( foo, ending.latin1(), 4 ); | ||
80 | _file = QString::fromLatin1( foo ); | ||
81 | QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) ); | ||
82 | qWarning("Executing: %s", cmd.latin1() ); | ||
83 | (void)::system( cmd.latin1() ); | ||
84 | |||
85 | cmd = QString("rm %1").arg( Global::shellQuote(file) ); | ||
86 | (void)::system( cmd.latin1() ); | ||
87 | } | ||
88 | int Receiver::checkFile( QString& file ) { | ||
63 | qWarning("check file!! %s", file.latin1() ); | 89 | qWarning("check file!! %s", file.latin1() ); |
64 | int ret; | 90 | int ret; |
91 | QString ending; | ||
92 | |||
65 | if (file.right(4) == ".vcs" ) { | 93 | if (file.right(4) == ".vcs" ) { |
66 | ret = Datebook; | 94 | ret = Datebook; |
95 | ending = QString::fromLatin1(".vcs"); | ||
67 | }else if ( file.right(4) == ".vcf") { | 96 | }else if ( file.right(4) == ".vcf") { |
68 | ret = AddressBook; | 97 | ret = AddressBook; |
98 | ending = QString::fromLatin1(".vcf"); | ||
69 | }else | 99 | }else |
@@ -72,2 +102,13 @@ int Receiver::checkFile( const QString& file ) { | |||
72 | 102 | ||
103 | if (ending.isEmpty() ) | ||
104 | return ret; | ||
105 | |||
106 | /** | ||
107 | * currently the parser is broken in regard of BASE64 encoding | ||
108 | * and M$ likes to send that. So we will executed a small | ||
109 | * tidy up system sed script | ||
110 | * At this point we can also remove umlaute from the filename | ||
111 | */ | ||
112 | tidyUp( file, ending ); | ||
113 | |||
73 | qWarning("check it now %d", ret ); | 114 | qWarning("check it now %d", ret ); |
@@ -76,2 +117,4 @@ int Receiver::checkFile( const QString& file ) { | |||
76 | 117 | ||
118 | /* TRANSLATOR OpieObex::OtherHandler */ | ||
119 | |||
77 | OtherHandler::OtherHandler() | 120 | OtherHandler::OtherHandler() |
@@ -135,2 +178,6 @@ QString OtherHandler::targetName( const QString& file ) { | |||
135 | QFileInfo info( file ); | 178 | QFileInfo info( file ); |
179 | |||
180 | /* $HOME needs to be set!!!! */ | ||
181 | Global::createDocDir(); | ||
182 | |||
136 | QString newFile = QPEApplication::documentDir()+ "/"+ info.baseName(); | 183 | QString newFile = QPEApplication::documentDir()+ "/"+ info.baseName(); |
@@ -151,21 +198,5 @@ void OtherHandler::copy(const QString& src, const QString& file) { | |||
151 | qWarning("src %s, dest %s", src.latin1(),file.latin1() ); | 198 | qWarning("src %s, dest %s", src.latin1(),file.latin1() ); |
152 | int src_fd = ::open( QFile::encodeName( src ), O_RDONLY ); | 199 | QString cmd = QString("mv %1 %2").arg( Global::shellQuote( src )). |
153 | int to_fd = ::open( QFile::encodeName( file), O_RDWR| O_CREAT| O_TRUNC, | 200 | arg( Global::shellQuote( file ) ); |
154 | S_IRUSR, S_IWUSR, S_IRGRP, S_IRGRP ); | 201 | ::system( cmd.latin1() ); |
155 | |||
156 | struct stat stater; | ||
157 | ::fstat(src_fd, &stater ); | ||
158 | ::lseek(to_fd, stater.st_size-1, SEEK_SET ); | ||
159 | ::write(to_fd, "", 1 ); | ||
160 | |||
161 | void *src_addr, *dest_addr; | ||
162 | src_addr = ::mmap(0, stater.st_size, PROT_READ, | ||
163 | MAP_FILE | MAP_SHARED, src_fd, 0 ); | ||
164 | dest_addr= ::mmap(0, stater.st_size, PROT_READ | PROT_WRITE, | ||
165 | MAP_FILE | MAP_PRIVATE, to_fd, 0 ); | ||
166 | |||
167 | ::memcpy(dest_addr , src_addr, stater.st_size ); | ||
168 | ::munmap(src_addr , stater.st_size ); | ||
169 | ::munmap(dest_addr, stater.st_size ); | ||
170 | |||
171 | // done | 202 | // done |
diff --git a/core/obex/receiver.h b/core/obex/receiver.h index 5b20146..e1d54df 100644 --- a/core/obex/receiver.h +++ b/core/obex/receiver.h | |||
@@ -23,5 +23,8 @@ namespace OpieObex { | |||
23 | void handleOther(const QString& ); | 23 | void handleOther(const QString& ); |
24 | int checkFile( const QString& file ); | 24 | /* will alter the file name */ |
25 | int checkFile( QString& file ); | ||
25 | bool testDateTodo(const QString& file); | 26 | bool testDateTodo(const QString& file); |
26 | bool testAddressbook(const QString& file); | 27 | bool testAddressbook(const QString& file); |
28 | /* called by checkFile */ | ||
29 | void tidyUp( QString& file, const QString& ending ); | ||
27 | 30 | ||