[PyKDE] PyKDE: bug with KRecentFilesAction?

Jim Bublitz jbublitz at nwinternet.com
Fri Jul 7 21:25:28 BST 2006


On Friday 07 July 2006 12:06, Serge Weinstock wrote:
> Is there a bug with KRecentFilesAction?
>
> I'm creating a KRecentFilesAction like this:
>
> class MyMainWindow(KMainWindow)
>     ...
>     def initActions(self):
>        ...
>        self.openRecentFilesAction = KRecentFilesAction(i18n("Open
> &Recent File"), KShortcut(),
>             self.openURL, acts, "openRecentFilesAction")
>
>        ...
>
>     def openURL(self, url):
>        ...
>
> When I select an entry in the recent file list, I got a:
>
> TypeError: openURL() takes exactly 2 arguments (1 given)
>
> The documentation says that the slot signature should be
> urlSelected(const KURL &)
>
> I get the same if I do a:
>         self.connect(self.openRecentFilesAction,
> SIGNAL("urlSelected(const KURL &)"), self.openURL)
>
>
> Is it a bug or have I done something wrong?


It looks like a bug. The PyKDE code all looks correct, as does your code and 
the sip-generated C++ code, so unless I've overlooked something, it appears 
sip isn't handling the signal correctly or there's a bug in KDE itself.

I don't think it'll make a difference, but could you try changing the slot 
name to something different, like open_URL - there are KDE methods with that 
name (openURL), but they're in different classes, so there shouldn't be a 
name clash, but there shouldn't be a bug either.

It would help if you could post a short but complete program that fails this 
way so either Phil or I can look into this further.

Jim




More information about the PyQt mailing list