summaryrefslogtreecommitdiff
path: root/src/bookmarks
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/bookmarksmanager.cpp2
-rw-r--r--src/bookmarks/bookmarkspanel.cpp19
-rw-r--r--src/bookmarks/bookmarkspanel.h6
3 files changed, 21 insertions, 6 deletions
diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp
index 93bb5386..e88c5f69 100644
--- a/src/bookmarks/bookmarksmanager.cpp
+++ b/src/bookmarks/bookmarksmanager.cpp
@@ -144,7 +144,6 @@ BookmarkMenu::BookmarkMenu(KBookmarkManager *manager,
{
KAction *a = KStandardAction::addBookmark(this, SLOT(slotAddBookmark()), this);
actionCollection->addAction(QL1S("rekonq_add_bookmark"), a);
- refill();
}
@@ -154,7 +153,6 @@ BookmarkMenu::BookmarkMenu(KBookmarkManager *manager,
const QString &parentAddress)
: KBookmarkMenu(manager, owner, parentMenu, parentAddress)
{
- refill();
}
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;
}
diff --git a/src/bookmarks/bookmarkspanel.h b/src/bookmarks/bookmarkspanel.h
index b2a9f264..3d2dc26b 100644
--- a/src/bookmarks/bookmarkspanel.h
+++ b/src/bookmarks/bookmarkspanel.h
@@ -61,6 +61,9 @@ signals:
void itemHovered(const QString &);
void saveOnlyRequested();
+public slots:
+ void showing(bool);
+
private slots:
void contextMenu(const QPoint &pos);
@@ -70,13 +73,14 @@ private slots:
void loadFoldedState(const QModelIndex &root);
void loadFoldedState();
-
private:
void setup();
KBookmark bookmarkForIndex(const QModelIndex &index);
PanelTreeView *m_treeView;
bool m_loadingState;
+
+ bool _loaded;
};
#endif // BOOKMARKSPANEL_H