Problems with KFilterDev::deviceForFile method in a KF5 based application

Arnold Dumas contact at
Sat Aug 9 18:13:40 UTC 2014

Le 09/08/2014 10:47, David Faure a écrit :
> On Sunday 27 July 2014 20:22:14 Arnold Dumas wrote:
>> I've tried to replace this by:
>> QScopedPointer<QIODevice> device(new KFilterDev(file));
>> but it still only load gziped files and not plain-text ones.
> This is surprising because this case is unittested and works.
> KFilterTest::test_block_read ends with
> test_block_read(pathnone);
> which calls
> KFilterDev dev(fileName);
> on a plain-text file, and reads from it.
> Did you debug it a little further? What happens when trying to load a 
> plain-
> text file? Wrong size? Garbage data? ... ?
> I added a new unittest for a larger read in one go (readAll), in case 
> it's an
> issue that only occurs with larger data (like we found in 9d04e4186f13,
> in the case of writing without compression), but that test passes 
> too...

First thanks for your input David. Well I know the problem is really 

When I load a plain-text file, the parser begins its job correctly, but 
then a line isn't properly retrieved from the file.
So the parser ends in a "Error" state. I've also noticed that the faulty 
line is always the last. In fact, the parser tries to load a line that 
doesn't exist.

Could this be related to EOF encoding or something related?

Arnold Dumas

More information about the Kde-frameworks-devel mailing list