diff options
author | Marco Bubke <marco.bubke@qt.io> | 2022-05-16 15:10:38 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2022-05-25 09:24:29 +0000 |
commit | 2d0ce5a450e30596c1c21fdd1538cb3986a92d6d (patch) | |
tree | 1533aaf3cef3d090e712dba75b5602fc69e7154a | |
parent | 2b12b1fa5e32605028ca84c4aab169b17f9ad9cd (diff) |
QmlDesigner: Improve printing of project storage types
Change-Id: Icb2f59c334cc597544899887e4fc98896d62decc
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r-- | src/plugins/qmldesigner/designercore/projectstorage/projectstorageprinting.h | 43 |
1 files 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 <utils/smallstringio.h> +namespace QmlDesigner { + +template<auto Type, typename InternalIntergerType = long long> +inline QDebug operator<<(QDebug debug, BasicId<Type, InternalIntergerType> 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; } |