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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user