Diffstat (limited to 'core/launcher/documentlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/documentlist.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp index 44ceb0c..d8e7a83 100644 --- a/core/launcher/documentlist.cpp +++ b/core/launcher/documentlist.cpp @@ -388,8 +388,8 @@ void DocumentList::DiffAppLnks() } if (!found) { - odebug << "Item " << j->name().ascii() << " needs to be added" << oendl; + odebug << "Item " << j->name().ascii() << " needs to be added" << oendl; d->serverGui->applicationAdded( j->type(), *j ); - } - ++it2; + } + ++it2; } @@ -404,11 +404,11 @@ void DocumentList::DiffAppLnks() } if (!found) { - odebug << "Item " << i->name().ascii() << " needs to be removed" << oendl; + odebug << "Item " << i->name().ascii() << " needs to be removed" << oendl; d->serverGui->applicationRemoved( i->type(), *i ); } - - ++it1; + + ++it1; } - + delete appLnkSet; appLnkSet = appLnkSet2; @@ -423,8 +423,8 @@ void DocumentList::storageChanged() DiffAppLnks(); // reloadAppLnks(); - odebug << "Reload App links took " << t.elapsed() << " ms" << oendl; + odebug << "Reload App links took " << t.elapsed() << " ms" << oendl; reloadDocLnks(); // odebug << "Reload links took " << t.elapsed() << " ms " << oendl; - odebug << "Reload All links took " << t.elapsed() << " ms" << oendl; + odebug << "Reload All links took " << t.elapsed() << " ms" << oendl; // ### Optimization opportunity // Could be a bit more intelligent and somehow work out which @@ -457,5 +457,16 @@ void DocumentList::sendAllDocLinks() QTextStream ts( &f ); ts.setEncoding( QTextStream::UnicodeUTF8 ); - contents += ts.read(); + QString docLnk = ts.read(); + // Strip out the (stale) LinkFile entry + int start = docLnk.find( "\nLinkFile = " ) + 1; + if ( start > 0 ) { + int end = docLnk.find( "\n", start + 1 ) + 1; + contents += docLnk.left(start); + contents += docLnk.mid(end); + } else { + contents += docLnk; + } + contents += "LinkFile = " + doc->linkFile() + "\n"; + f.close(); } else |