summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/launcher.cpp23
1 files changed, 23 insertions, 0 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
@@ -50,16 +50,19 @@
#include <qregexp.h>
#include <qmessagebox.h>
#include <qframe.h>
#include <qpainter.h>
#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"
#include <qpe/lnkproperties.h>
//#include "mrulist.h"
#include "qrsync.h"
#include <stdlib.h>
@@ -355,16 +358,17 @@ LauncherView* CategoryTabWidget::newView( const QString& id, const QPixmap& pm,
stack->addWidget( view, tabs++ );
return view;
}
void CategoryTabWidget::updateLink(const QString& linkfile)
{
int i=0;
LauncherView* view;
+ qApp->processEvents();
while ((view = (LauncherView*)stack->widget(i++))) {
if ( view->removeLink(linkfile) )
break;
}
addItem(linkfile);
docview->updateTools();
}
@@ -723,16 +727,23 @@ void Launcher::updateMimeTypes(AppLnkSet* folder)
* all removable medium
* b) the user enabled medium checking globally and we need to use this mimefilter
* c) the user enabled medium checking on a per medium bases
* c1) we already checked and its not ask again turns
* 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;
QString home = QString(getenv("HOME")) + "/Documents";
tmp = new DocLnkSet( home , QString::null);
docsFolder->appendFrom( *tmp );
delete tmp;
@@ -784,50 +795,59 @@ void Launcher::loadDocs() // ok here comes a hack belonging to Global::
QString stamp = cfg.readEntry("timestamp", QDateTime::currentDateTime().toString() );
/** This medium is uptodate
*/
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);
+ 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
MediumMountGui medium(&cfg, (*it)->path() );
if( medium.check() ){ // we did not ask before or ask again is off
/** c2) */
if( medium.exec() ){ // he clicked yes so search it
// speicher
//cfg.read(); // cause of a race we need to reread - fixed
cfg.setGroup("main");
cfg.writeEntry("timestamp", newStamp );
cfg.write();
+
+ qApp->processEvents();
tmp = new DocLnkSet( (*it)->path(), medium.mimeTypes().join(";" ) );
docsFolder->appendFrom( *tmp );
delete tmp;
}// no else
/** c1) */
}else{ // we checked
// do something different see what we need to do
// let's see if we should check the device
cfg.setGroup("main" );
bool check = cfg.readBoolEntry("autocheck", true );
if( check ){ // find the documents
+
+ 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()
{
MimeType::updateApplications(); // ### reads all applnks twice
delete rootFolder;
rootFolder = new AppLnkSet( MimeType::appsFolderName() );
@@ -1099,16 +1119,19 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data)
syncDialog->whatLabel->setText( "<b>" + what + "</b>" );
connect( syncDialog->buttonCancel, SIGNAL( clicked() ),
SLOT( cancelSync() ) );
} else if ( msg == "stopSync()") {
delete syncDialog; syncDialog = 0;
} else if ( msg == "getAllDocLinks()" ) {
loadDocs();
+ // 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();
QFileInfo fi( doc->file() );
if ( !fi.exists() )
continue;