From affefe0f3f62536908d7a2681a77d12e4d3016a0 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 2 Jan 2023 17:19:00 -0500 Subject: [PATCH 1/2] Move Rank to Star namespace --- app/src/resultspresenter.cpp | 2 +- lib/include/star/rank.h | 5 +++++ lib/src/rank.cpp | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/resultspresenter.cpp b/app/src/resultspresenter.cpp index ccb3398..e7898cb 100644 --- a/app/src/resultspresenter.cpp +++ b/app/src/resultspresenter.cpp @@ -72,7 +72,7 @@ void ResultPresenter::printElectionResult(const Star::ElectionResult& result) // Print raw score rankings cout << HEADING_SCORE_RANKINGS << endl; - for(const Rank& rank : result.election()->scoreRankings()) + for(const Star::Rank& rank : result.election()->scoreRankings()) cout << RAW_SCORE_TEMPLATE.arg(Qx::String::join(rank.candidates, R"(", ")")).arg(rank.value) << endl; cout << endl; diff --git a/lib/include/star/rank.h b/lib/include/star/rank.h index a96a5c9..f0ec3fb 100644 --- a/lib/include/star/rank.h +++ b/lib/include/star/rank.h @@ -4,6 +4,9 @@ // Qt Includes #include +namespace Star +{ + struct Rank { enum Order { Ascending, Descending }; @@ -14,4 +17,6 @@ struct Rank static QList rankSort(const QMap& valueMap, Order order = Descending); }; +} + #endif // RANK_H diff --git a/lib/src/rank.cpp b/lib/src/rank.cpp index aae2cfc..4662e87 100644 --- a/lib/src/rank.cpp +++ b/lib/src/rank.cpp @@ -4,6 +4,9 @@ // Qt Includes #include +namespace Star +{ + //=============================================================================================================== // Rank //=============================================================================================================== @@ -105,3 +108,5 @@ QList Rank::rankSort(const QMap& valueMap, Order order) return rankings; } + +} From 76ea559e6af2b2124c502c3a9a4c3013b7d8cb37 Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Mon, 2 Jan 2023 17:31:33 -0500 Subject: [PATCH 2/2] Bump version for release --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c56ad19..169993e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ option(STARPP_DOCS "Build STAR++ documentation" OFF) # Project # NOTE: DON'T USE TRAILING ZEROS IN VERSIONS project(STARpp - VERSION 0.2.0.1 + VERSION 0.2.0.2 LANGUAGES CXX DESCRIPTION "C++ implementation of STAR voting" )