1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

Fixed crash when opening qupzilla:restore in multiple tabs.

closes #567
This commit is contained in:
nowrep 2012-09-12 14:03:26 +02:00
parent 5cf6b1c565
commit 884c152c39
2 changed files with 7 additions and 5 deletions

View File

@ -26,7 +26,6 @@
RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass) RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass)
: QWidget() : QWidget()
, ui(new Ui::RecoveryWidget) , ui(new Ui::RecoveryWidget)
, m_restoreManager(mApp->restoreManager())
, m_view(view) , m_view(view)
, p_QupZilla(mainClass) , p_QupZilla(mainClass)
{ {
@ -34,7 +33,7 @@ RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass)
setCursor(Qt::ArrowCursor); setCursor(Qt::ArrowCursor);
const RestoreData &data = m_restoreManager->restoreData(); const RestoreData &data = mApp->restoreManager()->restoreData();
for (int i = 0; i < data.size(); ++i) { for (int i = 0; i < data.size(); ++i) {
const RestoreManager::WindowData &wd = data.at(i); const RestoreManager::WindowData &wd = data.at(i);
@ -75,7 +74,12 @@ void RecoveryWidget::onItemChanged(QTreeWidgetItem* item, int column)
void RecoveryWidget::restoreSession() 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) { for (int win = ui->treeWidget->topLevelItemCount() - 1; win >= 0; --win) {
QTreeWidgetItem* root = ui->treeWidget->topLevelItem(win); QTreeWidgetItem* root = ui->treeWidget->topLevelItem(win);

View File

@ -30,7 +30,6 @@ class QTreeWidgetItem;
class WebView; class WebView;
class QupZilla; class QupZilla;
class RestoreManager;
class RecoveryWidget : public QWidget class RecoveryWidget : public QWidget
{ {
@ -49,7 +48,6 @@ private slots:
private: private:
Ui::RecoveryWidget* ui; Ui::RecoveryWidget* ui;
RestoreManager* m_restoreManager;
WebView* m_view; WebView* m_view;
QupZilla* p_QupZilla; QupZilla* p_QupZilla;
}; };