Diffstat (limited to 'core/launcher/documentlist.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/launcher/documentlist.cpp | 13 |
1 files changed, 12 insertions, 1 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 | |||
@@ -453,13 +453,24 @@ void DocumentList::sendAllDocLinks() | |||
453 | bool fake = !doc->linkFileKnown(); | 453 | bool fake = !doc->linkFileKnown(); |
454 | if ( !fake ) { | 454 | if ( !fake ) { |
455 | QFile f( doc->linkFile() ); | 455 | QFile f( doc->linkFile() ); |
456 | if ( f.open( IO_ReadOnly ) ) { | 456 | if ( f.open( IO_ReadOnly ) ) { |
457 | QTextStream ts( &f ); | 457 | QTextStream ts( &f ); |
458 | ts.setEncoding( QTextStream::UnicodeUTF8 ); | 458 | ts.setEncoding( QTextStream::UnicodeUTF8 ); |
459 | contents += ts.read(); | 459 | QString docLnk = ts.read(); |
460 | // Strip out the (stale) LinkFile entry | ||
461 | int start = docLnk.find( "\nLinkFile = " ) + 1; | ||
462 | if ( start > 0 ) { | ||
463 | int end = docLnk.find( "\n", start + 1 ) + 1; | ||
464 | contents += docLnk.left(start); | ||
465 | contents += docLnk.mid(end); | ||
466 | } else { | ||
467 | contents += docLnk; | ||
468 | } | ||
469 | contents += "LinkFile = " + doc->linkFile() + "\n"; | ||
470 | |||
460 | f.close(); | 471 | f.close(); |
461 | } else | 472 | } else |
462 | fake = TRUE; | 473 | fake = TRUE; |
463 | } | 474 | } |
464 | if (fake) { | 475 | if (fake) { |
465 | contents += "[Desktop Entry]\n"; // No tr | 476 | contents += "[Desktop Entry]\n"; // No tr |