From 9934537e19c7ce6f9bf926cc8abba023297b0a40 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Thu, 19 Jan 2023 09:46:35 +0200 Subject: feat: add debug printing for Version Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com> --- launcher/Version.cpp | 18 ++++++++++++++++++ launcher/Version.h | 7 +++++++ 2 files changed, 25 insertions(+) (limited to 'launcher') diff --git a/launcher/Version.cpp b/launcher/Version.cpp index 9fdd955b..2129ebfd 100644 --- a/launcher/Version.cpp +++ b/launcher/Version.cpp @@ -1,5 +1,6 @@ #include "Version.h" +#include #include #include #include @@ -93,3 +94,20 @@ void Version::parse() m_sections.append(Section(currentSection)); } } + + +/// qDebug print support for the BlockedMod struct +QDebug operator<<(QDebug debug, const Version& v) +{ + QDebugStateSaver saver(debug); + + debug.nospace() << "Version{ string: " << v.toString() << ", sections: [ "; + + for (auto s : v.m_sections) { + debug.nospace() << s.m_fullString << ", "; + } + + debug.nospace() << " ]" << " }"; + + return debug; +} \ No newline at end of file diff --git a/launcher/Version.h b/launcher/Version.h index aceb7a07..c0927374 100644 --- a/launcher/Version.h +++ b/launcher/Version.h @@ -35,6 +35,7 @@ #pragma once +#include #include #include #include @@ -59,6 +60,8 @@ public: return m_string; } + friend QDebug operator<<(QDebug debug, const Version& v); + private: QString m_string; struct Section @@ -143,7 +146,11 @@ private: } } }; + + QList
m_sections; void parse(); }; + + -- cgit