summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarksmanager.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-07-28 00:16:59 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-08-14 19:39:47 +0200
commit1ed00f9949c9507768db0973c61b9648a8a58575 (patch)
treed34878e8368219ff90e97a8a72b1c62a4789fab8 /src/bookmarks/bookmarksmanager.cpp
parentFixed focus regression. (diff)
downloadrekonq-1ed00f9949c9507768db0973c61b9648a8a58575.tar.xz
Manually importing Yoann merge 2260
PLease, check if I did something wrong..
Diffstat (limited to 'src/bookmarks/bookmarksmanager.cpp')
-rw-r--r--src/bookmarks/bookmarksmanager.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index d9612607..bba9dd77 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -593,3 +593,41 @@ void BookmarkProvider::slotPanelChanged()
panel->startLoadFoldedState();
}
}
+
+
+KBookmark BookmarkProvider::bookmarkForUrl(const KUrl &url)
+{
+ KBookmark found;
+
+ KBookmarkGroup root = rootGroup();
+ if (root.isNull())
+ {
+ return found;
+ }
+
+ return bookmarkForUrl(root, url);
+}
+
+
+KBookmark BookmarkProvider::bookmarkForUrl(const KBookmark &bookmark, const KUrl &url)
+{
+ KBookmark found;
+
+ if (bookmark.isGroup())
+ {
+ KBookmarkGroup group = bookmark.toGroup();
+ KBookmark bookmark = group.first();
+
+ while (!bookmark.isNull() && found.isNull())
+ {
+ found = bookmarkForUrl(bookmark, url);
+ bookmark = group.next(bookmark);
+ }
+ }
+ else if (!bookmark.isSeparator() && bookmark.url() == url)
+ {
+ found = bookmark;
+ }
+
+ return found;
+}