Fix occasional crash when favicon progress dialog is closed (#1980)

* Changed progress dialog to a true percentage calculation
* Removed some unnecessary code
This commit is contained in:
Jonathan White 2018-05-20 21:12:06 -04:00 committed by GitHub
parent b9fa06c890
commit b16447b13d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,16 +45,13 @@ UrlFetchProgressDialog::UrlFetchProgressDialog(const QUrl &url, QWidget *parent)
setWindowTitle(tr("Download Progress"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setLabelText(tr("Downloading %1.").arg(url.toDisplayString()));
setMinimum(0);
setValue(0);
setMinimumDuration(0);
setMinimumDuration(2000);
setMinimumSize(QSize(400, 75));
}
void UrlFetchProgressDialog::networkReplyProgress(qint64 bytesRead, qint64 totalBytes)
{
setMaximum(totalBytes);
setValue(bytesRead);
setValue(static_cast<int>(bytesRead / totalBytes));
}
EditWidgetIcons::EditWidgetIcons(QWidget* parent)
@ -280,7 +277,9 @@ void EditWidgetIcons::fetchFinished()
void EditWidgetIcons::fetchCanceled()
{
#ifdef WITH_XC_NETWORKING
m_reply->abort();
if (m_reply) {
m_reply->abort();
}
#endif
}