[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Using khtml_part and meta refresh headers
From:       David Faure <faure () kde ! org>
Date:       2004-12-22 18:45:21
Message-ID: 200412221945.21846.faure () kde ! org
[Download RAW message or body]

On Wednesday 22 December 2004 12:28, John Morton wrote:
> I've put together a simple web browser screensaver thing, using the kdevelop 
> kscreensaver templates and the example code in the khtml_part documentation. 
> It works reasonably well, with such things as javascript support running 
> nicely, but for some reason setting metaRefreshEnabled doesn't seem to do 
> anything. Is there something special I'm supposed to do, or is it just broken 
> in kde 3.2.3, debian/testing? 
> 
> Here's the body of the screen saver's blank method, which does the actual 
> work:
> 
> void chance::blank()
> {
>     setBackgroundColor( QColor(black)  );
>     erase();
>     
>     KHTMLPart *doc = new KHTMLPart(this, "khtml_window");
Each call to blank() creates a new KHTMLPart? If blank() is called more than once
that's a memory "leak".  [disclaimer: I don't know the kscreensaver stuff]

>     doc->setMetaRefreshEnabled(useMetaRefresh);
Which is true I assume?

>     doc->openURL(url);
>     doc->view()->resize(width(), height());
And then... nothing connects to the completed() signal, right? You just
let the webpage load, being directly visible on the screen (unlike e.g.
the kwebdesktop mechanism of making a pixmap from it)

In that case I don't see why meta-refresh wouldn't work... KHTMLPart 
schedules a redirection and follows it when the timer expires.
In doubt check the debug output from khtmlpart (area 6050), it tells when 
a redirection is scheduled and when it happens.

>     doc->show();
This compiles? :)
I guess you mean doc->view()->show();

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic