summaryrefslogtreecommitdiff
path: root/src/bookmarks.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-08-30 02:13:29 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-08-30 02:13:29 +0200
commitfb52741794cf8dc0fe76200096d1946d18d3bb55 (patch)
tree515c05db1f4fa5af047ece6d117f53b3fc93eaf3 /src/bookmarks.cpp
parentBookmark Bar fixes (diff)
downloadrekonq-fb52741794cf8dc0fe76200096d1946d18d3bb55.tar.xz
userBookmarksManager seems not work..
Revert "Using userBookmarksManager static function to surely retrieve bmManager.." This reverts commit ef48328f8fe0ac069215037c62711a5e08bf111f. Conflicts: src/bookmarks.cpp
Diffstat (limited to 'src/bookmarks.cpp')
-rw-r--r--src/bookmarks.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/bookmarks.cpp b/src/bookmarks.cpp
index 65c5846f..d8298478 100644
--- a/src/bookmarks.cpp
+++ b/src/bookmarks.cpp
@@ -152,13 +152,31 @@ void BookmarkMenu::slotAddBookmark()
BookmarkProvider::BookmarkProvider(QWidget *parent)
: QObject(parent)
- , m_manager(KBookmarkManager::userBookmarksManager())
+ , m_manager(0)
, m_owner(0)
, m_menu(new KMenu(parent))
, m_actionCollection(new KActionCollection(this))
, m_bookmarkMenu(0)
, m_bookmarkToolBar(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());
connect(m_manager, SIGNAL(changed(const QString &, const QString &)),
this, SLOT(slotBookmarksChanged(const QString &, const QString &)));