From e037bb0621401352988e2f93b3277b7bb83fc33b Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 12 Dec 2023 14:06:47 +0100 Subject: [PATCH] CompilerExplorer: Fix assert The default value was not correctly converted to a QVariant. When a LibraryAspect was de-serialized from the default variant value, it would create q QVariant> which cannot be converted to a Store by Utils::storeFromVariant and would end in an assert therefore. Change-Id: I6f7b14d78793a07f027a6b375bc554941ffb83de Reviewed-by: David Schulz --- src/plugins/compilerexplorer/compilerexploreraspects.cpp | 5 +++++ src/plugins/compilerexplorer/compilerexploreraspects.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.cpp b/src/plugins/compilerexplorer/compilerexploreraspects.cpp index cf02893d770..9ca2fc5ae3c 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.cpp +++ b/src/plugins/compilerexplorer/compilerexploreraspects.cpp @@ -78,6 +78,11 @@ QVariant LibrarySelectionAspect::volatileVariantValue() const return toVariantMap(m_buffer); } +QVariant LibrarySelectionAspect::defaultVariantValue() const +{ + return toVariantMap(defaultValue()); +} + void LibrarySelectionAspect::setVariantValue(const QVariant &value, Announcement howToAnnounce) { QMap map; diff --git a/src/plugins/compilerexplorer/compilerexploreraspects.h b/src/plugins/compilerexplorer/compilerexploreraspects.h index 10a0d9cb818..c89604b7aa1 100644 --- a/src/plugins/compilerexplorer/compilerexploreraspects.h +++ b/src/plugins/compilerexplorer/compilerexploreraspects.h @@ -80,6 +80,7 @@ public: QVariant variantValue() const override; QVariant volatileVariantValue() const override; + QVariant defaultVariantValue() const override; void setVariantValue(const QVariant &value, Announcement howToAnnounce = DoEmit) override;