Skip to content
This repository has been archived by the owner on Aug 26, 2020. It is now read-only.

Commit

Permalink
Fix more KOS Check bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
3vi1 committed Mar 11, 2017
1 parent 91e8c09 commit ac45e0b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 33 deletions.
59 changes: 33 additions & 26 deletions src/asyncinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
2 changes: 1 addition & 1 deletion src/imp.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ void MainWindow::clipboardUpdated()
{
if(options.getKosCheck())
{
kosSoundPlayed = false;

QStringList lines, names;
lines = QApplication::clipboard()->text().split('\n');

Expand Down Expand Up @@ -498,18 +500,19 @@ void MainWindow::gotKosReply(const QString& pilotNames, const QList<KosEntry>& 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<KosEntry>& entries)
Expand Down
4 changes: 2 additions & 2 deletions src/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<span style=\" color:#0000ff;\">";
QString styleFooter1 = "</span>";
Expand Down

0 comments on commit ac45e0b

Please sign in to comment.