[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH]: correct urls in KRecentDocument
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2007-11-14 23:28:24
Message-ID: 200711141628.24468.aseigo () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


hi..

KRecentDocument stores the URL using writePathEntry. unfortunately, it then 
fetches it using KDesktopFile::readUrl(), which means that $HOME and other 
writePathEntry magic doesn't get process properly.

the attached patch fixes that.

p.s. while it might occur to a person that KDesktopFile::readUrl() should be 
changed similarly, there is a comment in the code expressely forbidding it =)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech

["krecentdocument.diff" (text/x-diff)]

Index: /home/aseigo/kde4/KDE/kdelibs/kio/kfile/krecentdocument.cpp
===================================================================
--- /home/aseigo/kde4/KDE/kdelibs/kio/kfile/krecentdocument.cpp	(revision 734497)
+++ /home/aseigo/kde4/KDE/kdelibs/kio/kfile/krecentdocument.cpp	(working copy)
@@ -63,11 +63,12 @@
     for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
        QString pathDesktop = d.absoluteFilePath( *it );
        KDesktopFile tmpDesktopFile( pathDesktop );
-       KUrl urlDesktopFile(tmpDesktopFile.readUrl());
-       if( urlDesktopFile.isLocalFile() && !QFile(urlDesktopFile.path()).exists())
+       KUrl urlDesktopFile(tmpDesktopFile.desktopGroup().readPathEntry("URL", QString()));
+       if (urlDesktopFile.isLocalFile() && !QFile(urlDesktopFile.path()).exists()) {
            d.remove(pathDesktop);
-       else
+       } else {
            fullList.append( pathDesktop );
+       }
     }
 
     return fullList;

[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic