[patch] konqi using searchline

David Faure faure at kde.org
Mon Dec 13 08:58:17 GMT 2004


On Sunday 12 December 2004 22:10, Martin Koller wrote:
> On Sunday 12 December 2004 17:53, Datschge wrote:
> > If for better or worse I
> > don't know, it just isn't consistent. ;)
> 
> You're right. So I'm looking into adding it to the dirfilter konq-plugin.
> 
> But I have 2 questions:
> 
> The searchbar plugin does the following in the ctor:
>  //Grab the part manager. Don't know of any other way, and neither does 
> Tronical, so..
>  KParts::PartManager *partMan = 
> static_cast<KParts::PartManager*>(mainWin->child(0, "KParts::PartManager"));
>  if (partMan)
>  {
>   connect(partMan, SIGNAL(activePartChanged(KParts::Part*)),
>                    SLOT  (partChanged      (KParts::Part*)));
>   partChanged(partMan->activePart());
> I thought I need that too, and added it, but the partMan pointer is always 
> 0 ...

Hmm, but why didn't tronical suggest to do the right thing instead? :)

> So how can the plugin get triggered when the part is activated ?

I would install an event filter on the part, and look for events of type KParts::GUIActivateEvent.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list