[PyKDE] Cannot use KUniqueApplication with dcop
Danny Pansters
danny at ricin.com
Fri Aug 25 00:14:38 BST 2006
On Thursday 24 August 2006 09:26, Sebastian Kügler wrote:
> On Thursday 24 August 2006 01:53, Danny Pansters wrote:
> > On Wednesday 23 August 2006 23:58, Sebastian Kügler wrote:
> > > I'm trying to make a KUniqueApplication accessible via dcop, but I'm
> > > getting the following error:
> > >
> > > dcop-testapp: ERROR: Communication problem with dcop-testapp, it
> > > probably crashed.
> > >
> > > If I change KUniqueApplication to KApplication, it works just fine.
> > > Does anyone know what's going on here? How can I debug this further?
> > >
> > > Attached small program illustrates the problem (It's mostly the same as
> > > in my previous post).
> >
> > When I used KUniqueApplication I used somewhat different methods for the
> > appdata than you do, not all mentioned in the API may be supported by
> > py-kde. That may be a lead.
>
> Could you dig those up for me?
Sure, I use this, copy/pasted:
aboutdata = KAboutData(KBTV_UNIQUENAME, KBTV_FANCYNAME, KBTV_VERSION,
KBTV_DESCRIPTION, KAboutData.License_BSD,
KBTV_COPYRIGHT)
aboutdata.addAuthor(KBTV_AUTHOR, "Author and maintainer",
KBTV_AUTHOR_EMAIL)
aboutdata.setBugAddress(KBTV_AUTHOR_EMAIL)
KCmdLineArgs.init(sys.argv, aboutdata)
app = KUniqueApplication(True, True, False)
And later on:
dcopif = KbtvDCOPExObj(mainwindow, KBTV_FANCYNAME)
(mainwindow is a kpart)
All KBTV_* constants are (python) strings, I don't use None anywhere. I know
there's several ways to put together the appdata and remember having to tweak
this when I added dcop (service only), and then decided that it made sense
for a TV app to be a KUniqueApp.
HTH,
Dan
> > But the thing that stands out is that you never show() your mainwindow.
> > It may be implied by KApp but not by KUniqueApp (as this may already have
> > an instance running). Just a thought...
>
> It shouldn't be necessary (the testapp does not really have a mainWindow).
> In my "real application", I'm showing it at a later point (it's a systray
> app), that's where I got the error from. The attached code is just a
> minimal example.
More information about the PyQt
mailing list