summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2011-05-18 08:31:45 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2011-05-18 08:31:45 +0200
commita68121bea99215c1cbaff6a5d4f5e624a1942be1 (patch)
treeed45548aea5a25072967ee28111b5961bf79145c
parentconnects tabMoved signal of TabBar to tabsChanged signal of MainView, (diff)
parentAdd "comment" bookmark field in the bookmark panel (diff)
downloadrekonq-a68121bea99215c1cbaff6a5d4f5e624a1942be1.tar.xz
Merge branch 'bkFolder'
-rw-r--r--src/bookmarks/bookmarkscontextmenu.cpp11
-rw-r--r--src/bookmarks/bookmarkscontextmenu.h8
-rw-r--r--src/bookmarks/bookmarkstoolbar.cpp9
-rw-r--r--src/bookmarks/bookmarkstreemodel.cpp7
4 files changed, 26 insertions, 9 deletions
diff --git a/src/bookmarks/bookmarkscontextmenu.cpp b/src/bookmarks/bookmarkscontextmenu.cpp
index 25cb9f24..1def2592 100644
--- a/src/bookmarks/bookmarkscontextmenu.cpp
+++ b/src/bookmarks/bookmarkscontextmenu.cpp
@@ -36,9 +36,10 @@
#include <KBookmarkManager>
-BookmarksContextMenu::BookmarksContextMenu(const KBookmark &bookmark, KBookmarkManager *manager, BookmarkOwner *owner, QWidget *parent)
+BookmarksContextMenu::BookmarksContextMenu(const KBookmark &bookmark, KBookmarkManager *manager, BookmarkOwner *owner, bool nullForced, QWidget *parent)
: KBookmarkContextMenu(bookmark, manager, owner, parent)
, m_bmOwner(owner)
+ , m_nullForced(nullForced)
{
}
@@ -132,17 +133,17 @@ void BookmarksContextMenu::addNullActions()
void BookmarksContextMenu::addActions()
{
- if (bookmark().isGroup())
+ if (bookmark().isNull() || m_nullForced)
{
- addFolderActions();
+ addNullActions();
}
else if (bookmark().isSeparator())
{
addSeparatorActions();
}
- else if (bookmark().isNull())
+ else if (bookmark().isGroup())
{
- addNullActions();
+ addFolderActions();
}
else
{
diff --git a/src/bookmarks/bookmarkscontextmenu.h b/src/bookmarks/bookmarkscontextmenu.h
index 416416ef..34ef66e0 100644
--- a/src/bookmarks/bookmarkscontextmenu.h
+++ b/src/bookmarks/bookmarkscontextmenu.h
@@ -36,8 +36,11 @@ class BookmarkOwner;
class BookmarksContextMenu : public KBookmarkContextMenu
{
public:
- BookmarksContextMenu(const KBookmark &bookmark, KBookmarkManager *manager, BookmarkOwner *owner, QWidget *parent = 0);
-
+ BookmarksContextMenu(const KBookmark &bookmark,
+ KBookmarkManager *manager,
+ BookmarkOwner *owner,
+ bool nullForced = false,
+ QWidget *parent = 0);
virtual void addActions();
private:
@@ -47,6 +50,7 @@ private:
void addNullActions();
BookmarkOwner *m_bmOwner;
+ bool m_nullForced;
};
#endif // BOOKMARKS_CONTEXT_MENU_H
diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp
index 57d56fff..1f1e38c3 100644
--- a/src/bookmarks/bookmarkstoolbar.cpp
+++ b/src/bookmarks/bookmarkstoolbar.cpp
@@ -189,13 +189,18 @@ KToolBar* BookmarkToolBar::toolBar()
void BookmarkToolBar::contextMenu(const QPoint &point)
{
KBookmarkActionInterface *action = dynamic_cast<KBookmarkActionInterface*>(toolBar()->actionAt(point));
- KBookmark bookmark;
+ KBookmark bookmark = rApp->bookmarkProvider()->bookmarkManager()->toolbar();
+ bool nullAction = true;
if (action)
+ {
bookmark = action->bookmark();
+ nullAction = false;
+ }
BookmarksContextMenu menu(bookmark,
rApp->bookmarkProvider()->bookmarkManager(),
- rApp->bookmarkProvider()->bookmarkOwner());
+ rApp->bookmarkProvider()->bookmarkOwner(),
+ nullAction);
menu.exec(toolBar()->mapToGlobal(point));
}
diff --git a/src/bookmarks/bookmarkstreemodel.cpp b/src/bookmarks/bookmarkstreemodel.cpp
index 8d82e2b0..1e2e462f 100644
--- a/src/bookmarks/bookmarkstreemodel.cpp
+++ b/src/bookmarks/bookmarkstreemodel.cpp
@@ -94,6 +94,13 @@ QVariant BtmItem::data(int role) const
tooltip += url;
}
+ if (!m_kbm.description().isEmpty())
+ {
+ if (!tooltip.isEmpty())
+ tooltip += '\n';
+ tooltip += m_kbm.description();
+ }
+
return tooltip;
}