From 2d0ce5a450e30596c1c21fdd1538cb3986a92d6d Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 16 May 2022 15:10:38 +0200 Subject: QmlDesigner: Improve printing of project storage types Change-Id: Icb2f59c334cc597544899887e4fc98896d62decc Reviewed-by: Thomas Hartmann --- .../projectstorage/projectstorageprinting.h | 43 +++++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageprinting.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageprinting.h index 2e8b29918d..7bc1b1074a 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstorageprinting.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstorageprinting.h @@ -29,32 +29,63 @@ #include +namespace QmlDesigner { + +template +inline QDebug operator<<(QDebug debug, BasicId id) +{ + debug.noquote() << "(" << id.id << ")"; + + return debug; +} + +} // namespace QmlDesigner + namespace QmlDesigner::Storage { -inline QDebug &operator<<(QDebug debug, const Version &version) +inline QDebug operator<<(QDebug debug, const Version &version) { debug.noquote() << "(" << version.major.value << ", " << version.minor.value << ")"; return debug; } -inline QDebug &operator<<(QDebug debug, const ExportedType &type) +inline QDebug operator<<(QDebug debug, const Import &import) +{ + debug.noquote() << "(" << import.moduleId << ", " << import.sourceId << ", " << import.version + << ")"; + + return debug; +} + +inline QDebug operator<<(QDebug debug, const ExportedType &type) { debug.noquote() << "(" << type.name << ", " << type.version << ")"; return debug; } -inline QDebug &operator<<(QDebug debug, const Type &type) +inline QDebug operator<<(QDebug debug, const QualifiedImportedType &type) +{ + return debug.noquote() << "(" << type.name << ", " << type.import << ")"; +} + +inline QDebug operator<<(QDebug debug, const ImportedType &type) +{ + return debug.noquote() << "(" << type.name << ")"; +} + +inline QDebug operator<<(QDebug debug, const ImportedTypeName &importedTypeName) { - debug.noquote() << "(" << type.typeName << ", " << type.exportedTypes << ")"; + std::visit([&](auto &&type) { debug << type; }, importedTypeName); return debug; } -inline QDebug &operator<<(QDebug debug, const ImportedTypeName &importedTypeName) +inline QDebug operator<<(QDebug debug, const Type &type) { - std::visit([&](auto &&type) { debug.noquote() << "(" << type.name << ")"; }, importedTypeName); + debug.noquote() << "(" << type.typeName << ", " << type.prototype << ", " << type.exportedTypes + << ")"; return debug; } -- cgit v1.2.1