summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkspanel.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-11-07 22:33:11 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-11-07 22:33:11 +0100
commit4bb3ca9452cb165d8ca8da5e3fc5bcfe1b9cfd1a (patch)
tree151d078b89a94ea10142c0979db8306119ad6865 /src/bookmarks/bookmarkspanel.cpp
parentLet suggestions work also without search engines ones. (diff)
parentBug when a bookmark contains a '&' fixed in some cases (diff)
downloadrekonq-4bb3ca9452cb165d8ca8da5e3fc5bcfe1b9cfd1a.tar.xz
Merge branch 'master' of git.kde.org:rekonq
Diffstat (limited to 'src/bookmarks/bookmarkspanel.cpp')
-rw-r--r--src/bookmarks/bookmarkspanel.cpp55
1 files changed, 18 insertions, 37 deletions
diff --git a/src/bookmarks/bookmarkspanel.cpp b/src/bookmarks/bookmarkspanel.cpp
index f732cb22..1763a1e5 100644
--- a/src/bookmarks/bookmarkspanel.cpp
+++ b/src/bookmarks/bookmarkspanel.cpp
@@ -51,7 +51,7 @@ BookmarksPanel::BookmarksPanel(const QString &title, QWidget *parent, Qt::Window
setVisible(ReKonfig::showBookmarksPanel());
panelTreeView()->setDragEnabled(true);
panelTreeView()->setAcceptDrops(true);
- connect(_bkTreeModel, SIGNAL(bookmarksUpdated()), this, SLOT(startLoadFoldedState()));
+ connect(_bkTreeModel, SIGNAL(bookmarksUpdated()), this, SLOT(loadFoldedState()));
}
@@ -61,7 +61,7 @@ BookmarksPanel::~BookmarksPanel()
}
-void BookmarksPanel::startLoadFoldedState()
+void BookmarksPanel::loadFoldedState()
{
_loadingState = true;
loadFoldedState(QModelIndex());
@@ -76,32 +76,13 @@ void BookmarksPanel::contextMenu(const QPoint &pos)
BookmarksContextMenu menu(bookmarkForIndex( panelTreeView()->indexAt(pos) ),
Application::bookmarkProvider()->bookmarkManager(),
- Application::bookmarkProvider()->bookmarkOwner(),
- this
+ Application::bookmarkProvider()->bookmarkOwner()
);
menu.exec(panelTreeView()->mapToGlobal(pos));
}
-void BookmarksPanel::contextMenuItem(const QPoint &pos)
-{
- contextMenu(pos);
-}
-
-
-void BookmarksPanel::contextMenuGroup(const QPoint &pos)
-{
- contextMenu(pos);
-}
-
-
-void BookmarksPanel::contextMenuEmpty(const QPoint &pos)
-{
- contextMenu(pos);
-}
-
-
void BookmarksPanel::deleteBookmark()
{
QModelIndex index = panelTreeView()->currentIndex();
@@ -132,12 +113,25 @@ void BookmarksPanel::onExpand(const QModelIndex &index)
}
+void BookmarksPanel::setup()
+{
+ UrlPanel::setup();
+ kDebug() << "Bookmarks panel...";
+
+ connect(panelTreeView(), SIGNAL(delKeyPressed()), this, SLOT(deleteBookmark()));
+ connect(panelTreeView(), SIGNAL(collapsed(const QModelIndex &)), this, SLOT(onCollapse(const QModelIndex &)));
+ connect(panelTreeView(), SIGNAL(expanded(const QModelIndex &)), this, SLOT(onExpand(const QModelIndex &)));
+
+ loadFoldedState();
+}
+
+
void BookmarksPanel::loadFoldedState(const QModelIndex &root)
{
QAbstractItemModel *model = panelTreeView()->model();
if(!model)
return;
-
+
int count = model->rowCount(root);
QModelIndex index;
@@ -157,19 +151,6 @@ void BookmarksPanel::loadFoldedState(const QModelIndex &root)
}
-void BookmarksPanel::setup()
-{
- UrlPanel::setup();
- kDebug() << "Bookmarks panel...";
-
- connect(panelTreeView(), SIGNAL(delKeyPressed()), this, SLOT(deleteBookmark()));
- connect(panelTreeView(), SIGNAL(collapsed(const QModelIndex &)), this, SLOT(onCollapse(const QModelIndex &)));
- connect(panelTreeView(), SIGNAL(expanded(const QModelIndex &)), this, SLOT(onExpand(const QModelIndex &)));
-
- startLoadFoldedState();
-}
-
-
KBookmark BookmarksPanel::bookmarkForIndex(const QModelIndex &index)
{
if (!index.isValid())
@@ -183,7 +164,7 @@ KBookmark BookmarksPanel::bookmarkForIndex(const QModelIndex &index)
}
-QAbstractItemModel* BookmarksPanel::getModel()
+QAbstractItemModel* BookmarksPanel::model()
{
return _bkTreeModel;
}