diff --git a/README.md b/README.md index e0e99f9..f0249df 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Card Collection Manager 3 -[![SonarCloud Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=sebastiandine_Card-Collection-Manager-3&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=sebastiandine_Card-Collection-Manager-3) +[![SonarQube Cloud](https://sonarcloud.io/images/project_badges/sonarcloud-dark.svg)](https://sonarcloud.io/summary/new_code?id=sebastiandine_Card-Collection-Manager-3) Card Collection Manager 3 is an extensible desktop application for managing trading card game collections. It is designed as a practical way to track cards and manage per-card images for large collections, with local per-game data, set synchronization workflows, and a desktop-first UX. The app preserves the established JSON layout from earlier CCM versions so existing collections stay compatible. diff --git a/ui_wx/src/SvgIcons.cpp b/ui_wx/src/SvgIcons.cpp index e16dcf7..95d7d3d 100644 --- a/ui_wx/src/SvgIcons.cpp +++ b/ui_wx/src/SvgIcons.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include @@ -68,12 +67,14 @@ namespace { // Substitute every "@FILL@" occurrence in `tmpl` with `fill`. std::string applyFill(const char* tmpl, const char* fill) { - std::string s(tmpl); + std::string s = tmpl != nullptr ? tmpl : ""; constexpr std::string_view kPlaceholder = "@FILL@"; + const std::string_view fillView = fill != nullptr ? std::string_view(fill) + : std::string_view{}; for (std::string::size_type pos = s.find(kPlaceholder); pos != std::string::npos; - pos = s.find(kPlaceholder, pos + std::strlen(fill))) { - s.replace(pos, kPlaceholder.size(), fill); + pos = s.find(kPlaceholder, pos + fillView.size())) { + s.replace(pos, kPlaceholder.size(), fillView); } return s; }