Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Commit

Permalink
Fixed crash when opening qupzilla:restore in multiple tabs.
Browse files Browse the repository at this point in the history
closes #567
  • Loading branch information
nowrep committed Sep 12, 2012
1 parent 5cf6b1c commit 884c152
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/lib/session/recoverywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@
RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass)
: QWidget()
, ui(new Ui::RecoveryWidget)
, m_restoreManager(mApp->restoreManager())
, m_view(view)
, p_QupZilla(mainClass)
{
ui->setupUi(this);

setCursor(Qt::ArrowCursor);

const RestoreData &data = m_restoreManager->restoreData();
const RestoreData &data = mApp->restoreManager()->restoreData();

for (int i = 0; i < data.size(); ++i) {
const RestoreManager::WindowData &wd = data.at(i);
Expand Down Expand Up @@ -75,7 +74,12 @@ void RecoveryWidget::onItemChanged(QTreeWidgetItem* item, int column)

void RecoveryWidget::restoreSession()
{
RestoreData data = m_restoreManager->restoreData();
RestoreManager* manager = mApp->restoreManager();
if (!manager) {
return;
}

RestoreData data = manager->restoreData();

for (int win = ui->treeWidget->topLevelItemCount() - 1; win >= 0; --win) {
QTreeWidgetItem* root = ui->treeWidget->topLevelItem(win);
Expand Down
2 changes: 0 additions & 2 deletions src/lib/session/recoverywidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class QTreeWidgetItem;

class WebView;
class QupZilla;
class RestoreManager;

class RecoveryWidget : public QWidget
{
Expand All @@ -49,7 +48,6 @@ private slots:
private:
Ui::RecoveryWidget* ui;

RestoreManager* m_restoreManager;
WebView* m_view;
QupZilla* p_QupZilla;
};
Expand Down

0 comments on commit 884c152

Please sign in to comment.