summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp20
-rw-r--r--core/launcher/launcher.cpp16
-rw-r--r--core/launcher/launcher.h2
3 files changed, 14 insertions, 24 deletions
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
@@ -93,36 +93,26 @@ public:
DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs,
QObject *parent, const char *name )
: QObject( parent, name )
{
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();
- }
- }
-
}
DocumentList::~DocumentList()
{
delete appLnkSet;
delete d;
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
@@ -149,12 +149,13 @@ void LauncherTabWidget::createDocLoadingWidget()
}
else
{
textLabel->setText( tr( "<b>The Documents Tab<p>has been disabled.<p>"
"Use Settings->Launcher->DocTab<p>to reenable it.</b></center>" ) );
docLoadingWidgetProgress->hide();
+ docLoadingWidgetEnabled = true;
}
QWidget *space2 = new QWidget( docLoadingVBox );
docLoadingVBox->setStretchFactor( space2, 1 );
cfg.setGroup( "Tab Documents" ); // No tr
@@ -498,12 +499,19 @@ void Launcher::createGUI()
Launcher::~Launcher()
{
if ( tb )
destroyGUI();
}
+ bool Launcher::requiresDocuments() const
+ {
+ Config cfg( "Launcher" );
+ cfg.setGroup( "DocTab" );
+ return cfg.readBoolEntry( "Enable", true );
+}
+
void Launcher::makeVisible()
{
showMaximized();
}
void Launcher::destroyGUI()
@@ -746,20 +754,12 @@ void Launcher::applicationScanningProgress( int percent )
break;
}
}
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 );
tabs->setLoadingWidgetEnabled( TRUE );
tabs->docView()->setUpdatesEnabled( FALSE );
tabs->docView()->setSortEnabled( FALSE );
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
@@ -113,13 +113,13 @@ public:
void allDocumentsRemoved();
void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc );
void storageChanged( const QList<FileSystem> & );
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();
QStringList idList() const { return ids; }
public slots: