summaryrefslogtreecommitdiff
path: root/core/launcher/documentlist.cpp
authorllornkcor <llornkcor>2004-10-08 10:22:20 (UTC)
committer llornkcor <llornkcor>2004-10-08 10:22:20 (UTC)
commit0e41f335c0db28250216a5292a2b7bcee2a1cf4a (patch) (side-by-side diff)
treecac0c40b6e35117b199b45bf5674215ceeb9abd9 /core/launcher/documentlist.cpp
parentb2e0fd018e1122f65dbbf8ab564e992988f35385 (diff)
downloadopie-0e41f335c0db28250216a5292a2b7bcee2a1cf4a.zip
opie-0e41f335c0db28250216a5292a2b7bcee2a1cf4a.tar.gz
opie-0e41f335c0db28250216a5292a2b7bcee2a1cf4a.tar.bz2
this patch will add support for QD installing directly to opie device via sync. not functioning until QD 1.7.1 released. should compile for now
Diffstat (limited to 'core/launcher/documentlist.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp13
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()
bool fake = !doc->linkFileKnown();
if ( !fake ) {
QFile f( doc->linkFile() );
if ( f.open( IO_ReadOnly ) ) {
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
fake = TRUE;
}
if (fake) {
contents += "[Desktop Entry]\n"; // No tr