2 DCOP interfaces for one application

Simon Hausmann hausmann at kde.org
Thu Jan 29 15:25:34 GMT 2004


On Thursday 29 January 2004 16:18, Andras Mantia wrote:
> Hi,
>
>  How can I create two DCOP interfaces for the same application? I've tried
> the following:
>
> class DCOPWindowManagerIf : virtual public DCOPObject
> {
>   K_DCOP
>
>   k_dcop:
>
>   virtual int currentEditorIfNum() const = 0;
>   ...
> };
>
>
> class DCOPSettingsIf : virtual public DCOPObject
> {
>   K_DCOP
>
>   k_dcop:
>
>   virtual QString encoding() const = 0;
>   ...
> };
>
> class QuantaApp : public KDockMainWindow, virtual public
> DCOPWindowManagerIf, virtual public DCOPSettingsIf
> {
>  ..
> }
>
> QuantaApp::QuantaApp() : KDockMainWindow(0L,"Quanta"),
> DCOPObject("WindowManagerIf"), DCOPObject("SettingsIf")
> {
> }
>
> But as soon as I add the "virtual public DCOPSettingsIf", I get the
> following compilation error:
>
> quanta/src/quanta.h:105: error: no
>    unique final overrider for `virtual bool DCOPObject::process(const
>    QCString&, const QByteArray&, QCString&, QByteArray&)' in `QuantaApp'
> /quanta/src/quanta.h:105: error: no
>    unique final overrider for `virtual QCStringList
> DCOPObject::interfaces()' in `QuantaApp'
> /quanta/src/quanta.h:105: error: no
>    unique final overrider for `virtual QCStringList
> DCOPObject::functions()' in
>    `QuantaApp'
> /quanta/src/quanta.h:105: error: no
>    unique final overrider for `virtual bool DCOPObject::process(const
>    QCString&, const QByteArray&, QCString&, QByteArray&)' in `QuantaApp'
> /quanta/src/quanta.h:105: error: no
>    unique final overrider for `virtual QCStringList
> DCOPObject::interfaces()' in `QuantaApp'
> /quanta/src/quanta.h:105: error: no
>    unique final overrider for `virtual QCStringList
> DCOPObject::functions()' in
>    `QuantaApp'
>
>
> I've been looking at the tutorials, help, but couldn't find anything. In
> sources there is some place where it's done, but couldn't figure out how
> should I do it simply and in an elegant way.
> Can someone help me?

Without trying it actually mself but just from looking at it I'd guess that 
you should be able to get rid of the ambiguouties by not using virtual 
inheritance. It seems unnecessary to me anyway, in this case. Might be I'm 
missing something though.

Simon




More information about the kde-core-devel mailing list