Skip to content

Commit

Permalink
Remove magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
blondfrogs committed Jul 7, 2020
1 parent 8c1fb71 commit 405e1ee
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/qt/ravengui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,29 +862,32 @@ void RavenGUI::createToolBars()

// List the found values
QStringList list = rx.capturedTexts();
static const int CLIENT_VERSION_MAJOR_INDEX = 1;
static const int CLIENT_VERSION_MINOR_INDEX = 2;
static const int CLIENT_VERSION_REVISION_INDEX = 3;
bool fNewSoftwareFound = false;
bool fStopSearch = false;
if (list.size() >= 4) {
if (CLIENT_VERSION_MAJOR < list[1].toInt()) {
if (CLIENT_VERSION_MAJOR < list[CLIENT_VERSION_MAJOR_INDEX].toInt()) {
fNewSoftwareFound = true;
} else {
if (CLIENT_VERSION_MAJOR > list[1].toInt()) {
if (CLIENT_VERSION_MAJOR > list[CLIENT_VERSION_MAJOR_INDEX].toInt()) {
fStopSearch = true;
}
}

if (!fStopSearch) {
if (CLIENT_VERSION_MINOR < list[2].toInt()) {
if (CLIENT_VERSION_MINOR < list[CLIENT_VERSION_MINOR_INDEX].toInt()) {
fNewSoftwareFound = true;
} else {
if (CLIENT_VERSION_MINOR > list[2].toInt()) {
if (CLIENT_VERSION_MINOR > list[CLIENT_VERSION_MINOR_INDEX].toInt()) {
fStopSearch = true;
}
}
}

if (!fStopSearch) {
if (CLIENT_VERSION_REVISION < list[3].toInt()) {
if (CLIENT_VERSION_REVISION < list[CLIENT_VERSION_REVISION_INDEX].toInt()) {
fNewSoftwareFound = true;
}
}
Expand Down

0 comments on commit 405e1ee

Please sign in to comment.