Alle 11:26, gioved=EC 12 gennaio 2006, David Faure ha scritto:
> =A0 =A0 if ( NetAccess::synchronousRun( job ... ) ) {
> =A0 =A0 =A0 =A0 =A0...
> =A0 =A0 }


This seems indeed a good solution.

I have seen that the method I described in my last post (busy loop) is used=
in =

the preview plugin for HTML (and maybe other plugins that use KHTML =

internally).

Here is the code from thumbcreator.cpp:

if (!m_html)
{
m_html =3D new KHTMLPart;
connect(m_html, SIGNAL(completed()), SLOT(slotCompleted()));
...
}
KURL url;
url.setPath(path);
m_html->openURL(url);
m_completed =3D false;
startTimer(5000);
while (!m_completed)
kapp->processOneEvent();
QAbstractEventDispatcher::instance()->unregisterTimers(this);

what could be a better solution for this piece of code, also considering th=
at =

processOneEvent is declared obsolete by Trolltech?

I would imagine that KHTMLPart could load a document or open an URL in =

synchronous mode. I tried with the following code (also stripped all =

QObject-related things from the code):

if (!m_html)
{
m_html =3D new KHTMLPart;
...
}
KURL url;
url.setPath( path );

m_html->htmlDocument().setAsync( false );
m_html->openURL( url );

....but it does not work at all.

Bye

Roberto
=

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib=

e <<