Fix narrowing conversions
This commit is contained in:
@@ -45,15 +45,17 @@ void AlbumCoverExporter::SetDialogResult(const AlbumCoverExport::DialogResult &d
|
||||
|
||||
void AlbumCoverExporter::AddExportRequest(const Song &song) {
|
||||
requests_.append(new CoverExportRunnable(dialog_result_, song));
|
||||
all_ = requests_.count();
|
||||
all_ = static_cast<int>(requests_.count());
|
||||
}
|
||||
|
||||
void AlbumCoverExporter::Cancel() { requests_.clear(); }
|
||||
|
||||
void AlbumCoverExporter::StartExporting() {
|
||||
|
||||
exported_ = 0;
|
||||
skipped_ = 0;
|
||||
AddJobsToPool();
|
||||
|
||||
}
|
||||
|
||||
void AlbumCoverExporter::AddJobsToPool() {
|
||||
@@ -70,13 +72,17 @@ void AlbumCoverExporter::AddJobsToPool() {
|
||||
}
|
||||
|
||||
void AlbumCoverExporter::CoverExported() {
|
||||
exported_++;
|
||||
|
||||
++exported_;
|
||||
emit AlbumCoversExportUpdate(exported_, skipped_, all_);
|
||||
AddJobsToPool();
|
||||
|
||||
}
|
||||
|
||||
void AlbumCoverExporter::CoverSkipped() {
|
||||
skipped_++;
|
||||
|
||||
++skipped_;
|
||||
emit AlbumCoversExportUpdate(exported_, skipped_, all_);
|
||||
AddJobsToPool();
|
||||
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ class AlbumCoverExporter : public QObject {
|
||||
void StartExporting();
|
||||
void Cancel();
|
||||
|
||||
int request_count() { return requests_.size(); }
|
||||
int request_count() { return static_cast<int>(requests_.size()); }
|
||||
|
||||
signals:
|
||||
void AlbumCoversExportUpdate(int exported, int skipped, int all);
|
||||
|
||||
@@ -229,7 +229,7 @@ QByteArray DiscogsCoverProvider::GetReplyData(QNetworkReply *reply) {
|
||||
|
||||
}
|
||||
|
||||
void DiscogsCoverProvider::HandleSearchReply(QNetworkReply *reply, const quint64 id) {
|
||||
void DiscogsCoverProvider::HandleSearchReply(QNetworkReply *reply, const int id) {
|
||||
|
||||
if (!replies_.contains(reply)) return;
|
||||
replies_.removeAll(reply);
|
||||
@@ -336,7 +336,7 @@ void DiscogsCoverProvider::SendReleaseRequest(const DiscogsCoverReleaseContext &
|
||||
|
||||
}
|
||||
|
||||
void DiscogsCoverProvider::HandleReleaseReply(QNetworkReply *reply, const quint64 search_id, const quint64 release_id) {
|
||||
void DiscogsCoverProvider::HandleReleaseReply(QNetworkReply *reply, const int search_id, const quint64 release_id) {
|
||||
|
||||
if (!replies_.contains(reply)) return;
|
||||
replies_.removeAll(reply);
|
||||
|
||||
@@ -62,7 +62,7 @@ class DiscogsCoverProvider : public JsonCoverProvider {
|
||||
|
||||
struct DiscogsCoverReleaseContext {
|
||||
explicit DiscogsCoverReleaseContext(const quint64 _search_id = 0, const quint64 _id = 0, const QUrl &_url = QUrl()) : search_id(_search_id), id(_id), url(_url) {}
|
||||
quint64 search_id;
|
||||
int search_id;
|
||||
quint64 id;
|
||||
QUrl url;
|
||||
};
|
||||
@@ -90,8 +90,8 @@ class DiscogsCoverProvider : public JsonCoverProvider {
|
||||
|
||||
private slots:
|
||||
void FlushRequests();
|
||||
void HandleSearchReply(QNetworkReply *reply, const quint64 id);
|
||||
void HandleReleaseReply(QNetworkReply *reply, const quint64 id, const quint64 release_id);
|
||||
void HandleSearchReply(QNetworkReply *reply, const int id);
|
||||
void HandleReleaseReply(QNetworkReply *reply, const int search_id, const quint64 release_id);
|
||||
|
||||
private:
|
||||
static const char *kUrlSearch;
|
||||
|
||||
@@ -127,11 +127,11 @@ void MusixmatchCoverProvider::HandleSearchReply(QNetworkReply *reply, const int
|
||||
QString content = data;
|
||||
QString data_begin = "var __mxmState = ";
|
||||
QString data_end = ";</script>";
|
||||
int begin_idx = content.indexOf(data_begin);
|
||||
qint64 begin_idx = content.indexOf(data_begin);
|
||||
QString content_json;
|
||||
if (begin_idx > 0) {
|
||||
begin_idx += data_begin.length();
|
||||
int end_idx = content.indexOf(data_end, begin_idx);
|
||||
qint64 end_idx = content.indexOf(data_end, begin_idx);
|
||||
if (end_idx > begin_idx) {
|
||||
content_json = content.mid(begin_idx, end_idx - begin_idx);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ SpotifyCoverProvider::SpotifyCoverProvider(Application *app, NetworkAccessManage
|
||||
s.endGroup();
|
||||
|
||||
if (!refresh_token_.isEmpty()) {
|
||||
qint64 time = expires_in_ - (QDateTime::currentDateTime().toSecsSinceEpoch() - login_time_);
|
||||
qint64 time = static_cast<qint64>(expires_in_) - (QDateTime::currentDateTime().toSecsSinceEpoch() - static_cast<qint64>(login_time_));
|
||||
if (time < 1) time = 1;
|
||||
refresh_login_timer_.setInterval(static_cast<int>(time * kMsecPerSec));
|
||||
refresh_login_timer_.start();
|
||||
|
||||
Reference in New Issue
Block a user