summaryrefslogtreecommitdiff
path: root/src/bookmarks/bookmarkspanel.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-06-05 00:51:41 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-06-05 00:51:41 +0200
commit3f2cfd3dab93f212504de7bdcdc6625659170ec1 (patch)
tree69414dfec1fe84470b11325324ad2be6b685dae7 /src/bookmarks/bookmarkspanel.cpp
parentAwesome bar speed up (diff)
downloadrekonq-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/bookmarks/bookmarkspanel.cpp')
-rw-r--r--src/bookmarks/bookmarkspanel.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/bookmarks/bookmarkspanel.cpp b/src/bookmarks/bookmarkspanel.cpp
index 502af574..0dbb89c4 100644
--- a/src/bookmarks/bookmarkspanel.cpp
+++ b/src/bookmarks/bookmarkspanel.cpp
@@ -54,8 +54,13 @@ BookmarksPanel::BookmarksPanel(const QString &title, QWidget *parent, Qt::Window
: QDockWidget(title, parent, flags)
, m_treeView(new PanelTreeView(this))
, m_loadingState(false)
+ , _loaded(false)
{
- setup();
+ setObjectName("bookmarksPanel");
+ setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+
+ connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(showing(bool)));
+
setShown(ReKonfig::showBookmarksPanel());
}
@@ -66,10 +71,16 @@ BookmarksPanel::~BookmarksPanel()
}
+void BookmarksPanel::showing(bool b)
+{
+ if(b && !_loaded)
+ setup();
+}
+
+
void BookmarksPanel::setup()
{
- setObjectName("bookmarksPanel");
- setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
+ kDebug() << "Loading bookmarks panel setup...";
QWidget *ui = new QWidget(this);
@@ -116,6 +127,8 @@ void BookmarksPanel::setup()
connect(m_treeView, SIGNAL(expanded(const QModelIndex &)), this, SLOT(onExpand(const QModelIndex &)));
connect(search, SIGNAL(textChanged(const QString &)), proxy, SLOT(setFilterFixedString(const QString &)));
loadFoldedState();
+
+ _loaded = true;
}