summaryrefslogtreecommitdiff
path: root/src/bookmarkspanel/bookmarkspanel.cpp
diff options
context:
space:
mode:
authornehlsen <nehlsen@gmail.com>2009-11-16 15:33:46 +0100
committernehlsen <nehlsen@gmail.com>2009-11-16 15:33:46 +0100
commitbb93f5de3c0528c8b5465a4cd706b8033f35a281 (patch)
treeef87f526918a1bd5ea8b6cfbc2bf163e08868c85 /src/bookmarkspanel/bookmarkspanel.cpp
parentadded bookmarks panel and model(read only atm) (diff)
downloadrekonq-bb93f5de3c0528c8b5465a4cd706b8033f35a281.tar.xz
made bookmarks searchable
Diffstat (limited to 'src/bookmarkspanel/bookmarkspanel.cpp')
-rw-r--r--src/bookmarkspanel/bookmarkspanel.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/bookmarkspanel/bookmarkspanel.cpp b/src/bookmarkspanel/bookmarkspanel.cpp
index 1f3dff9b..a09e0058 100644
--- a/src/bookmarkspanel/bookmarkspanel.cpp
+++ b/src/bookmarkspanel/bookmarkspanel.cpp
@@ -27,6 +27,7 @@
// rekonq includes
#include "bookmarkspanel.h"
#include "bookmarkstreemodel.h"
+#include "bookmarksproxy.h"
// Auto Includes
#include "rekonq.h"
@@ -35,7 +36,6 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QTreeView>
-#include <QSortFilterProxyModel>
#include <QHeaderView>
// KDE includes
@@ -74,11 +74,12 @@ void BookmarksPanel::setup()
// setup search bar
QHBoxLayout *searchLayout = new QHBoxLayout;
searchLayout->setContentsMargins(5, 0, 0, 0);
- QLabel *searchLabel = new QLabel(i18n("Search:"));
+ QLabel *searchLabel = new QLabel(i18n("&Search:"));
searchLayout->addWidget(searchLabel);
KLineEdit *search = new KLineEdit;
search->setClearButtonShown(true);
searchLayout->addWidget(search);
+ searchLabel->setBuddy( search );
// setup tree view
QTreeView *treeView = new QTreeView(ui);
@@ -100,23 +101,10 @@ void BookmarksPanel::setup()
setWidget(ui);
BookmarksTreeModel *model = new BookmarksTreeModel( this );
- treeView->setModel( model );
+ BookmarksProxy *proxy = new BookmarksProxy(ui);
+ proxy->setSourceModel( model );
+ treeView->setModel( proxy );
+ connect(search, SIGNAL(textChanged(QString)), proxy, SLOT(setFilterFixedString(QString)));
connect( treeView, SIGNAL( activated(QModelIndex) ), this, SLOT( bookmarkActivated(QModelIndex) ) );
-
-// QSortFilterProxyModel *proxy = new QSortFilterProxyModel(ui);
- //-
-// HistoryManager *historyManager = Application::historyManager();
-// QAbstractItemModel *model = historyManager->historyTreeModel();
-//
-// m_treeProxyModel->setSourceModel(model);
-// m_treeView->setModel(m_treeProxyModel);
-// m_treeView->setExpanded(m_treeProxyModel->index(0, 0), true);
-// m_treeView->header()->hideSection(1);
-// QFontMetrics fm(font());
-// int header = fm.width(QLatin1Char('m')) * 40;
-// m_treeView->header()->resizeSection(0, header);
-//
-// connect(search, SIGNAL(textChanged(QString)), m_treeProxy, SLOT(setFilterFixedString(QString)));
-// connect(m_treeView, SIGNAL(activated(const QModelIndex&)), this, SLOT(open()));
}