summaryrefslogtreecommitdiff
path: root/core/launcher/documentlist.cpp
Unidiff
Diffstat (limited to 'core/launcher/documentlist.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index 19ceb0f..44ceb0c 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -366,87 +366,87 @@ void DocumentList::DiffAppLnks()
366 for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) { 366 for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) {
367 odebug << "removing type " << (*ittypes) << "" << oendl; 367 odebug << "removing type " << (*ittypes) << "" << oendl;
368 d->serverGui->typeRemoved(*ittypes); 368 d->serverGui->typeRemoved(*ittypes);
369 } 369 }
370 prevTypeList = types; 370 prevTypeList = types;
371 } 371 }
372 372
373 373
374 QListIterator<AppLnk> it1( appLnkSet->children() ); 374 QListIterator<AppLnk> it1( appLnkSet->children() );
375 QListIterator<AppLnk> it2( appLnkSet2->children() ); 375 QListIterator<AppLnk> it2( appLnkSet2->children() );
376 376
377 AppLnk *i; 377 AppLnk *i;
378 AppLnk *j; 378 AppLnk *j;
379 bool found; 379 bool found;
380 380
381 while ( (j=it2.current()) ) { 381 while ( (j=it2.current()) ) {
382 it1 = appLnkSet->children(); 382 it1 = appLnkSet->children();
383 found = false; 383 found = false;
384 while ( (i=it1.current()) ){ 384 while ( (i=it1.current()) ){
385 if (strcmp(i->name().ascii(),j->name().ascii()) == 0) 385 if (strcmp(i->name().ascii(),j->name().ascii()) == 0)
386 found = true; 386 found = true;
387 ++it1; 387 ++it1;
388 } 388 }
389 if (!found) { 389 if (!found) {
390 qDebug("Item %s needs to be added",j->name().ascii() ); 390 odebug << "Item " << j->name().ascii() << " needs to be added" << oendl;
391 d->serverGui->applicationAdded( j->type(), *j ); 391 d->serverGui->applicationAdded( j->type(), *j );
392 } 392 }
393 ++it2; 393 ++it2;
394 } 394 }
395 395
396 it1 = appLnkSet->children(); 396 it1 = appLnkSet->children();
397 while ( (i=it1.current()) ) { 397 while ( (i=it1.current()) ) {
398 it2 = appLnkSet2->children(); 398 it2 = appLnkSet2->children();
399 found = false; 399 found = false;
400 while ( (j=it2.current()) ){ 400 while ( (j=it2.current()) ){
401 if (strcmp(i->name().ascii(),j->name().ascii()) == 0) 401 if (strcmp(i->name().ascii(),j->name().ascii()) == 0)
402 found = true; 402 found = true;
403 ++it2; 403 ++it2;
404 } 404 }
405 if (!found) { 405 if (!found) {
406 qDebug("Item %s needs to be removed",i->name().ascii() ); 406 odebug << "Item " << i->name().ascii() << " needs to be removed" << oendl;
407 d->serverGui->applicationRemoved( i->type(), *i ); 407 d->serverGui->applicationRemoved( i->type(), *i );
408 } 408 }
409 409
410 ++it1; 410 ++it1;
411 } 411 }
412 412
413 delete appLnkSet; 413 delete appLnkSet;
414 appLnkSet = appLnkSet2; 414 appLnkSet = appLnkSet2;
415 415
416} 416}
417void DocumentList::storageChanged() 417void DocumentList::storageChanged()
418{ 418{
419 QTime t; 419 QTime t;
420 // ### can implement better 420 // ### can implement better
421 421
422 t.start(); 422 t.start();
423 DiffAppLnks(); 423 DiffAppLnks();
424// reloadAppLnks(); 424// reloadAppLnks();
425 qDebug("Reload App links took %i ms",t.elapsed() ); 425 odebug << "Reload App links took " << t.elapsed() << " ms" << oendl;
426 reloadDocLnks(); 426 reloadDocLnks();
427// odebug << "Reload links took " << t.elapsed() << " ms " << oendl; 427// odebug << "Reload links took " << t.elapsed() << " ms " << oendl;
428 qDebug("Reload All links took %i ms",t.elapsed() ); 428 odebug << "Reload All links took " << t.elapsed() << " ms" << oendl;
429// ### Optimization opportunity 429// ### Optimization opportunity
430 // Could be a bit more intelligent and somehow work out which 430 // Could be a bit more intelligent and somehow work out which
431 // mtab entry has changed and then only scan that and add and remove 431 // mtab entry has changed and then only scan that and add and remove
432 // links appropriately. 432 // links appropriately.
433// rescan(); 433// rescan();
434} 434}
435 435
436void DocumentList::sendAllDocLinks() 436void DocumentList::sendAllDocLinks()
437{ 437{
438 if ( d->tid != 0 ) { 438 if ( d->tid != 0 ) {
439 // We are in the middle of scanning, set a flag so 439 // We are in the middle of scanning, set a flag so
440 // we do this when we finish our scanning 440 // we do this when we finish our scanning
441 d->needToSendAllDocLinks = true; 441 d->needToSendAllDocLinks = true;
442 return; 442 return;
443 } 443 }
444 444
445 QString contents; 445 QString contents;
446 Categories cats; 446 Categories cats;
447 for ( QListIterator<DocLnk> it( d->dls.children() ); it.current(); ++it ) { 447 for ( QListIterator<DocLnk> it( d->dls.children() ); it.current(); ++it ) {
448 DocLnk *doc = it.current(); 448 DocLnk *doc = it.current();
449 QFileInfo fi( doc->file() ); 449 QFileInfo fi( doc->file() );
450 if ( !fi.exists() ) 450 if ( !fi.exists() )
451 continue; 451 continue;
452 452