summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/bookmarksmanager.cpp34
-rw-r--r--src/bookmarks/bookmarksmanager.h2
2 files changed, 32 insertions, 4 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index d54abb3c..7e933599 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -35,6 +35,7 @@
#include "mainwindow.h"
#include "webtab.h"
#include "webview.h"
+#include "mainview.h"
#include "bookmarkcontextmenu.h"
// KDE Includes
@@ -53,7 +54,6 @@
#include <QtGui/QActionGroup>
-
BookmarkOwner::BookmarkOwner(QObject *parent)
: QObject(parent)
, KBookmarkOwner()
@@ -112,6 +112,22 @@ void BookmarkOwner::openFolderinTabs(const KBookmarkGroup &bm)
}
+QList< QPair<QString, QString> > BookmarkOwner::currentBookmarkList() const
+{
+ QList< QPair<QString, QString> > bkList;
+ int tabNumber = Application::instance()->mainWindow()->mainView()->count();
+
+ for(int i = 0; i < tabNumber; i++)
+ {
+ QPair<QString, QString> item;
+ item.first = Application::instance()->mainWindow()->mainView()->webTab(i)->view()->title();
+ item.second = Application::instance()->mainWindow()->mainView()->webTab(i)->url().url();
+ bkList += item;
+ }
+ return bkList;
+}
+
+
// ------------------------------------------------------------------------------------------------------
@@ -405,9 +421,19 @@ void BookmarkActionMenu::addFolderActions()
if(!m_group.first().isNull())
{
- action = new KAction(KIcon("tab-new"), i18n("Open Folder in Tabs"), this);
- connect(action, SIGNAL(triggered(bool)), this, SLOT(openActionInTabs()));
- addAction(action);
+ KBookmark bookmark = m_group.first();
+
+ while(bookmark.isGroup() || bookmark.isSeparator())
+ {
+ bookmark = m_group.next(bookmark);
+ }
+
+ if(!bookmark.isNull())
+ {
+ action = new KAction(KIcon("tab-new"), i18n("Open Folder in Tabs"), this);
+ connect(action, SIGNAL(triggered(bool)), this, SLOT(openActionInTabs()));
+ addAction(action);
+ }
}
action = new KAction(KIcon("bookmark-new"), i18n("Add Bookmark Here"), this);
diff --git a/src/bookmarks/bookmarksmanager.h b/src/bookmarks/bookmarksmanager.h
index c8264633..7fb02970 100644
--- a/src/bookmarks/bookmarksmanager.h
+++ b/src/bookmarks/bookmarksmanager.h
@@ -115,6 +115,8 @@ public:
*/
virtual void openFolderinTabs(const KBookmarkGroup &bm);
+ virtual QList< QPair<QString, QString> > currentBookmarkList() const;
+
signals:
/**
* This signal is emitted when an url has to be loaded