mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-20 20:54:38 -04:00
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:
parent
b9fa06c890
commit
b16447b13d
1 changed files with 5 additions and 6 deletions
|
@ -45,16 +45,13 @@ UrlFetchProgressDialog::UrlFetchProgressDialog(const QUrl &url, QWidget *parent)
|
||||||
setWindowTitle(tr("Download Progress"));
|
setWindowTitle(tr("Download Progress"));
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
setLabelText(tr("Downloading %1.").arg(url.toDisplayString()));
|
setLabelText(tr("Downloading %1.").arg(url.toDisplayString()));
|
||||||
setMinimum(0);
|
setMinimumDuration(2000);
|
||||||
setValue(0);
|
|
||||||
setMinimumDuration(0);
|
|
||||||
setMinimumSize(QSize(400, 75));
|
setMinimumSize(QSize(400, 75));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UrlFetchProgressDialog::networkReplyProgress(qint64 bytesRead, qint64 totalBytes)
|
void UrlFetchProgressDialog::networkReplyProgress(qint64 bytesRead, qint64 totalBytes)
|
||||||
{
|
{
|
||||||
setMaximum(totalBytes);
|
setValue(static_cast<int>(bytesRead / totalBytes));
|
||||||
setValue(bytesRead);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EditWidgetIcons::EditWidgetIcons(QWidget* parent)
|
EditWidgetIcons::EditWidgetIcons(QWidget* parent)
|
||||||
|
@ -280,7 +277,9 @@ void EditWidgetIcons::fetchFinished()
|
||||||
void EditWidgetIcons::fetchCanceled()
|
void EditWidgetIcons::fetchCanceled()
|
||||||
{
|
{
|
||||||
#ifdef WITH_XC_NETWORKING
|
#ifdef WITH_XC_NETWORKING
|
||||||
m_reply->abort();
|
if (m_reply) {
|
||||||
|
m_reply->abort();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue