From 5b916a3efac135fe7dd65d16ca528a60178f7721 Mon Sep 17 00:00:00 2001 From: Jesse Litton Date: Sun, 12 Mar 2017 10:53:55 -0500 Subject: [PATCH] Another RBL fix - for when results are not in CVA DB. --- docs/RELEASES | 2 ++ src/asyncinfo.cpp | 53 +++++++++++++++++++++++++++-------------------- src/imp.pro | 2 +- src/meta.h | 4 ++-- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/docs/RELEASES b/docs/RELEASES index aa271d3..1314e0d 100644 --- a/docs/RELEASES +++ b/docs/RELEASES @@ -1,3 +1,5 @@ +0.7.4 - Another fix for RBL checks when CVA comes back with no info for corp. + 0.7.3 - Fixes various issues with kos checking. 0.7.0 - Added red-by-last KOS checking. diff --git a/src/asyncinfo.cpp b/src/asyncinfo.cpp index a99ec35..bdaab12 100755 --- a/src/asyncinfo.cpp +++ b/src/asyncinfo.cpp @@ -318,30 +318,37 @@ void AsyncInfo::gotKosCheckCorpReply() QJsonObject jsonObject = jsonResponse.object(); QJsonArray jsonArray = jsonObject["results"].toArray(); - KosEntry kosEntry; - foreach (const QJsonValue& value, jsonArray) { - QJsonObject obj = value.toObject(); - - // Most of these are unused right now, but I've got plans - - kosEntry.corp.eveId = obj["eveid"].toInt(); - kosEntry.corp.icon = obj["icon"].toString(); - kosEntry.corp.id = obj["id"].toInt(); - kosEntry.corp.kos = obj["kos"].toBool(); - kosEntry.corp.name = obj["label"].toString(); - kosEntry.corp.npc = obj["npc"].toBool(); - kosEntry.corp.ticker = obj["ticker"].toString(); - - QJsonObject allianceObj = obj["alliance"].toObject(); - kosEntry.alliance.eveId = allianceObj["eveid"].toInt(); - kosEntry.alliance.icon = allianceObj["icon"].toString(); - kosEntry.alliance.id = allianceObj["id"].toInt(); - kosEntry.alliance.kos = allianceObj["kos"].toBool(); - kosEntry.alliance.name = allianceObj["label"].toString(); - kosEntry.alliance.ticker = allianceObj["ticker"].toString(); - } + if(jsonArray.count() > 0) + { + KosEntry kosEntry; + foreach (const QJsonValue& value, jsonArray) { + QJsonObject obj = value.toObject(); + + // Most of these are unused right now, but I've got plans + + kosEntry.corp.eveId = obj["eveid"].toInt(); + kosEntry.corp.icon = obj["icon"].toString(); + kosEntry.corp.id = obj["id"].toInt(); + kosEntry.corp.kos = obj["kos"].toBool(); + kosEntry.corp.name = obj["label"].toString(); + kosEntry.corp.npc = obj["npc"].toBool(); + kosEntry.corp.ticker = obj["ticker"].toString(); + + QJsonObject allianceObj = obj["alliance"].toObject(); + kosEntry.alliance.eveId = allianceObj["eveid"].toInt(); + kosEntry.alliance.icon = allianceObj["icon"].toString(); + kosEntry.alliance.id = allianceObj["id"].toInt(); + kosEntry.alliance.kos = allianceObj["kos"].toBool(); + kosEntry.alliance.name = allianceObj["label"].toString(); + kosEntry.alliance.ticker = allianceObj["ticker"].toString(); + } - emit rblResultReady(checkNames, kosEntry.corp.kos | kosEntry.alliance.kos); + emit rblResultReady(checkNames, kosEntry.corp.kos | kosEntry.alliance.kos); + } + else + { + emit rblResultReady(checkNames, false); + } } else { diff --git a/src/imp.pro b/src/imp.pro index 404c8d9..b29e037 100644 --- a/src/imp.pro +++ b/src/imp.pro @@ -12,7 +12,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = imp TEMPLATE = app -VERSION = 0.7.3 +VERSION = 0.7.4 QMAKE_TARGET_COMPANY = EternalDusk QMAKE_TARGET_DESCRIPTION = Eve Online Intelligence Management Program QMAKE_TARGET_COPYRIGHT = (c) Copyright 2016-2017 Jesse Litton diff --git a/src/meta.h b/src/meta.h index 2544862..8d410d3 100644 --- a/src/meta.h +++ b/src/meta.h @@ -25,8 +25,8 @@ static const struct Version { - QString release = "0.7.3"; - QString name = "The Super-Sonic Uber-toxic Lycanthropic Hot-Topic"; + QString release = "0.7.4"; + QString name = "The Myopic Super-Sonic Uber-toxic Lycanthropic Hot Topic"; QString styleHeader1 = ""; QString styleFooter1 = "";