summaryrefslogtreecommitdiff
path: root/src/history
diff options
context:
space:
mode:
Diffstat (limited to 'src/history')
-rw-r--r--src/history/historypanel.cpp20
-rw-r--r--src/history/historypanel.h5
2 files changed, 22 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;
}
diff --git a/src/history/historypanel.h b/src/history/historypanel.h
index 1c86cfee..68de2828 100644
--- a/src/history/historypanel.h
+++ b/src/history/historypanel.h
@@ -53,6 +53,9 @@ public:
explicit HistoryPanel(const QString &title, QWidget *parent = 0, Qt::WindowFlags flags = 0);
~HistoryPanel();
+public slots:
+ void showing(bool);
+
signals:
void openUrl(const KUrl &, const Rekonq::OpenType &);
void itemHovered(const QString &);
@@ -65,6 +68,8 @@ private slots:
private:
void setup();
PanelTreeView *m_treeView;
+
+ bool _loaded;
};
#endif // HISTORYPANEL_H