Skip to content

Commit

Permalink
Fix occasional crash when favicon progress dialog is closed (#1980)
Browse files Browse the repository at this point in the history
* Changed progress dialog to a true percentage calculation
* Removed some unnecessary code
  • Loading branch information
droidmonkey authored May 21, 2018
1 parent b9fa06c commit b16447b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/gui/EditWidgetIcons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -280,7 +277,9 @@ void EditWidgetIcons::fetchFinished()
void EditWidgetIcons::fetchCanceled()
{
#ifdef WITH_XC_NETWORKING
m_reply->abort();
if (m_reply) {
m_reply->abort();
}
#endif
}

Expand Down

0 comments on commit b16447b

Please sign in to comment.