Bug 241503 - right click menu shows blank entry on bottom
Summary: right click menu shows blank entry on bottom
Status: RESOLVED FIXED
Alias: None
Product: rekonq
Classification: Unmaintained
Component: general (show other bugs)
Version: 0.4.95
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Andrea Diamantini
URL:
Keywords:
Depends on:
Blocks: 237890
  Show dependency treegraph
 
Reported: 2010-06-12 05:51 UTC by disabled account
Modified: 2010-09-04 10:01 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description disabled account 2010-06-12 05:51:41 UTC
Version:           0.4.95 (using Devel) 
OS:                Linux

Rightclicking somewhere on a page shows a blank entry right under "Inspect Element".

Reproducible: Always

Steps to Reproduce:
Rightclick somewhere on a normal webpage (e.g. google.com).

Actual Results:  
Blank entry on the bottom.

Expected Results:  
No blank entry on the bottom.

I use KDE SC 4.5 with qt 4.7, also rekonq crashes like hell, I wasnt quite sure whether I should report these crashes, shall I?
Comment 1 Panagiotis Papadopoulos 2010-06-12 11:50:37 UTC
I can confirm the blank entry with the latest git version.
Comment 2 Yoann Laissus 2010-06-12 23:34:40 UTC
commit d484b7313e7bea07acad5e9785dbbbb2d7f03076
Author: Yoann Laissus <yoann.laissus@gmail.com>
Date:   Sat Jun 12 11:57:03 2010 +0200

    Fix the add bookmark action of the WebView context menu
    BUG: 241503

diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index 396d5bd..4b4e127 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -142,9 +142,6 @@ BookmarkMenu::BookmarkMenu(KBookmarkManager *manager,
                            KActionCollection* actionCollection)
         : KBookmarkMenu(manager, owner, menu, actionCollection)
 {
-    KAction *a = KStandardAction::addBookmark(this, SLOT(slotAddBookmark()), this);
-    actionCollection->addAction(QL1S("rekonq_add_bookmark"), a);
-
     refill();
 }
 
@@ -174,22 +171,6 @@ KMenu * BookmarkMenu::contextMenu(QAction *act)
 }
 
 
-void BookmarkMenu::slotAddBookmark()
-{
-    KAction *action = qobject_cast<KAction *>(sender());
-    if (action && !action->data().isNull())
-    {
-        KBookmarkGroup parentBookmark = manager()->findByAddress(parentAddress()).toGroup();
-        /// TODO Add bookmark Icon
-        parentBookmark.addBookmark(owner()->currentTitle(), action->data().toUrl());
-        manager()->emitChanged();
-        return;
-    }
-
-    KBookmarkMenu::slotAddBookmark();
-}
-
-
 QAction * BookmarkMenu::actionForBookmark(const KBookmark &bookmark)
 {
     if (bookmark.isGroup())
@@ -303,6 +284,9 @@ BookmarkProvider::BookmarkProvider(QObject *parent)
     m_owner = new BookmarkOwner(this);
     connect(m_owner, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType &)), this, SIGNAL(openUrl(const KUrl&, const Rekonq::OpenType &)));
 
+    KAction *a = KStandardAction::addBookmark(this, SLOT(slotAddBookmark()), this);
+    m_actionCollection->addAction(QL1S("rekonq_add_bookmark"), a);
+
     kDebug() << "Loading Bookmarks Manager... DONE!";
 }
 
@@ -491,3 +475,11 @@ QString BookmarkProvider::titleForBookmarkUrl(const KBookmark &bookmark, QString
 
     return title;
 }
+
+
+void BookmarkProvider::slotAddBookmark()
+{
+    KBookmarkGroup parentBookmark = rootGroup();
+    parentBookmark.addBookmark(bookmarkOwner()->currentTitle(), bookmarkOwner()->currentUrl());
+    bookmarkManager()->emitChanged();
+}
diff --git a/src/bookmarks/bookmarksmanager.h b/src/bookmarks/bookmarksmanager.h
index 67e54be..4be3a94 100644
--- a/src/bookmarks/bookmarksmanager.h
+++ b/src/bookmarks/bookmarksmanager.h
@@ -160,9 +160,6 @@ protected:
     virtual void refill();
     virtual QAction* actionForBookmark(const KBookmark &bookmark);
 
-protected slots:
-    void slotAddBookmark();
-
 private:
     void addOpenFolderInTabs();
 
@@ -265,6 +262,7 @@ public slots:
 
 private slots:
     void triggerBookmarkMenu();
+    void slotAddBookmark();
     
 private:
     void fillBookmarkBar(KToolBar *toolBar);