1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-22 02:02:10 +02:00

[Fix] Fixed occasional fails to restore session.

- also removed unneeded (now) checks to process slot
  while app/window is closing
  * as now no signals will be invoked on deleted objects
This commit is contained in:
nowrep 2012-01-10 19:10:16 +01:00
parent 8a88bdcc2d
commit ee8a16b3e1
4 changed files with 13 additions and 13 deletions

View File

@ -683,7 +683,8 @@ static const int sessionVersion = 0x0002;
bool MainApplication::saveStateSlot() bool MainApplication::saveStateSlot()
{ {
if (m_websettings->testAttribute(QWebSettings::PrivateBrowsingEnabled) || m_isRestoring) { if (m_websettings->testAttribute(QWebSettings::PrivateBrowsingEnabled) ||
m_isRestoring || m_mainWindows.count() == 0) {
return false; return false;
} }
@ -697,6 +698,7 @@ bool MainApplication::saveStateSlot()
stream << sessionVersion; stream << sessionVersion;
stream << m_mainWindows.count(); stream << m_mainWindows.count();
for (int i = 0; i < m_mainWindows.count(); i++) { for (int i = 0; i < m_mainWindows.count(); i++) {
QupZilla* qz = m_mainWindows.at(i).data(); QupZilla* qz = m_mainWindows.at(i).data();
if (!qz) { if (!qz) {

View File

@ -1479,7 +1479,14 @@ void QupZilla::closeEvent(QCloseEvent* event)
#ifndef Q_WS_MAC #ifndef Q_WS_MAC
if (mApp->windowCount() == 0) { if (mApp->windowCount() == 0) {
quitApp() ? event->accept() : event->ignore(); if (quitApp()) {
event->accept();
disconnectAllWidgets();
}
else {
event->ignore();
}
return; return;
} }
#endif #endif
@ -1537,7 +1544,7 @@ bool QupZilla::quitApp()
} }
} }
mApp->quitApplication(); QTimer::singleShot(0, mApp, SLOT(quitApplication()));
return true; return true;
} }

View File

@ -106,7 +106,7 @@ void NetworkManager::loadSettings()
void NetworkManager::setSSLConfiguration(QNetworkReply* reply) void NetworkManager::setSSLConfiguration(QNetworkReply* reply)
{ {
if (!reply->sslConfiguration().isNull() && !mApp->isClosing()) { if (!reply->sslConfiguration().isNull()) {
QSslCertificate cert = reply->sslConfiguration().peerCertificate(); QSslCertificate cert = reply->sslConfiguration().peerCertificate();
if (!cert.isValid() || reply->property("downReply").toBool()) { if (!cert.isValid() || reply->property("downReply").toBool()) {
return; return;

View File

@ -222,10 +222,6 @@ void WebView::loadFinished(bool state)
{ {
Q_UNUSED(state); Q_UNUSED(state);
if (mApp->isClosing() || p_QupZilla->isClosing()) {
return;
}
if (animationLoading(tabIndex(), false)->movie()) { if (animationLoading(tabIndex(), false)->movie()) {
animationLoading(tabIndex(), false)->movie()->stop(); animationLoading(tabIndex(), false)->movie()->stop();
} }
@ -324,11 +320,6 @@ void WebView::titleChanged()
void WebView::iconChanged() void WebView::iconChanged()
{ {
if (mApp->isClosing() || p_QupZilla->isClosing()) {
return;
}
// if (isCurrent())
emit siteIconChanged(); emit siteIconChanged();
if (m_isLoading) { if (m_isLoading) {