Re: Preferences dialog: Not implementing options without hacks

From: Christian Neumair (chris_at_gnome-de.org)
Date: Fri Apr 09 2004 - 14:36:03 EDT

  • Next message: Tomas Frydrych: "commit (head): revisions"

    On Fri, 2004-04-09 at 20:50 +1000, msevior_at_physics.unimelb.edu.au wrote:
    > >
    > > I'm currently re-polishing the UNIX preferences dialog and stumbled
    > > across the following problem:
    > > I need a getter/setter for each setting although I don't have a widget
    > > associated with it, e.g. the toolbar show/hiding is controlled via the
    > > view menu, so I don't need any prefs UI for that. I don't want to
    > > implement dummy getters/setters that return the prefs from the
    > > cross-platform backend, because I consider it hacky to return something
    > > to the cross-platform code I received from the cross-platform code
    > > inside platform-specific code. I don't know much about CPP encapsulation
    > > but wouldn't it be possible to have cross-platform getters/setters that
    > > can be overridden by platform-specific code, but don't have to. This
    > > would simplify my task a lot.
    > >
    >
    > Yes. Just declare the getter/setters virtual in the xp code then the
    > virtual getter/setters in the platform code will overide them in Unix
    > while leaving them OK for the other platforms.
    >
    > You'll only need to change the getter/setters in xp and unix this way too.

    All the setters/getters are already virtual in the XP code. When not
    implementing but declaring them, I get the following error during
    linking:
    ../../../../src/wp/ap/libAp.a(ap_UnixDialog_Options.o)(.gnu.linkonce.r._ZTV21AP_UnixDialog_Options+0x58): undefined reference to `AP_UnixDialog_Options::_gatherSpellInternet()'
    ../../../../src/wp/ap/libAp.a(ap_UnixDialog_Options.o)(.gnu.linkonce.r._ZTV21AP_UnixDialog_Options+0x5c): undefined reference to `AP_UnixDialog_Options::_setSpellInternet(bool)'

    Murray told me on IRC that they are "pure" virtual functions and need to
    be implemented in derived classes. Can't we unpurify them? Looks like
    this would involve implementing all XP pref getters/setters in XP, if
    I'm not taken wrong.

    regs,
     Chris



    This archive was generated by hypermail 2.1.4 : Fri Apr 09 2004 - 14:38:04 EDT