diff --git a/src/asyncinfo.cpp b/src/asyncinfo.cpp index 04a0bf3..a99ec35 100755 --- a/src/asyncinfo.cpp +++ b/src/asyncinfo.cpp @@ -312,33 +312,40 @@ void AsyncInfo::gotKosCheckCorpReply() qDebug() << "AsyncInfo::gotKosCheckCorpReply - b = " << b; - QJsonDocument jsonResponse = QJsonDocument::fromJson(b); - QJsonObject jsonObject = jsonResponse.object(); - QJsonArray jsonArray = jsonObject["results"].toArray(); - - KosEntry kosEntry; - foreach (const QJsonValue& value, jsonArray) { - QJsonObject obj = value.toObject(); + if(b.length() > 0) + { + QJsonDocument jsonResponse = QJsonDocument::fromJson(b); + 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(); + } - // 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); + } + else + { + emit rblResultReady(checkNames, false); } - - emit rblResultReady(checkNames, kosEntry.corp.kos | kosEntry.alliance.kos); this->deleteLater(); } diff --git a/src/imp.pro b/src/imp.pro index 3ad3507..0102639 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.1 +VERSION = 0.7.2 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/mainwindow.cpp b/src/mainwindow.cpp index bc5b311..4f38435 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -351,6 +351,8 @@ void MainWindow::clipboardUpdated() { if(options.getKosCheck()) { + kosSoundPlayed = false; + QStringList lines, names; lines = QApplication::clipboard()->text().split('\n'); @@ -498,18 +500,19 @@ void MainWindow::gotKosReply(const QString& pilotNames, const QList& e return; } } + + pilotsBeingChecked--; } + if(playKos && kosSoundPlayed != true) { audio.playLocalFile(options.getSoundIsKos()); kosSoundPlayed = true; } - - if(--pilotsBeingChecked == 0) + else if(pilotsBeingChecked == 0) { audio.playLocalFile(options.getSoundNoKos()); - kosSoundPlayed = false; - } + } } void MainWindow::gotEssReply(const QList& entries) diff --git a/src/meta.h b/src/meta.h index c57fcbd..295383b 100644 --- a/src/meta.h +++ b/src/meta.h @@ -25,8 +25,8 @@ static const struct Version { - QString release = "0.7.1"; - QString name = "An Uber-toxic Lycanthropic Hot-Topic"; + QString release = "0.7.2"; + QString name = "An Ultra Uber-toxic Lycanthropic Hot-Topic"; QString styleHeader1 = ""; QString styleFooter1 = "";