summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp31
-rw-r--r--core/launcher/launcher.h2
-rw-r--r--core/launcher/mediummountgui.cpp4
3 files changed, 32 insertions, 5 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index b26bd8b..dcc3ba1 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -73,6 +73,10 @@
73#include "mediummountgui.h" 73#include "mediummountgui.h"
74//#define SHOW_ALL 74//#define SHOW_ALL
75 75
76// uidGen
77
78// uidGen
79
76CategoryTabWidget::CategoryTabWidget( QWidget* parent ) : 80CategoryTabWidget::CategoryTabWidget( QWidget* parent ) :
77 QVBox( parent ) 81 QVBox( parent )
78{ 82{
@@ -422,7 +426,9 @@ Launcher::Launcher( QWidget* parent, const char* name, WFlags fl )
422 tabs = 0; 426 tabs = 0;
423 rootFolder = 0; 427 rootFolder = 0;
424 docsFolder = 0; 428 docsFolder = 0;
425 m_timeStamp = QDateTime::currentDateTime().toString(); 429 int stamp = uidgen.generate();
430 uidgen.store( stamp );
431 m_timeStamp = QString::number( stamp );
426 432
427 tabs = new CategoryTabWidget( this ); 433 tabs = new CategoryTabWidget( this );
428 tabs->setMaximumWidth( qApp->desktop()->width() ); 434 tabs->setMaximumWidth( qApp->desktop()->width() );
@@ -500,38 +506,57 @@ void Launcher::updateMimeTypes(AppLnkSet* folder)
500 506
501void Launcher::loadDocs() // ok here comes a hack belonging to Global:: 507void Launcher::loadDocs() // ok here comes a hack belonging to Global::
502{ 508{
509 qWarning("loading Documents" );
510 qWarning("The currentTimeStamp is: %s", m_timeStamp.latin1() );
503 delete docsFolder; 511 delete docsFolder;
504 docsFolder = new DocLnkSet; 512 docsFolder = new DocLnkSet;
513 qWarning("new DocLnkSet" );
505 // find out wich filesystems are new in this round 514 // find out wich filesystems are new in this round
506 // We will do this by having a timestamp inside each mountpoint 515 // We will do this by having a timestamp inside each mountpoint
507 // if the current timestamp doesn't match this is a new file system and 516 // if the current timestamp doesn't match this is a new file system and
508 // come up with our MediumMountGui :) let the hacking begin 517 // come up with our MediumMountGui :) let the hacking begin
509 QString newStamp = QDateTime::currentDateTime().toString(); 518 int stamp = uidgen.generate();
519
520 QString newStamp = QString::number( stamp );
521 qWarning("new time stamp is: %s", newStamp.latin1() );
510 StorageInfo storage; 522 StorageInfo storage;
511 const QList<FileSystem> &fileSystems = storage.fileSystems(); 523 const QList<FileSystem> &fileSystems = storage.fileSystems();
524 qWarning("QList<FileSystem>" );
512 QListIterator<FileSystem> it ( fileSystems ); 525 QListIterator<FileSystem> it ( fileSystems );
526 qWarning("iterator initiliazed" );
513 for ( ; it.current(); ++it ) { 527 for ( ; it.current(); ++it ) {
528 qWarning("inside for loop" );
529 qWarning("checking device %s", (*it)->path().latin1() );
514 if ( (*it)->isRemovable() ) { // let's find out if we should search on it 530 if ( (*it)->isRemovable() ) { // let's find out if we should search on it
531 qWarning("%s is removeable", (*it)->path().latin1() );
515 OConfig cfg( (*it)->path() + "/.opiestorage.cf"); 532 OConfig cfg( (*it)->path() + "/.opiestorage.cf");
516 cfg.setGroup("main"); 533 cfg.setGroup("main");
517 QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() ); 534 QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() );
518 if( stamp == m_timeStamp ){ // ok we know this card 535 if( stamp == m_timeStamp ){ // ok we know this card
536 qWarning("time stamp match" );
519 cfg.writeEntry("timestamp", newStamp ); 537 cfg.writeEntry("timestamp", newStamp );
520 // we need to scan the list now. Hopefully the cache will be there 538 // we need to scan the list now. Hopefully the cache will be there
521 }else{ // come up with the gui 539 }else{ // come up with the gui
522 MediumMountGui medium((*it)->path() + "/.opiestorage.cf" ); 540 qWarning("time stamp doesn't match" );
541 MediumMountGui medium((*it)->path() );
542 qWarning("medium mount gui created" );
523 if( medium.check() ){ 543 if( medium.check() ){
544 qWarning("need to check this device" );
524 if( medium.exec() ){ //ok 545 if( medium.exec() ){ //ok
525 // speicher 546 // speicher
547 qWarning("execed" );
526 cfg.writeEntry("timestamp", newStamp ); 548 cfg.writeEntry("timestamp", newStamp );
527 } 549 }
528 }else{ 550 }else{
551 qWarning("wrong :(" );
529 // do something different see what we need to do 552 // do something different see what we need to do
530 } 553 }
531 } 554 }
532 } 555 }
533 } 556 }
557 qWarning("findDocuments" );
534 Global::findDocuments(docsFolder); // get rid of this call later 558 Global::findDocuments(docsFolder); // get rid of this call later
559 qWarning("done" );
535 m_timeStamp = newStamp; 560 m_timeStamp = newStamp;
536} 561}
537 562
diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h
index 197bd19..d2efa58 100644
--- a/core/launcher/launcher.h
+++ b/core/launcher/launcher.h
@@ -25,6 +25,7 @@
25#include <qstringlist.h> 25#include <qstringlist.h>
26#include <qvbox.h> 26#include <qvbox.h>
27#include <qlist.h> 27#include <qlist.h>
28#include <qpe/palmtopuidgen.h>
28#include "launcherview.h" 29#include "launcherview.h"
29 30
30class AppLnk; 31class AppLnk;
@@ -132,6 +133,7 @@ private:
132 bool got_lnk_change; 133 bool got_lnk_change;
133 QString lnk_change; 134 QString lnk_change;
134 QString m_timeStamp; 135 QString m_timeStamp;
136 Qtopia::UidGen uidgen;
135}; 137};
136 138
137#endif // LAUNCHERVIEW_H 139#endif // LAUNCHERVIEW_H
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp
index f193024..6ad97e1 100644
--- a/core/launcher/mediummountgui.cpp
+++ b/core/launcher/mediummountgui.cpp
@@ -21,7 +21,7 @@
21 21
22 22
23MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const char* name, bool modal, WFlags fl ) 23MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const char* name, bool modal, WFlags fl )
24 : QDialog( parent, name, modal, fl ) { 24 : QDialog( parent, name, true ) {
25 25
26 26
27 QWidget *d = QApplication::desktop(); 27 QWidget *d = QApplication::desktop();
@@ -39,7 +39,7 @@ void MediumMountGui::readConfig(){
39 39
40 OConfig cfg (mediumPath +"/.opiestorage.cf"); 40 OConfig cfg (mediumPath +"/.opiestorage.cf");
41 cfg.setGroup("main"); 41 cfg.setGroup("main");
42 checkagain = cfg.readBoolEntry("check", false); 42 checkagain = cfg.readBoolEntry("check", true);
43 43
44 cfg.setGroup("mimetypes"); 44 cfg.setGroup("mimetypes");
45 checkmimeaudio = cfg.readBoolEntry("audio", true); 45 checkmimeaudio = cfg.readBoolEntry("audio", true);