how to externally trigger konq-e to refresh view

Uli Luckas u.luckas at road.de
Wed Sep 23 14:45:17 CEST 2009


On Wednesday, 23. September 2009, Stefan Strobl wrote:
> Hello
> 
> I just subscribed to the list in the hope you can give me some ideas on
> how to solve my problem.
> 
> First I should mention that I'm using a rather old version of konq-e and
> qt/embedded, mainly because cross-compilation is already working for my
> PPC computer. I'm using konqueror3-embedded-0.2-20040524 with
> qt/embedded-3.3.4.
> 
> What I would like to do is to somehow tell konq-e from another
> application XY to reload its current URL. This is of use if application
> XY generates and stors a html page locally and wants konqueror to
> display/reload it.
> 
> Now, this is how I tried to do it and the problems I ran into:
> I thought I use the Unix system signal SIGUSR2 to do the signaling. In
> the file view.cc in the BrowserView constructor I'm registering my
> "protected: static void sigusr2_handler()" function for SIGUSR2 which is
> generally working so far. From this handler I thought of calling the
> public slot function reload() which is _not_ working because I cannot
> call this non-static function reload() from my static function
> sigusr2_handler(). From sigusr2_handler() I also cannot access "HTMLView
> *m_doc" for the same reason. On the other hand I cannot make
> sigusr2_handler() non-static because sigaction() would complain about
> that. I'm lost here. Why can't I access the data even though I'm in the
> same class?
> 
> Any ideas what I'm doing wrong? Or maybe ideas about a better approach
> to make my application XY cause konq-e to reload its page?
> 
Hi Stefan,
there are a few problems here. 
First and most important, there are strict semantics of what is allowed to be 
done inside a signal handler. Keep in mind, that the signal handler could have 
interupted the main flow of code at any point and must make sure not to cause 
any unexpected modifications to the environment of the interrupted code. 
Please take a look at any unix book and what it tells you about signals.

Second, non static methods need an object (an instance of the class) to 
operate on, static methods, also called "class methods", can be called on the 
class itself. Please take a look at any C++ book and what it tells you about 
classes and objects and the difference thereof.

Qt/Embedded has a mechanism called qcop for inter process communication: 
http://doc.trolltech.com/3.3/qcopchannel.html
You can extend konq-e to listen for a qcop message which could then trigger a 
reload.

Regards,
Uli

-- 

------- ROAD ...the handyPC Company - - -  ) ) )

Uli Luckas
Head of Software Development

ROAD GmbH
Bennigsenstr. 14 | 12159 Berlin | Germany
fon: +49 (30) 230069 - 62 | fax: +49 (30) 230069 - 69
url: www.road.de

Amtsgericht Charlottenburg: HRB 96688 B
Managing director: Hans-Peter Constien


More information about the konq-e mailing list