author | zecke <zecke> | 2002-03-22 22:39:51 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-03-22 22:39:51 (UTC) |
commit | f0add730524cb63fd3bcce741da2e1fba83acb9f (patch) (unidiff) | |
tree | 029b1bfb012cff89cf57ef1009a657bc7fee168c /core/launcher/launcher.cpp | |
parent | 796cb4b76f2e949b1baea3d4cf7a70b24186939d (diff) | |
download | opie-f0add730524cb63fd3bcce741da2e1fba83acb9f.zip opie-f0add730524cb63fd3bcce741da2e1fba83acb9f.tar.gz opie-f0add730524cb63fd3bcce741da2e1fba83acb9f.tar.bz2 |
make some people happy
-rw-r--r-- | core/launcher/launcher.cpp | 31 |
1 files changed, 28 insertions, 3 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 | |||
76 | CategoryTabWidget::CategoryTabWidget( QWidget* parent ) : | 80 | CategoryTabWidget::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 | ||
501 | void Launcher::loadDocs() // ok here comes a hack belonging to Global:: | 507 | void 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 | ||