diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2011-04-28 00:04:20 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2011-04-28 00:04:20 +0200 |
commit | 339f1fe47ae8f6dcd799a674cdab65693a810d5f (patch) | |
tree | aac7c2cbae17b06f87d419022ae918b85d3a5c27 /src/bookmarks/bookmarkowner.cpp | |
parent | Letting rekonq URL popup behaves as Chrome's and Firefox4 ones (diff) | |
download | rekonq-339f1fe47ae8f6dcd799a674cdab65693a810d5f.tar.xz |
- A new option to set/unset the current bookmark bar folder in the context menu
- Fix drag and drop with a custom folder
- Fix a regression which affects BK bar drag and drop (5a53d2bf91dd)
Patch by Yoann Laissus, reviewed by me :)
Diffstat (limited to 'src/bookmarks/bookmarkowner.cpp')
-rw-r--r-- | src/bookmarks/bookmarkowner.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/bookmarks/bookmarkowner.cpp b/src/bookmarks/bookmarkowner.cpp index bfca6ef3..da006801 100644 --- a/src/bookmarks/bookmarkowner.cpp +++ b/src/bookmarks/bookmarkowner.cpp @@ -89,6 +89,12 @@ KAction* BookmarkOwner::createAction(const KBookmark &bookmark, const BookmarkAc case DELETE: return createAction(i18n("Delete"), "edit-delete", i18n("Delete the bookmark"), SLOT(deleteBookmark(const KBookmark &)), bookmark); + case SET_TOOLBAR_FOLDER: + return createAction(i18n("Set as toolbar folder"), "bookmark-toolbar", + "", SLOT(setToolBarFolder(KBookmark)), bookmark); + case UNSET_TOOLBAR_FOLDER: + return createAction(i18n("Unset this folder as the toolbar folder"), "bookmark-toolbar", + "", SLOT(unsetToolBarFolder()), bookmark); default: return 0; } @@ -332,6 +338,31 @@ bool BookmarkOwner::deleteBookmark(const KBookmark &bookmark) } +void BookmarkOwner::setToolBarFolder(KBookmark bookmark) +{ + if (!bookmark.isGroup()) + return; + + unsetToolBarFolder(); + bookmark.internalElement().setAttribute("toolbar", "yes"); + bookmark.setIcon("bookmark-toolbar"); + + m_manager->emitChanged(); +} + + +void BookmarkOwner::unsetToolBarFolder() +{ + KBookmarkGroup toolbar = m_manager->toolbar(); + if (!toolbar.isNull()) + { + toolbar.internalElement().setAttribute("toolbar", "no"); + toolbar.setIcon(""); + } + m_manager->emitChanged(); +} + + KAction* BookmarkOwner::createAction(const QString &text, const QString &icon, const QString &help, const char *slot, const KBookmark &bookmark) |