From ae9e1ed9cc9e65c1ffb28f3b75ff499e18c6b31a Mon Sep 17 00:00:00 2001 From: mickeyl Date: Thu, 20 Nov 2003 01:31:27 +0000 Subject: rework optional doc-tab patch to be less intrusive and more sane --- diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp index dcea4b9..1a7de33 100644 --- a/core/launcher/documentlist.cpp +++ b/core/launcher/documentlist.cpp @@ -96,30 +96,20 @@ DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs, { appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); d = new DocumentListPrivate( serverGui ); - d->scanDocs = scanDocs; d->needToSendAllDocLinks = false; + Config cfg( "Launcher" ); + cfg.setGroup( "DocTab" ); + d->scanDocs = cfg.readBoolEntry( "Enable", true ); + qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs ); + QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); } void DocumentList::startInitialScan() { reloadAppLnks(); - - Config cfg( "Launcher" ); - cfg.setGroup( "DocTab" ); - bool docTabEnabled = cfg.readBoolEntry( "Enable", true ); - if ( docTabEnabled ) - reloadDocLnks(); - else - { - if ( d->sendDocLnks && d->serverGui ) - { - d->serverGui->documentScanningProgress( 0 ); - d->serverGui->allDocumentsRemoved(); - } - } - + reloadDocLnks(); } DocumentList::~DocumentList() diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index b312672..344cd46 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp @@ -152,6 +152,7 @@ void LauncherTabWidget::createDocLoadingWidget() textLabel->setText( tr( "The Documents Tab

has been disabled.

" "Use Settings->Launcher->DocTab

to reenable it." ) ); docLoadingWidgetProgress->hide(); + docLoadingWidgetEnabled = true; } QWidget *space2 = new QWidget( docLoadingVBox ); @@ -501,6 +502,13 @@ Launcher::~Launcher() destroyGUI(); } + bool Launcher::requiresDocuments() const + { + Config cfg( "Launcher" ); + cfg.setGroup( "DocTab" ); + return cfg.readBoolEntry( "Enable", true ); +} + void Launcher::makeVisible() { showMaximized(); @@ -749,14 +757,6 @@ void Launcher::applicationScanningProgress( int percent ) void Launcher::documentScanningProgress( int percent ) { - if ( !docTabEnabled ) - { - qDebug( "Launcher: document tab disabled!" ); - tabs->setLoadingProgress( 100 ); - tabs->setLoadingWidgetEnabled( TRUE ); - return; - } - switch ( percent ) { case 0: { tabs->setLoadingProgress( 0 ); diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h index 1d046ee..4f3ff8c 100644 --- a/core/launcher/launcher.h +++ b/core/launcher/launcher.h @@ -116,7 +116,7 @@ public: void applicationScanningProgress( int percent ); void documentScanningProgress( int percent ); bool requiresApplications() const { return TRUE; } - bool requiresDocuments() const { return TRUE; } + bool requiresDocuments() const; void showLoadingDocs(); void showDocTab(); -- cgit v0.9.0.2