summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index e74301c..3eb561a 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -54,8 +54,11 @@
#include <qlabel.h>
#include <qtextstream.h>
#include <qpopupmenu.h>
+#include <opie/owait.h>
+
+
#include "launcherview.h"
#include "launcher.h"
#include "syncdialog.h"
#include "desktop.h"
@@ -359,8 +362,9 @@ LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm,
void CategoryTabWidget::updateLink(const QString& linkfile)
{
int i=0;
LauncherView* view;
+ qApp->processEvents();
while ((view = (LauncherView*)stack->widget(i++))) {
if ( view->removeLink(linkfile) )
break;
}
@@ -727,8 +731,15 @@ void Launcher::updateMimeTypes(AppLnkSet* folder)
* c2) we need to ask and then apply the mimefilter
*/
void Launcher::loadDocs() // ok here comes a hack belonging to Global::
{
+
+ OWait *owait = new OWait();
+ Global::statusMessage( tr( "Finding documents" ) );
+
+ owait->show();
+ qApp->processEvents();
+
delete docsFolder;
docsFolder = new DocLnkSet;
DocLnkSet *tmp = 0;
@@ -787,10 +798,12 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
if( stamp == m_timeStamp ){ // ok we know this card
cfg.writeEntry("timestamp", newStamp ); //just write a new timestamp
// we need to scan the list now. Hopefully the cache will be there
// read the mimetypes from the config and search for documents
- QStringList mimetypes = configToMime( &cfg);
- tmp = new DocLnkSet( (*it)->path(), mimetypes.join(";") );
+ QStringList mimetypes = configToMime( &cfg);
+ qApp->processEvents();
+ Global::statusMessage( tr( "Searching documents" ) );
+ tmp = new DocLnkSet( (*it)->path(), mimetypes.join(";") );
docsFolder->appendFrom( *tmp );
delete tmp;
}else{ // come up with the gui cause this a new card
@@ -802,10 +815,12 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
//cfg.read(); // cause of a race we need to reread - fixed
cfg.setGroup("main");
cfg.writeEntry("timestamp", newStamp );
cfg.write();
- tmp = new DocLnkSet( (*it)->path(), medium.mimeTypes().join(";" ) );
- docsFolder->appendFrom( *tmp );
+
+ qApp->processEvents();
+ tmp = new DocLnkSet( (*it)->path(), medium.mimeTypes().join(";" ) );
+ docsFolder->appendFrom( *tmp );
delete tmp;
}// no else
/** c1) */
}else{ // we checked
@@ -813,17 +828,22 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
// let's see if we should check the device
cfg.setGroup("main" );
bool check = cfg.readBoolEntry("autocheck", true );
if( check ){ // find the documents
- tmp = new DocLnkSet( (*it)->path(), configToMime(&cfg ).join(";") );
+
+ qApp->processEvents();
+ Global::statusMessage( tr( "Searching documents" ) );
+ tmp = new DocLnkSet( (*it)->path(), configToMime(&cfg ).join(";") );
docsFolder->appendFrom( *tmp );
delete tmp;
}
}
}
}
}
m_timeStamp = newStamp;
+ owait->hide();
+ delete owait;
}
void Launcher::updateTabs()
{
@@ -1103,9 +1123,12 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
delete syncDialog; syncDialog = 0;
} else if ( msg == "getAllDocLinks()" ) {
loadDocs();
- QString contents;
+ // directly show updated docs in document tab
+ updateDocs();
+
+ QString contents;
// Categories cats;
for ( QListIterator<DocLnk> it( docsFolder->children() ); it.current(); ++it ) {
DocLnk *doc = it.current();