From 30a122c20971ebe638ea5763cccd8adbdb8b3307 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 22 Mar 2009 11:33:18 +0100 Subject: Fixing loading of konqueror bookmarks in a unusual place or missing.. --- src/bookmarks.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/bookmarks.cpp') diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp index 1066e3ce..6b6d549c 100644 --- a/src/bookmarks.cpp +++ b/src/bookmarks.cpp @@ -20,16 +20,22 @@ -// Local Includes +// Self Includes #include "bookmarks.h" #include "bookmarks.moc" +// Local Includes #include "mainwindow.h" #include "webview.h" // KDE Includes #include #include +#include +#include + +// Qt Includes +#include OwnBookMarks::OwnBookMarks(KMainWindow *parent) : QObject(parent) @@ -85,6 +91,22 @@ BookmarksProvider::BookmarksProvider(KMainWindow* parent) , m_bmToolbar(0) { KUrl bookfile = KUrl( "~/.kde/share/apps/konqueror/bookmarks.xml" ); // share konqueror bookmarks + + if (!QFile::exists( bookfile.path() ) ) + { + bookfile = KUrl( "~/.kde4/share/apps/konqueror/bookmarks.xml" ); + if (!QFile::exists( bookfile.path() ) ) + { + QString bookmarksDefaultPath = KStandardDirs::locate("appdata" , "defaultbookmarks.xbel"); + kWarning() << bookmarksDefaultPath; + QFile bkms(bookmarksDefaultPath); + QString bookmarksPath = KStandardDirs::locateLocal("appdata", "bookmarks.xml", true); + bookmarksPath.replace("rekonq", "konqueror"); + bkms.copy(bookmarksPath); + + bookfile = KUrl( bookmarksPath ); + } + } m_manager = KBookmarkManager::managerForExternalFile( bookfile.path() ); m_ac = new KActionCollection( this ); } -- cgit v1.2.1