MetaEngine::save() is re-implemented in DMetadata without to use virtual property.

Gilles Caulier caulier.gilles at gmail.com
Fri Nov 13 15:16:16 GMT 2020


A partial response can be found here :

https://stackoverflow.com/questions/1853896/is-it-possible-to-override-a-non-virtual-method

This is typically possible but highly not recommended and not portable
everywhere... as i understand...

Gilles

Le ven. 13 nov. 2020 à 16:11, Gilles Caulier

<caulier.gilles at gmail.com> a écrit :
>
> And it's the same for MetaEngine::applyChanges() ....
>
> Gilles
>
> Le ven. 13 nov. 2020 à 16:10, Gilles Caulier
> <caulier.gilles at gmail.com> a écrit :
> >
> > Hi, all,
> >
> > I currently review all Clazy static analyzer reports, and i plan to
> > merge DMetadata class to MetaEngine.
> >
> > While reviewing the code I discovered that MetadaEngine::save() is
> > implemented into DMetadata without being declared as virtual.
> >
> > I'm surprised to not see a G++ warning about this code, which can
> > introduce side effects... Look by yourself :
> >
> > https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/metadataengine/engine/metaengine.h#L372
> >
> > https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/metadataengine/dmetadata/dmetadata.h#L95
> >
> > How is it technically possible ?
> >
> > Best
> >
> > Gilles Caulier


More information about the Digikam-devel mailing list