[Eric] Eric helpviewer

Florian Bruhin me at the-compiler.org
Fri Feb 21 06:49:06 GMT 2014


Hey Detlev and rest of the list,

* Detlev Offenbach <detlev at die-offenbachs.de> [2014-02-19 19:03:48 +0100]:
> If you find and fix issues in my code I would be happy to receive the fix for 
> inclusion in eric.

I think I just found something: in Helpviewer/Network/NetworkReply.py
you emit the finished signal as soon as there are no bytes to read
anymore. However, the documentation[1] says:

   This signal is emitted when the reply has finished processing.
   After this signal is emitted, there will be no more updates to the
   reply's data or metadata.

So as far as I understand, this should be emitted immediately in
__init__ (I did it after readyRead), as the data is immediately ready.

When I implemented it like you did, small replies (like 128 bytes)
never got loaded, because Qt probably waited for some more bytes
before starting to read.

[1] http://qt-project.org/doc/qt-4.8/qnetworkreply.html#finished


Speaking about signals, I see a lot of this in eric code:

    QTimer.singleShot(0, lambda: self.finished.emit())

Why is that? I haven't seen this anywhere else. I understand it emits
the signals (and calls the slots) in the Qt mainloop rather than
immediately, but what's the rationale for that?

Florian

-- 
() ascii ribbon campaign - stop html mail    www.asciiribbon.org
/\ www.the-compiler.org  | I love long mails http://email.is-not-s.ms/
What does "it" mean in the sentence "What time is it?"? 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/eric/attachments/20140221/82c2b179/attachment.pgp>


More information about the Eric mailing list