summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index 1a7de33..ece6931 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -98,97 +98,97 @@ DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs,
98 d = new DocumentListPrivate( serverGui ); 98 d = new DocumentListPrivate( serverGui );
99 d->needToSendAllDocLinks = false; 99 d->needToSendAllDocLinks = false;
100 100
101 Config cfg( "Launcher" ); 101 Config cfg( "Launcher" );
102 cfg.setGroup( "DocTab" ); 102 cfg.setGroup( "DocTab" );
103 d->scanDocs = cfg.readBoolEntry( "Enable", true ); 103 d->scanDocs = cfg.readBoolEntry( "Enable", true );
104 qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs ); 104 qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs );
105 105
106 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); 106 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) );
107} 107}
108 108
109void DocumentList::startInitialScan() 109void DocumentList::startInitialScan()
110{ 110{
111 reloadAppLnks(); 111 reloadAppLnks();
112 reloadDocLnks(); 112 reloadDocLnks();
113} 113}
114 114
115DocumentList::~DocumentList() 115DocumentList::~DocumentList()
116{ 116{
117 delete appLnkSet; 117 delete appLnkSet;
118 delete d; 118 delete d;
119} 119}
120 120
121 121
122void DocumentList::add( const DocLnk& doc ) 122void DocumentList::add( const DocLnk& doc )
123{ 123{
124 if ( d->serverGui && QFile::exists( doc.file() ) ) 124 if ( d->serverGui && QFile::exists( doc.file() ) )
125 d->serverGui->documentAdded( doc ); 125 d->serverGui->documentAdded( doc );
126} 126}
127 127
128 128
129void DocumentList::start() 129void DocumentList::start()
130{ 130{
131 resume(); 131 resume();
132} 132}
133 133
134 134
135void DocumentList::pause() 135void DocumentList::pause()
136{ 136{
137 //qDebug("pause %i", d->tid); 137 //qDebug("pause %i", d->tid);
138 killTimer( d->tid ); 138 killTimer( d->tid );
139 d->tid = 0; 139 d->tid = 0;
140} 140}
141 141
142 142
143void DocumentList::resume() 143void DocumentList::resume()
144{ 144{
145 if ( d->tid == 0 ) { 145 if ( d->tid == 0 ) {
146 d->tid = startTimer( 0 ); 146 d->tid = startTimer( 20 );
147 //qDebug("resumed %i", d->tid); 147 //qDebug("resumed %i", d->tid);
148 } 148 }
149} 149}
150 150
151/* 151/*
152void DocumentList::resend() 152void DocumentList::resend()
153{ 153{
154 // Re-emits all the added items to the list (firstly letting everyone know to 154 // Re-emits all the added items to the list (firstly letting everyone know to
155 // clear what they have as it is being sent again) 155 // clear what they have as it is being sent again)
156 pause(); 156 pause();
157 emit allRemoved(); 157 emit allRemoved();
158 QTimer::singleShot( 5, this, SLOT( resendWorker() ) ); 158 QTimer::singleShot( 5, this, SLOT( resendWorker() ) );
159} 159}
160 160
161 161
162void DocumentList::resendWorker() 162void DocumentList::resendWorker()
163{ 163{
164 const QList<DocLnk> &list = d->dls.children(); 164 const QList<DocLnk> &list = d->dls.children();
165 for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) 165 for ( QListIterator<DocLnk> it( list ); it.current(); ++it )
166 add( *(*it) ); 166 add( *(*it) );
167 resume(); 167 resume();
168} 168}
169*/ 169*/
170 170
171void DocumentList::rescan() 171void DocumentList::rescan()
172{ 172{
173 //qDebug("rescan"); 173 //qDebug("rescan");
174 pause(); 174 pause();
175 d->initialize(); 175 d->initialize();
176 resume(); 176 resume();
177} 177}
178 178
179 179
180void DocumentList::timerEvent( QTimerEvent *te ) 180void DocumentList::timerEvent( QTimerEvent *te )
181{ 181{
182 if ( te->timerId() == d->tid ) { 182 if ( te->timerId() == d->tid ) {
183 // Do 3 at a time 183 // Do 3 at a time
184 for (int i = 0; i < 3; i++ ) { 184 for (int i = 0; i < 3; i++ ) {
185 const DocLnk *lnk = d->iterate(); 185 const DocLnk *lnk = d->iterate();
186 if ( lnk ) { 186 if ( lnk ) {
187 add( *lnk ); 187 add( *lnk );
188 } else { 188 } else {
189 // stop when done 189 // stop when done
190 pause(); 190 pause();
191 if ( d->serverGui ) 191 if ( d->serverGui )
192 d->serverGui->documentScanningProgress( 100 ); 192 d->serverGui->documentScanningProgress( 100 );
193 if ( d->needToSendAllDocLinks ) 193 if ( d->needToSendAllDocLinks )
194 sendAllDocLinks(); 194 sendAllDocLinks();