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

Restore tabs: Disable updates of tabbar while restoring session.

Fixes sometimes drawing tabbar while restoring is in process, resulting
in painting only few tabs and then all restored tabs after a moment.
It will now only draw completely restored tabbar.

Also fixed one incorrect usage of setUpdatesEnabled in TreeWidget.
This commit is contained in:
nowrep 2013-02-23 11:59:08 +01:00
parent f19cb64163
commit 2ddff2a34e
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -170,7 +170,6 @@ bool TreeWidget::dropMimeData(QTreeWidgetItem* parent, int,
return false;
}
setUpdatesEnabled(false);
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
QSqlDatabase db = QSqlDatabase::database();
db.transaction();
@ -181,8 +180,9 @@ bool TreeWidget::dropMimeData(QTreeWidgetItem* parent, int,
return false;
}
while (!stream.atEnd()) {
setUpdatesEnabled(false);
while (!stream.atEnd()) {
QTreeWidgetItem* item = new QTreeWidgetItem;
item->read(stream);
bool parentIsRoot = item->data(0, ITEM_IS_TOPLEVEL).toBool();

View File

@ -890,6 +890,7 @@ QByteArray TabWidget::saveState()
bool TabWidget::restoreState(const QList<WebTab::SavedTab> &tabs, int currentTab)
{
m_isRestoringState = true;
setUpdatesEnabled(false);
Qz::BrowserWindow type = p_QupZilla->windowType();
@ -905,6 +906,8 @@ bool TabWidget::restoreState(const QList<WebTab::SavedTab> &tabs, int currentTab
}
m_isRestoringState = false;
setUpdatesEnabled(true);
setCurrentIndex(currentTab);
currentTabChanged(currentTab);