Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > fd4cd2f7616f47ca9a62a573f59c142d > files > 15

kdelibs4-4.6.5-1.6.mga1.src.rpm

commit f67c4d76139d85968f17284fa6ba4b00adacf62b
Author: Stephan Kulow <coolo@suse.de>
Date:   Thu Oct 13 11:08:56 2011 +0200

    Call mkdir before relying on directories
    
    If you need a file in a local directory, you need to call mkdir first.
    This bug has been around for a while, both openSUSE and kubuntu have
    patches applied to ignore the error. But fixing it instead sounds much
    more appealing - it's easy to ignore though as it will go away once
    some other code creates ~/.local/share for Trash.

diff --git a/kfile/kfileplacessharedbookmarks.cpp b/kfile/kfileplacessharedbookmarks.cpp
index d9efe89..9cbdcf4 100644
--- a/kfile/kfileplacessharedbookmarks.cpp
+++ b/kfile/kfileplacessharedbookmarks.cpp
@@ -113,7 +113,9 @@ KFilePlacesSharedBookmarks::KFilePlacesSharedBookmarks(KBookmarkManager * mgr)
 {
     m_placesBookmarkManager = mgr;
     
-    const QString file = KStandardDirs().localxdgdatadir() + "/user-places.xbel";
+    // we check later if the directory exists 
+    KStandardDirs::makeDir(KStandardDirs().localxdgdatadir());
+    const QString file = KStandardDirs().localxdgdatadir() + "user-places.xbel";
     m_sharedBookmarkManager = KBookmarkManager::managerForExternalFile(file); 
     
     connect(m_sharedBookmarkManager, SIGNAL(changed(const QString&, const QString&)),