Diffstat (limited to 'core/launcher/documentlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/documentlist.cpp | 22 |
1 files changed, 6 insertions, 16 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 | |||
@@ -75,72 +75,62 @@ public: | |||
75 | int searchDepth; | 75 | int searchDepth; |
76 | QDir *listDirs[MAX_SEARCH_DEPTH]; | 76 | QDir *listDirs[MAX_SEARCH_DEPTH]; |
77 | const QFileInfoList *lists[MAX_SEARCH_DEPTH]; | 77 | const QFileInfoList *lists[MAX_SEARCH_DEPTH]; |
78 | unsigned int listPositions[MAX_SEARCH_DEPTH]; | 78 | unsigned int listPositions[MAX_SEARCH_DEPTH]; |
79 | 79 | ||
80 | StorageInfo *storage; | 80 | StorageInfo *storage; |
81 | 81 | ||
82 | int tid; | 82 | int tid; |
83 | 83 | ||
84 | ServerInterface *serverGui; | 84 | ServerInterface *serverGui; |
85 | 85 | ||
86 | bool needToSendAllDocLinks; | 86 | bool needToSendAllDocLinks; |
87 | bool sendAppLnks; | 87 | bool sendAppLnks; |
88 | bool sendDocLnks; | 88 | bool sendDocLnks; |
89 | bool scanDocs; | 89 | bool scanDocs; |
90 | }; | 90 | }; |
91 | 91 | ||
92 | 92 | ||
93 | DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs, | 93 | DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs, |
94 | QObject *parent, const char *name ) | 94 | QObject *parent, const char *name ) |
95 | : QObject( parent, name ) | 95 | : QObject( parent, name ) |
96 | { | 96 | { |
97 | appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); | 97 | appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); |
98 | d = new DocumentListPrivate( serverGui ); | 98 | d = new DocumentListPrivate( serverGui ); |
99 | d->scanDocs = scanDocs; | ||
100 | d->needToSendAllDocLinks = false; | 99 | d->needToSendAllDocLinks = false; |
101 | 100 | ||
101 | Config cfg( "Launcher" ); | ||
102 | cfg.setGroup( "DocTab" ); | ||
103 | d->scanDocs = cfg.readBoolEntry( "Enable", true ); | ||
104 | qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs ); | ||
105 | |||
102 | QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); | 106 | QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); |
103 | } | 107 | } |
104 | 108 | ||
105 | void DocumentList::startInitialScan() | 109 | void DocumentList::startInitialScan() |
106 | { | 110 | { |
107 | reloadAppLnks(); | 111 | reloadAppLnks(); |
108 | 112 | reloadDocLnks(); | |
109 | Config cfg( "Launcher" ); | ||
110 | cfg.setGroup( "DocTab" ); | ||
111 | bool docTabEnabled = cfg.readBoolEntry( "Enable", true ); | ||
112 | if ( docTabEnabled ) | ||
113 | reloadDocLnks(); | ||
114 | else | ||
115 | { | ||
116 | if ( d->sendDocLnks && d->serverGui ) | ||
117 | { | ||
118 | d->serverGui->documentScanningProgress( 0 ); | ||
119 | d->serverGui->allDocumentsRemoved(); | ||
120 | } | ||
121 | } | ||
122 | |||
123 | } | 113 | } |
124 | 114 | ||
125 | DocumentList::~DocumentList() | 115 | DocumentList::~DocumentList() |
126 | { | 116 | { |
127 | delete appLnkSet; | 117 | delete appLnkSet; |
128 | delete d; | 118 | delete d; |
129 | } | 119 | } |
130 | 120 | ||
131 | 121 | ||
132 | void DocumentList::add( const DocLnk& doc ) | 122 | void DocumentList::add( const DocLnk& doc ) |
133 | { | 123 | { |
134 | if ( d->serverGui && QFile::exists( doc.file() ) ) | 124 | if ( d->serverGui && QFile::exists( doc.file() ) ) |
135 | d->serverGui->documentAdded( doc ); | 125 | d->serverGui->documentAdded( doc ); |
136 | } | 126 | } |
137 | 127 | ||
138 | 128 | ||
139 | void DocumentList::start() | 129 | void DocumentList::start() |
140 | { | 130 | { |
141 | resume(); | 131 | resume(); |
142 | } | 132 | } |
143 | 133 | ||
144 | 134 | ||
145 | void DocumentList::pause() | 135 | void DocumentList::pause() |
146 | { | 136 | { |