Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
setvisible committed Jun 6, 2023
2 parents cf88e9b + 36cd2b1 commit 81c8ab3
Show file tree
Hide file tree
Showing 23 changed files with 580 additions and 578 deletions.
15 changes: 8 additions & 7 deletions src/core/downloaditem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ void DownloadItem::resume()

/* Signals/Slots of QNetworkReply */
connect(d->reply, SIGNAL(metaDataChanged()), this, SLOT(onMetaDataChanged()));
connect(d->reply, SIGNAL(downloadProgress(qsizetype, qsizetype)),
this, SLOT(onDownloadProgress(qsizetype, qsizetype)));
connect(d->reply, SIGNAL(downloadProgress(qint64, qint64)),
this, SLOT(onDownloadProgress(qint64, qint64)));
connect(d->reply, SIGNAL(redirected(QUrl)), this, SLOT(onRedirected(QUrl)));
connect(d->reply, SIGNAL(error(QNetworkReply::NetworkError)),
this, SLOT(onError(QNetworkReply::NetworkError)));
connect(d->reply, SIGNAL(errorOccurred(QNetworkReply::NetworkError)),
this, SLOT(onErrorOccurred(QNetworkReply::NetworkError)));
connect(d->reply, SIGNAL(finished()), this, SLOT(onFinished()));

/* Signals/Slots of QIODevice */
Expand Down Expand Up @@ -181,15 +181,16 @@ void DownloadItem::onMetaDataChanged()
}
}

void DownloadItem::onDownloadProgress(qsizetype bytesReceived, qsizetype bytesTotal)
void DownloadItem::onDownloadProgress(qint64 bytesReceived, qint64 bytesTotal)
{
if (d->reply && bytesReceived > 0 && bytesTotal > 0) {
logInfo(QString("Downloaded '%0' (%1 of %2 bytes).")
.arg(d->reply->url().toString(),
QString::number(bytesReceived),
QString::number(bytesTotal)));
}
updateInfo(bytesReceived, bytesTotal);
updateInfo(static_cast<qsizetype>(bytesReceived),
static_cast<qsizetype>(bytesTotal));
}

void DownloadItem::onRedirected(const QUrl &url)
Expand Down Expand Up @@ -312,7 +313,7 @@ QString DownloadItem::statusToHttp(QNetworkReply::NetworkError error)
Q_UNREACHABLE();
}

void DownloadItem::onError(QNetworkReply::NetworkError error)
void DownloadItem::onErrorOccurred(QNetworkReply::NetworkError error)
{
/// \todo Use instead: auto reply = qobject_cast<QNetworkReply*>(sender());
if (d->reply) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/downloaditem.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ class DownloadItem : public AbstractDownloadItem

private slots:
void onMetaDataChanged();
void onDownloadProgress(qsizetype bytesReceived, qsizetype bytesTotal);
void onDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void onRedirected(const QUrl &url);
void onFinished();
void onError(QNetworkReply::NetworkError error);
void onErrorOccurred(QNetworkReply::NetworkError error);
void onReadyRead();
void onAboutToClose();

Expand Down
9 changes: 5 additions & 4 deletions src/core/updatechecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,16 @@ void UpdateChecker::downloadAndInstallUpdate()
return;
}

connect(reply, SIGNAL(downloadProgress(qsizetype, qsizetype)),
this, SLOT(onBinaryProgress(qsizetype, qsizetype)));
connect(reply, SIGNAL(downloadProgress(qint64, qint64)),
this, SLOT(onBinaryProgress(qint64, qint64)));
connect(reply, SIGNAL(finished()),
this, SLOT(onBinaryFinished()));
}

void UpdateChecker::onBinaryProgress(qsizetype bytesReceived, qsizetype bytesTotal)
void UpdateChecker::onBinaryProgress(qint64 bytesReceived, qint64 bytesTotal)
{
emit downloadProgress(bytesReceived, bytesTotal);
emit downloadProgress(static_cast<qsizetype>(bytesReceived),
static_cast<qsizetype>(bytesTotal));
}

void UpdateChecker::onBinaryFinished()
Expand Down
2 changes: 1 addition & 1 deletion src/core/updatechecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class UpdateChecker : public QObject

private slots:
void onMetadataFinished();
void onBinaryProgress(qsizetype bytesReceived, qsizetype bytesTotal);
void onBinaryProgress(qint64 bytesReceived, qint64 bytesTotal);
void onBinaryFinished();

private:
Expand Down
4 changes: 2 additions & 2 deletions src/dialogs/addcontentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void AddContentDialog::loadUrl(const QUrl &url)
qInfo("Loading URL. HTML parser is Google Gumbo.");
NetworkManager *networkManager = m_downloadManager->networkManager();
QNetworkReply *reply = networkManager->get(m_url);
connect(reply, SIGNAL(downloadProgress(qsizetype, qsizetype)), this, SLOT(onDownloadProgress(qsizetype, qsizetype)));
connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(onDownloadProgress(qint64, qint64)));
connect(reply, SIGNAL(finished()), this, SLOT(onFinished()));
#endif
setProgressInfo(0, tr("Connecting..."));
Expand Down Expand Up @@ -255,7 +255,7 @@ void AddContentDialog::onHtmlReceived(QString content)
parseHtml(downloadedData);
}
#else
void AddContentDialog::onDownloadProgress(qsizetype bytesReceived, qsizetype bytesTotal)
void AddContentDialog::onDownloadProgress(qint64 bytesReceived, qint64 bytesTotal)
{
/* Between 1% and 90% */
int percent = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/dialogs/addcontentdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private slots:
void onLoadFinished(bool finished);
void onHtmlReceived(QString content);
#else
void onDownloadProgress(qsizetype bytesReceived, qsizetype bytesTotal);
void onDownloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void onFinished();
#endif
void onSelectionChanged();
Expand Down
70 changes: 35 additions & 35 deletions src/locale/dza_ar_EG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -761,172 +761,172 @@ You can also use batch descriptors to download multiple files at one time.</sour
<context>
<name>DownloadItem</name>
<message>
<location filename="../core/downloaditem.cpp" line="265"/>
<location filename="../core/downloaditem.cpp" line="266"/>
<source>No Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="268"/>
<location filename="../core/downloaditem.cpp" line="269"/>
<source>3xx Redirect connection refused</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="269"/>
<location filename="../core/downloaditem.cpp" line="270"/>
<source>3xx Redirect remote host closed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="270"/>
<location filename="../core/downloaditem.cpp" line="271"/>
<source>3xx Redirect host not found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="271"/>
<location filename="../core/downloaditem.cpp" line="272"/>
<source>3xx Redirect timeout</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="272"/>
<location filename="../core/downloaditem.cpp" line="273"/>
<source>3xx Redirect operation canceled</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="273"/>
<location filename="../core/downloaditem.cpp" line="274"/>
<source>3xx Redirect SSL handshake failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="274"/>
<location filename="../core/downloaditem.cpp" line="275"/>
<source>3xx Redirect temporary network failure</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="275"/>
<location filename="../core/downloaditem.cpp" line="276"/>
<source>3xx Redirect network session failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="276"/>
<location filename="../core/downloaditem.cpp" line="277"/>
<source>3xx Redirect background request not allowed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="278"/>
<location filename="../core/downloaditem.cpp" line="279"/>
<source>3xx Too many redirects</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="279"/>
<location filename="../core/downloaditem.cpp" line="280"/>
<source>3xx Insecure redirect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="281"/>
<location filename="../core/downloaditem.cpp" line="282"/>
<source>3xx Unknown redirect error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="284"/>
<location filename="../core/downloaditem.cpp" line="285"/>
<source>5xx Proxy connection refused</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="285"/>
<location filename="../core/downloaditem.cpp" line="286"/>
<source>5xx Proxy connection closed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="286"/>
<location filename="../core/downloaditem.cpp" line="287"/>
<source>5xx Proxy not found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="287"/>
<location filename="../core/downloaditem.cpp" line="288"/>
<source>504 Proxy timeout error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="288"/>
<location filename="../core/downloaditem.cpp" line="289"/>
<source>407 Proxy authentication required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="289"/>
<location filename="../core/downloaditem.cpp" line="290"/>
<source>5xx Unknown proxy error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="292"/>
<location filename="../core/downloaditem.cpp" line="293"/>
<source>403 Access denied</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="293"/>
<location filename="../core/downloaditem.cpp" line="294"/>
<source>405 Method not allowed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="294"/>
<location filename="../core/downloaditem.cpp" line="295"/>
<source>404 Not found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="295"/>
<location filename="../core/downloaditem.cpp" line="296"/>
<source>401 Authorization required</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="296"/>
<location filename="../core/downloaditem.cpp" line="297"/>
<source>4xx Resend error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="297"/>
<location filename="../core/downloaditem.cpp" line="298"/>
<source>409 Conflict</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="298"/>
<location filename="../core/downloaditem.cpp" line="299"/>
<source>410 Content no longer available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="299"/>
<location filename="../core/downloaditem.cpp" line="300"/>
<source>4xx Unknown content error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="302"/>
<location filename="../core/downloaditem.cpp" line="303"/>
<source>4xx Unknown protocol error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="303"/>
<location filename="../core/downloaditem.cpp" line="304"/>
<source>400 Bad request</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="304"/>
<location filename="../core/downloaditem.cpp" line="305"/>
<source>4xx Protocol failure</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="307"/>
<location filename="../core/downloaditem.cpp" line="308"/>
<source>500 Internal server error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="308"/>
<location filename="../core/downloaditem.cpp" line="309"/>
<source>501 Server does not support this functionality</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="309"/>
<location filename="../core/downloaditem.cpp" line="310"/>
<source>503 Service unavailable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../core/downloaditem.cpp" line="310"/>
<location filename="../core/downloaditem.cpp" line="311"/>
<source>5xx Unknown serveur error</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -4217,7 +4217,7 @@ Ex:
<location filename="../core/updatechecker.cpp" line="92"/>
<location filename="../core/updatechecker.cpp" line="104"/>
<location filename="../core/updatechecker.cpp" line="197"/>
<location filename="../core/updatechecker.cpp" line="216"/>
<location filename="../core/updatechecker.cpp" line="217"/>
<source>Network request rejected.</source>
<translation type="unfinished"></translation>
</message>
Expand Down
Loading

0 comments on commit 81c8ab3

Please sign in to comment.