mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Fix all compilation issues after enabling QT_DISABLE_DEPRECATED_UP_TO
This commit is contained in:
@ -54,7 +54,7 @@ QString ComicVineAllVolumeComicsRetriever::consolidateJSON()
|
||||
QJsonObject consolidatedJSON;
|
||||
QJsonArray comicsInfo;
|
||||
|
||||
foreach (QByteArray json, jsonResponses) {
|
||||
for (const auto &json : jsonResponses) {
|
||||
QJsonDocument doc = QJsonDocument::fromJson(json);
|
||||
|
||||
if (doc.isNull() || !doc.isObject() || doc.isEmpty()) {
|
||||
@ -72,8 +72,8 @@ QString ComicVineAllVolumeComicsRetriever::consolidateJSON()
|
||||
continue;
|
||||
}
|
||||
|
||||
QJsonArray resultsArray = results.toArray();
|
||||
foreach (const QJsonValue &v, resultsArray)
|
||||
const auto resultsArray = results.toArray();
|
||||
for (const auto &v : resultsArray)
|
||||
comicsInfo.append(v);
|
||||
}
|
||||
}
|
||||
|
||||
@ -442,23 +442,23 @@ void ComicVineDialog::queryTimeOut()
|
||||
|
||||
void ComicVineDialog::getComicsInfo(QList<QPair<ComicDB, QString>> matchingInfo, const SelectedVolumeInfo &volumeInfo)
|
||||
{
|
||||
QPair<ComicDB, QString> p;
|
||||
QList<ComicDB> comics;
|
||||
foreach (p, matchingInfo) {
|
||||
const auto &matches = matchingInfo;
|
||||
for (auto match : matches) {
|
||||
auto comicVineClient = new ComicVineClient;
|
||||
// connect(comicVineClient,SIGNAL(searchResult(QString)),this,SLOT(debugClientResults(QString)));
|
||||
// connect(comicVineClient,SIGNAL(timeOut()),this,SLOT(queryTimeOut()));
|
||||
// connect(comicVineClient,SIGNAL(finished()),comicVineClient,SLOT(deleteLater()));
|
||||
bool error;
|
||||
bool timeout;
|
||||
QByteArray result = comicVineClient->getComicDetail(p.second, error, timeout); // TODO check timeOut or Connection error
|
||||
QByteArray result = comicVineClient->getComicDetail(match.second, error, timeout); // TODO check timeOut or Connection error
|
||||
if (error || timeout)
|
||||
continue; // TODO
|
||||
ComicDB comic = YACReader::parseCVJSONComicInfo(p.first, result, volumeInfo); // TODO check result error
|
||||
comic.info.comicVineID = p.second;
|
||||
ComicDB comic = YACReader::parseCVJSONComicInfo(match.first, result, volumeInfo); // TODO check result error
|
||||
comic.info.comicVineID = match.second;
|
||||
comics.push_back(comic);
|
||||
|
||||
setLoadingMessage(tr("Retrieving tags for : %1").arg(p.first.getFileName()));
|
||||
setLoadingMessage(tr("Retrieving tags for : %1").arg(match.first.getFileName()));
|
||||
}
|
||||
|
||||
DBHelper::updateComicsInfo(comics, databasePath);
|
||||
|
||||
@ -142,8 +142,8 @@ QMultiMap<QString, QString> getAuthors(const QVariant &json_authors)
|
||||
|
||||
QString authorName = resultsValue.value("name").toString();
|
||||
|
||||
QStringList roles = resultsValue.value("role").toString().split(",");
|
||||
foreach (QString role, roles) {
|
||||
const QStringList roles = resultsValue.value("role").toString().split(",");
|
||||
for (const auto &role : roles) {
|
||||
if (role.trimmed() == "writer")
|
||||
authors.insert("writer", authorName);
|
||||
else if (role.trimmed() == "inker")
|
||||
|
||||
@ -47,7 +47,7 @@ void VolumeComicsModel::load(const QString &json)
|
||||
|
||||
/*void VolumeComicsModel::load(const QStringList &jsonList)
|
||||
{
|
||||
foreach (QString json, jsonList) {
|
||||
for (const auto &json : jsonList) {
|
||||
load(json);
|
||||
}
|
||||
}*/
|
||||
|
||||
@ -247,13 +247,13 @@ void SortVolumeComics::showRemovedComicsSelector()
|
||||
|
||||
QList<QPair<ComicDB, QString>> SortVolumeComics::getMatchingInfo()
|
||||
{
|
||||
QList<ComicDB> comicList = localComicsModel->getData();
|
||||
const auto comicList = localComicsModel->getData();
|
||||
QList<QPair<ComicDB, QString>> l;
|
||||
|
||||
int index = 0;
|
||||
|
||||
QString id;
|
||||
foreach (ComicDB c, comicList) {
|
||||
for (const auto &c : comicList) {
|
||||
id = volumeComicsModel->getComicId(index);
|
||||
if (!c.getFileName().isEmpty() && !id.isEmpty()) // there is a valid comic, and valid comic ID
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user