Ticket #4863: libs_libmyth_managedlist-fix-getValue-inheritance-override.patch

File libs_libmyth_managedlist-fix-getValue-inheritance-override.patch, 945 bytes (added by Erik Hovland <erik@…>, 16 years ago)

fixes the signature of ManagedListSetting::getValue() so it matches Setting::getValue. Note that it includes a casting away of const. I did this instead of mutable (in the Setting class) because it takes a lot less code change to get the effect. If mutable is required, let me know

  • libs/libmyth/managedlist.h

    The member function getValue does hot override the parent class's implemention
    
    From: Erik Hovland <erik@hovland.org>
    
    because it does not preserve the const-ness of the parent's implementation.
    ---
    
     libs/libmyth/managedlist.h |    5 +++--
     1 files changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/libs/libmyth/managedlist.h b/libs/libmyth/managedlist.h
    index e3e29f9..e91104d 100644
    a b class MPUBLIC ManagedListSetting : public Setting, public SimpleDBStorage 
    464464            }
    465465        }
    466466
    467         virtual const QString getValue() {
     467        virtual QString getValue() const {
    468468            if (listItem)
    469469            {
    470                 syncDBFromItem();
     470                ManagedListSetting* th = const_cast<ManagedListSetting*>(this);
     471                th->syncDBFromItem();
    471472                return listItem->getValue();
    472473            }
    473474            else