summaryrefslogtreecommitdiff
path: root/src/bookmarks.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-03-22 11:33:18 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-03-22 11:33:18 +0100
commit30a122c20971ebe638ea5763cccd8adbdb8b3307 (patch)
treee1aa44ed65b6b065f0dfe8e7f2bed171554c458d /src/bookmarks.cpp
parentChange tab dim if count() > 3 (diff)
downloadrekonq-30a122c20971ebe638ea5763cccd8adbdb8b3307.tar.xz
Fixing loading of konqueror bookmarks in a unusual place or missing..
Diffstat (limited to 'src/bookmarks.cpp')
-rw-r--r--src/bookmarks.cpp24
1 files changed, 23 insertions, 1 deletions
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 <KMimeType>
#include <KMenu>
+#include <KStandardDirs>
+#include <KDebug>
+
+// Qt Includes
+#include <QFile>
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 );
}