From cd9d6f5c6fa81ae807a1bb0e4b317484bb2529f8 Mon Sep 17 00:00:00 2001 From: Sven Eberhardt Date: Sun, 16 Oct 2016 01:15:38 -0400 Subject: [PATCH] Editor: Show full path name in sound delegate display string --- src/editor/C4ConsoleQtPropListViewer.cpp | 7 +++++++ src/editor/C4ConsoleQtPropListViewer.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/editor/C4ConsoleQtPropListViewer.cpp b/src/editor/C4ConsoleQtPropListViewer.cpp index 53bbde344..4b9c4ea85 100644 --- a/src/editor/C4ConsoleQtPropListViewer.cpp +++ b/src/editor/C4ConsoleQtPropListViewer.cpp @@ -1832,6 +1832,13 @@ C4PropertyDelegateSound::C4PropertyDelegateSound(const C4PropertyDelegateFactory } } +QString C4PropertyDelegateSound::GetDisplayString(const C4Value &v, class C4Object *obj, bool short_names) const +{ + // Always show full sound name + C4String *val_string = v.getStr(); + return val_string ? QString(val_string->GetCStr()) : QString(v.GetDataString().getData()); +} + bool C4PropertyDelegateSound::IsPasteValid(const C4Value &val) const { // Must be nil or a string diff --git a/src/editor/C4ConsoleQtPropListViewer.h b/src/editor/C4ConsoleQtPropListViewer.h index 0bd113949..f5afb93a2 100644 --- a/src/editor/C4ConsoleQtPropListViewer.h +++ b/src/editor/C4ConsoleQtPropListViewer.h @@ -446,6 +446,7 @@ class C4PropertyDelegateSound : public C4PropertyDelegateEnum { public: C4PropertyDelegateSound(const C4PropertyDelegateFactory *factory, C4PropList *props); + QString GetDisplayString(const C4Value &v, class C4Object *obj, bool short_names) const override; bool IsPasteValid(const C4Value &val) const override; protected: C4StyledItemDelegateWithButton::ButtonType GetOptionComboBoxButtonType() const override { return C4StyledItemDelegateWithButton::BT_PlaySound; }