diff --git a/.clang-tidy b/.clang-tidy
index 3c98e81d..645c9c05 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -6,10 +6,11 @@ Checks:
- 'misc-*'
- 'modernize-*'
- 'performance-*'
+ - '-bugprone-easily-swappable-parameters'
- '-cppcoreguidelines-pro-type-reinterpret-cast'
- '-misc-include-cleaner'
- '-misc-non-private-member-variables-in-classes'
- - '-modernize-use-trailing-return-type'
- - '-bugprone-easily-swappable-parameters'
+ - '-misc-use-anonymous-namespace'
- '-modernize-return-braced-init-list'
+ - '-modernize-use-trailing-return-type'
FormatStyle: 'file'
diff --git a/.github/workflows/clang-tidy-review.yml b/.github/workflows/clang-tidy-review.yml
index c37236d6..a7ec09ff 100644
--- a/.github/workflows/clang-tidy-review.yml
+++ b/.github/workflows/clang-tidy-review.yml
@@ -126,7 +126,7 @@ jobs:
--build_dir='../build' \
--base_dir='${{ github.workspace }}/source' \
--clang_tidy_checks='' \
- --config_file='.clang-tidy' \
+ --config_file='' \
--include='*.[ch],*.[ch]xx,*.[chi]pp,*.[ch]++,*.cc,*.hh' \
--exclude='' \
--apt-packages='' \
diff --git a/ACKNOWLEDGEMENTS.md b/ACKNOWLEDGEMENTS.md
index 4aec61d2..6f7cd4ef 100644
--- a/ACKNOWLEDGEMENTS.md
+++ b/ACKNOWLEDGEMENTS.md
@@ -36,6 +36,7 @@ Supercell Wx uses code from the following dependencies:
| [OpenSSL](https://www.openssl.org/) | [OpenSSL License](https://spdx.org/licenses/OpenSSL.html) |
| [Qt](https://www.qt.io/) | [GNU Lesser General Public License v3.0 only](https://spdx.org/licenses/LGPL-3.0-only.html) | Qt Core, Qt GUI, Qt Multimedia, Qt Network, Qt OpenGL, Qt Positioning, Qt Serial Port, Qt SQL, Qt SVG, Qt Widgets
Additional Licenses: https://doc.qt.io/qt-6/licenses-used-in-qt.html |
| [qt6ct](https://github.com/trialuser02/qt6ct) | [BSD 2-Clause "Simplified" License](https://spdx.org/licenses/BSD-2-Clause.html) |
+| [range-v3](https://github.com/ericniebler/range-v3) | [Boost Software License 1.0](https://spdx.org/licenses/BSL-1.0.html)
[MIT License](https://spdx.org/licenses/MIT.html)
[Stepanov and McJones, "Elements of Programming" license](https://github.com/ericniebler/range-v3/tree/0.12.0?tab=License-1-ov-file)
[SGI C++ Standard Template Library license](https://github.com/ericniebler/range-v3/tree/0.12.0?tab=License-1-ov-file) |
| [re2](https://github.com/google/re2) | [BSD 3-Clause "New" or "Revised" License](https://spdx.org/licenses/BSD-3-Clause.html) |
| [spdlog](https://github.com/gabime/spdlog) | [MIT License](https://spdx.org/licenses/MIT.html) |
| [SQLite](https://www.sqlite.org/) | Public Domain |
diff --git a/conanfile.py b/conanfile.py
index e68c9f39..ea9c6ab9 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -18,6 +18,7 @@ class SupercellWxConan(ConanFile):
"libpng/1.6.47",
"libxml2/2.13.6",
"openssl/3.4.1",
+ "range-v3/0.12.0",
"re2/20240702",
"spdlog/1.15.1",
"sqlite3/3.49.1",
diff --git a/scwx-qt/scwx-qt.cmake b/scwx-qt/scwx-qt.cmake
index 89b31011..1628607a 100644
--- a/scwx-qt/scwx-qt.cmake
+++ b/scwx-qt/scwx-qt.cmake
@@ -11,6 +11,8 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
+OPTION(SCWX_DISABLE_CONSOLE "Disables the Windows console in release mode" ON)
+
find_package(Boost)
find_package(Fontconfig)
find_package(geographiclib)
@@ -615,7 +617,9 @@ set_target_properties(scwx-qt_update_radar_sites PROPERTIES FOLDER generate)
if (WIN32)
set(APP_ICON_RESOURCE_WINDOWS ${RESOURCE_OUTPUT})
qt_add_executable(supercell-wx ${EXECUTABLE_SOURCES} ${APP_ICON_RESOURCE_WINDOWS})
- set_target_properties(supercell-wx PROPERTIES WIN32_EXECUTABLE $,TRUE,FALSE>)
+ if (SCWX_DISABLE_CONSOLE)
+ set_target_properties(supercell-wx PROPERTIES WIN32_EXECUTABLE $,TRUE,FALSE>)
+ endif()
else()
qt_add_executable(supercell-wx ${EXECUTABLE_SOURCES})
endif()
diff --git a/scwx-qt/source/scwx/qt/config/radar_site.cpp b/scwx-qt/source/scwx/qt/config/radar_site.cpp
index 5c1dba2e..69815636 100644
--- a/scwx-qt/source/scwx/qt/config/radar_site.cpp
+++ b/scwx-qt/source/scwx/qt/config/radar_site.cpp
@@ -245,7 +245,7 @@ size_t RadarSite::ReadConfig(const std::string& path)
bool dataValid = true;
size_t sitesAdded = 0;
- boost::json::value j = util::json::ReadJsonFile(path);
+ boost::json::value j = util::json::ReadJsonQFile(path);
dataValid = j.is_array();
diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp
index 71f4d00c..d213b4fd 100644
--- a/scwx-qt/source/scwx/qt/main/main_window.cpp
+++ b/scwx-qt/source/scwx/qt/main/main_window.cpp
@@ -1018,6 +1018,7 @@ void MainWindowImpl::ConnectAnimationSignals()
for (auto map : maps_)
{
map->SelectTime(dateTime);
+ textEventManager_->SelectTime(dateTime);
QMetaObject::invokeMethod(
map, static_cast(&QWidget::update));
}
diff --git a/scwx-qt/source/scwx/qt/manager/alert_manager.cpp b/scwx-qt/source/scwx/qt/manager/alert_manager.cpp
index 757754a9..748e0943 100644
--- a/scwx-qt/source/scwx/qt/manager/alert_manager.cpp
+++ b/scwx-qt/source/scwx/qt/manager/alert_manager.cpp
@@ -138,8 +138,10 @@ common::Coordinate AlertManager::Impl::CurrentCoordinate(
void AlertManager::Impl::HandleAlert(const types::TextEventKey& key,
size_t messageIndex) const
{
+ auto messages = textEventManager_->message_list(key);
+
// Skip alert if there are more messages to be processed
- if (messageIndex + 1 < textEventManager_->message_count(key))
+ if (messages.empty() || messageIndex + 1 < messages.size())
{
return;
}
@@ -153,7 +155,7 @@ void AlertManager::Impl::HandleAlert(const types::TextEventKey& key,
audioSettings.alert_radius().GetValue());
std::string alertWFO = audioSettings.alert_wfo().GetValue();
- auto message = textEventManager_->message_list(key).at(messageIndex);
+ auto message = messages.at(messageIndex);
for (auto& segment : message->segments())
{
diff --git a/scwx-qt/source/scwx/qt/manager/marker_manager.cpp b/scwx-qt/source/scwx/qt/manager/marker_manager.cpp
index 952dea44..8af310ec 100644
--- a/scwx-qt/source/scwx/qt/manager/marker_manager.cpp
+++ b/scwx-qt/source/scwx/qt/manager/marker_manager.cpp
@@ -1,14 +1,15 @@
#include
#include
#include
-#include
#include
#include
#include
+#include
#include
#include
#include
+#include
#include
#include
#include
@@ -62,7 +63,7 @@ public:
bool markerFileRead_ {false};
- void InitalizeIds();
+ void InitalizeIds();
types::MarkerId NewId();
types::MarkerId lastId_ {0};
};
@@ -70,15 +71,9 @@ public:
class MarkerManager::Impl::MarkerRecord
{
public:
- MarkerRecord(const types::MarkerInfo& info) :
- markerInfo_ {info}
- {
- }
+ MarkerRecord(types::MarkerInfo info) : markerInfo_ {std::move(info)} {}
- const types::MarkerInfo& toMarkerInfo()
- {
- return markerInfo_;
- }
+ const types::MarkerInfo& toMarkerInfo() { return markerInfo_; }
types::MarkerInfo markerInfo_;
@@ -175,7 +170,7 @@ void MarkerManager::Impl::ReadMarkerSettings()
// Determine if marker settings exists
if (std::filesystem::exists(markerSettingsPath_))
{
- markerJson = util::json::ReadJsonFile(markerSettingsPath_);
+ markerJson = scwx::util::json::ReadJsonFile(markerSettingsPath_);
}
if (markerJson != nullptr && markerJson.is_array())
@@ -224,8 +219,8 @@ void MarkerManager::Impl::WriteMarkerSettings()
logger_->info("Saving location marker settings");
const std::shared_lock lock(markerRecordLock_);
- auto markerJson = boost::json::value_from(markerRecords_);
- util::json::WriteJsonFile(markerSettingsPath_, markerJson);
+ auto markerJson = boost::json::value_from(markerRecords_);
+ scwx::util::json::WriteJsonFile(markerSettingsPath_, markerJson);
}
std::shared_ptr
@@ -357,10 +352,11 @@ types::MarkerId MarkerManager::add_marker(const types::MarkerInfo& marker)
types::MarkerId id;
{
const std::unique_lock lock(p->markerRecordLock_);
- id = p->NewId();
+ id = p->NewId();
size_t index = p->markerRecords_.size();
p->idToIndex_.emplace(id, index);
- p->markerRecords_.emplace_back(std::make_shared(marker));
+ p->markerRecords_.emplace_back(
+ std::make_shared(marker));
p->markerRecords_[index]->markerInfo_.id = id;
add_icon(marker.iconName);
@@ -499,7 +495,6 @@ void MarkerManager::set_marker_settings_path(const std::string& path)
p->markerSettingsPath_ = path;
}
-
std::shared_ptr MarkerManager::Instance()
{
static std::weak_ptr markerManagerReference_ {};
diff --git a/scwx-qt/source/scwx/qt/manager/placefile_manager.cpp b/scwx-qt/source/scwx/qt/manager/placefile_manager.cpp
index a6158773..d85f9e40 100644
--- a/scwx-qt/source/scwx/qt/manager/placefile_manager.cpp
+++ b/scwx-qt/source/scwx/qt/manager/placefile_manager.cpp
@@ -2,10 +2,10 @@
#include
#include
#include
-#include
#include
#include
#include
+#include
#include
#include
@@ -385,7 +385,7 @@ void PlacefileManager::Impl::ReadPlacefileSettings()
// Determine if placefile settings exists
if (std::filesystem::exists(placefileSettingsPath_))
{
- placefileJson = util::json::ReadJsonFile(placefileSettingsPath_);
+ placefileJson = scwx::util::json::ReadJsonFile(placefileSettingsPath_);
}
// If placefile settings was successfully read
@@ -428,7 +428,7 @@ void PlacefileManager::Impl::WritePlacefileSettings()
std::shared_lock lock {placefileRecordLock_};
auto placefileJson = boost::json::value_from(placefileRecords_);
- util::json::WriteJsonFile(placefileSettingsPath_, placefileJson);
+ scwx::util::json::WriteJsonFile(placefileSettingsPath_, placefileJson);
}
void PlacefileManager::SetRadarSite(
diff --git a/scwx-qt/source/scwx/qt/manager/settings_manager.cpp b/scwx-qt/source/scwx/qt/manager/settings_manager.cpp
index 5b2e9cbb..a47428bb 100644
--- a/scwx-qt/source/scwx/qt/manager/settings_manager.cpp
+++ b/scwx-qt/source/scwx/qt/manager/settings_manager.cpp
@@ -9,7 +9,7 @@
#include
#include
#include
-#include
+#include
#include
#include
diff --git a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp
index e48ecd48..8aa4c611 100644
--- a/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp
+++ b/scwx-qt/source/scwx/qt/manager/text_event_manager.cpp
@@ -2,28 +2,61 @@
#include
#include
#include
+#include
#include
#include
+#include
+#include
+#include
+#include