[mythtv] r9246 mythgallery patch

Mark Spieth mark at dclabs.com.au
Sat Apr 8 04:09:38 UTC 2006


the problem is that there is no default constructor for ConfigurationGroup and since there is only 1 copy shared between 2 subclasses, the compiler gets confused and cant do it and thus always called the default constructor with now no longer exists. in this case the first param would have been inited incorrectly.
the solution is to explicitly instantiate the ConfigurationGroup in the class in question.
there may be better ways but at least the new structure captures the problem.
Im surprised the compiler doesnt catch the issue in settings.h

cheers
mark

appologies for inline patch but it highlights polymorphism limitations.
working patch is
--- gallerysettings.cpp (revision 9647)
+++ gallerysettings.cpp (working copy)
 @@ -149,11 +149,13 @@
     return gc;
 };
 
-class GalleryConfigurationGroup: public VerticalConfigurationGroup,
+class GalleryConfigurationGroup: virtual public ConfigurationGroup,
+                                 public VerticalConfigurationGroup,
                                  public TriggeredConfigurationGroup {
 public:
 
     GalleryConfigurationGroup():
+        ConfigurationGroup(false,true,false,false),
         VerticalConfigurationGroup(false),
         TriggeredConfigurationGroup(false) {
         setLabel(QObject::tr("MythGallery Settings"));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-dev/attachments/20060408/86fd02c9/attachment.htm 


More information about the mythtv-dev mailing list