diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-06-05 00:51:41 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-06-05 00:51:41 +0200 |
commit | 3f2cfd3dab93f212504de7bdcdc6625659170ec1 (patch) | |
tree | 69414dfec1fe84470b11325324ad2be6b685dae7 /src/history/historypanel.cpp | |
parent | Awesome bar speed up (diff) | |
download | rekonq-3f2cfd3dab93f212504de7bdcdc6625659170ec1.tar.xz |
This commit implements some speed optimizations on startup
as loading the dockwidgets show on first show.
It also cleans up bookmarks menu loading.
Diffstat (limited to 'src/history/historypanel.cpp')
-rw-r--r-- | src/history/historypanel.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/history/historypanel.cpp b/src/history/historypanel.cpp index d8309eed..a030676d 100644 --- a/src/history/historypanel.cpp +++ b/src/history/historypanel.cpp @@ -54,8 +54,13 @@ HistoryPanel::HistoryPanel(const QString &title, QWidget *parent, Qt::WindowFlags flags) : QDockWidget(title, parent, flags) , m_treeView(new PanelTreeView(this)) + , _loaded(false) { - setup(); + setObjectName("historyPanel"); + setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + + connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(showing(bool))); + setShown(ReKonfig::showHistoryPanel()); } @@ -67,10 +72,17 @@ HistoryPanel::~HistoryPanel() } + +void HistoryPanel::showing(bool b) +{ + if(b && !_loaded) + setup(); +} + + void HistoryPanel::setup() { - setObjectName("historyPanel"); - setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); + kDebug() << "Loading history panel setup..."; QWidget *ui = new QWidget(this); @@ -117,6 +129,8 @@ void HistoryPanel::setup() connect(search, SIGNAL(textChanged(QString)), treeProxyModel, SLOT(setFilterFixedString(QString))); connect(m_treeView, SIGNAL(contextMenuItemRequested(const QPoint &)), this, SLOT(contextMenuItem(const QPoint &))); connect(m_treeView, SIGNAL(contextMenuGroupRequested(const QPoint &)), this, SLOT(contextMenuGroup(const QPoint &))); + + _loaded = true; } |