From bd32f05dab4832528e0c2304d722e5140ffd74e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Ander=20Pe=C3=B1alba?= Date: Fri, 15 Oct 2010 21:03:42 +0200 Subject: BookmarkOwner clean-up and minor bug fixed --- src/bookmarks/bookmarkowner.h | 53 ++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 36 deletions(-) (limited to 'src/bookmarks/bookmarkowner.h') diff --git a/src/bookmarks/bookmarkowner.h b/src/bookmarks/bookmarkowner.h index 573e4ee0..cbd4bd0e 100644 --- a/src/bookmarks/bookmarkowner.h +++ b/src/bookmarks/bookmarkowner.h @@ -35,14 +35,12 @@ #include "rekonq_defines.h" // KDE Includes -#include -#include #include +#include /** - * Reimplementation of KBookmarkOwner, this class allows to manage - * bookmarks as actions. + * This class allows to manage bookmarks as actions. */ class REKONQ_TESTS_EXPORT BookmarkOwner : public QObject, public KBookmarkOwner { @@ -72,56 +70,40 @@ public: */ KAction* action(const KBookmark &bookmark, const BookmarkAction &bmAction); + // @{ /** - * @return the current page's title. + * Funtions to get current information. */ virtual QString currentTitle() const; - /** - * @return the current page's URL. - */ virtual QString currentUrl() const; - - /** - * @return whether the owner supports tabs. - */ - virtual bool supportsTabs() const; - - /** - * @return list of title, URL pairs of the open tabs. - */ virtual QList< QPair > currentBookmarkList() const; + // @} + + virtual bool supportsTabs() const {return true;} + // @{ /** - * This function is called when a bookmark is selected and belongs to - * the ancestor class. - * This method actually emits signal to load bookmark's url. - * - * @param bookmark the bookmark to open - * @param mouseButtons the mouse buttons clicked to select the bookmark - * @param keyboardModifiers the keyboard modifiers pushed when the bookmark was selected + * This functions emit signals that open the selected URLs */ virtual void openBookmark(const KBookmark &bookmark, Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers); - - /** - * Called if the user wants to open every bookmark in this folder in a new tab. - * The default implementation does nothing. - * This is only called if supportsTabs() returns true - */ virtual void openFolderinTabs(const KBookmarkGroup &bookmark); + // @} public Q_SLOTS: void openBookmark(const KBookmark &bookmark); void openBookmarkInNewTab(const KBookmark &bookmark); void openBookmarkInNewWindow(const KBookmark &bookmark); - void openBookmarkFolder(const KBookmark &bookmark); + void openBookmarkFolder(const KBookmarkGroup &bookmark); + KBookmark bookmarkCurrentPage(const KBookmark &bookmark = KBookmark()); KBookmarkGroup newBookmarkFolder(const KBookmark &bookmark = KBookmark()); KBookmark newSeparator(const KBookmark &bookmark = KBookmark()); + void copyLink(const KBookmark &bookmark); void editBookmark(KBookmark bookmark); - bool deleteBookmark(KBookmark bookmark); + bool deleteBookmark(const KBookmark &bookmark); Q_SIGNALS: /** @@ -132,10 +114,9 @@ Q_SIGNALS: private: KAction* createAction(const QString &text, const QString &icon, - const QString &help, const char *slot, - const KBookmark &bookmark); + const QString &help, const char *slot, + const KBookmark &bookmark); - KBookmarkManager *m_manager; }; @@ -149,7 +130,7 @@ class CustomBookmarkAction : public KAction public: CustomBookmarkAction(const KBookmark &bookmark, const KIcon &icon, const QString &text, QObject *parent); - ~CustomBookmarkAction(); + virtual ~CustomBookmarkAction() {} Q_SIGNALS: void triggered(const KBookmark &); -- cgit v1.2.1 From a385a9c1d6c91c5c3fbf8615934952df985d3c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Ander=20Pe=C3=B1alba?= Date: Sat, 16 Oct 2010 15:40:17 +0200 Subject: Function renamed --- src/bookmarks/bookmarkowner.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bookmarks/bookmarkowner.h') diff --git a/src/bookmarks/bookmarkowner.h b/src/bookmarks/bookmarkowner.h index cbd4bd0e..c291bf2a 100644 --- a/src/bookmarks/bookmarkowner.h +++ b/src/bookmarks/bookmarkowner.h @@ -66,9 +66,9 @@ public: }; /** - * @return the action connected to the bookmark or 0 if it doesn't exist. + * @return A new action for the given bookmark. */ - KAction* action(const KBookmark &bookmark, const BookmarkAction &bmAction); + KAction* createAction(const KBookmark &bookmark, const BookmarkAction &bmAction); // @{ /** -- cgit v1.2.1 From 4323f070444d0d0bcdb96ea1c21e77a921db63e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Ander=20Pe=C3=B1alba?= Date: Sun, 7 Nov 2010 11:33:54 +0100 Subject: Variable renamed --- src/bookmarks/bookmarkowner.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bookmarks/bookmarkowner.h') diff --git a/src/bookmarks/bookmarkowner.h b/src/bookmarks/bookmarkowner.h index c291bf2a..4d377191 100644 --- a/src/bookmarks/bookmarkowner.h +++ b/src/bookmarks/bookmarkowner.h @@ -88,7 +88,7 @@ public: virtual void openBookmark(const KBookmark &bookmark, Qt::MouseButtons mouseButtons, Qt::KeyboardModifiers keyboardModifiers); - virtual void openFolderinTabs(const KBookmarkGroup &bookmark); + virtual void openFolderinTabs(const KBookmarkGroup &bkGoup); // @} public Q_SLOTS: -- cgit v1.2.1