Make it possible to use QXmlStreamReader to read a KNS registry file
ClosedPublic

Authored by apol on Jun 2 2017, 2:50 PM.

Details

Summary

It's more efficient, especially in memory

Test Plan

tests pass, discover kns test passes, discover works

Diff Detail

Repository
R304 KNewStuff
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
apol created this revision.Jun 2 2017, 2:50 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJun 2 2017, 2:50 PM
dfaure added a subscriber: dfaure.Jun 3 2017, 9:43 AM
dfaure added inline comments.
src/core/entryinternal.cpp
443

missing spaces around ==

446

same

450

same

527

Did you test parsing a file with <!-- ... --> comments here and there? Just to make sure the code handles this correctly and doesn't assert.

src/core/entryinternal.h
391

"@deprecated since 5.36, use setEntryXML(QXmlStreamReader&) instead"

apol updated this revision to Diff 15172.Jun 5 2017, 12:52 PM

Adds test, better parsing when there's comments, addresses comments by dfaure

apol updated this revision to Diff 15176.Jun 5 2017, 2:11 PM

More testing, fix issues

leinir added a subscriber: leinir.Jun 6 2017, 10:31 AM

On a similar note to handling comments, how does it now handle unknown/garbage tags? While it won't affect the cache code, it would potentially affect other things (ocs is not guaranteed to be perfectly formed, and it's one of the ways the framework's retained backwards compatibility). From what i can tell, this would assert when an unknown tag is encountered, right?

apol added a comment.Jun 6 2017, 11:43 AM

On a similar note to handling comments, how does it now handle unknown/garbage tags? While it won't affect the cache code, it would potentially affect other things (ocs is not guaranteed to be perfectly formed, and it's one of the ways the framework's retained backwards compatibility). From what i can tell, this would assert when an unknown tag is encountered, right?

This is for .knsregistry files, not OCS. These files are generated by the very same class here.

leinir accepted this revision.Jun 6 2017, 12:05 PM
In D6067#114528, @apol wrote:

On a similar note to handling comments, how does it now handle unknown/garbage tags? While it won't affect the cache code, it would potentially affect other things (ocs is not guaranteed to be perfectly formed, and it's one of the ways the framework's retained backwards compatibility). From what i can tell, this would assert when an unknown tag is encountered, right?

This is for .knsregistry files, not OCS. These files are generated by the very same class here.

You are quite right, i forgot the attica content's not parsed using knscore's functions, just the staticxml provider... because i'm a silly person :) Obviously just fine, then, go for it!

This revision is now accepted and ready to land.Jun 6 2017, 12:05 PM
This revision was automatically updated to reflect the committed changes.