Review Request: kconfigxteditor refactor
Giorgos Tsiapaliokas
terietor at gmail.com
Mon Dec 10 16:31:22 UTC 2012
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107394/
-----------------------------------------------------------
(Updated Dec. 10, 2012, 4:31 p.m.)
Review request for Plasma.
Changes
-------
in this patch a new rewrite is introduced.
This time I have combined QDomDocument and QXmlStreamWriter.
Regarding the size of the kconfigxteditor, git diff --stat shows,
7 files changed, 482 insertions(+), 742 deletions(-)
(yes its smaller than the last one).
Also with this rewrite there aren't any issues(except from the strip of the new lines,
but I guess that we can live with that :)
this is the main.xml of the dictionary qml plasmoid
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
<kcfgfile name=""/>
<group name="General">
<entry name="removableDevices" type="Bool">
<label></label>
<default>true</default>
</entry>
<entry name="nonRemovableDevices" type="Bool">
<label></label>
<default>true</default>
</entry>
<entry name="allDevices" type="Bool">
<label></label>
<default>true</default>
</entry>
</group>
</kcfg>
is it ok? Is there something missing?
Description
-------
What has been done in the refactoring
1. replace QXmlStream* with QDom*
2. remove the old replace-by-hand code
3. simplify the code
4. reduce the code
7 files changed, 411 insertions(+), 576 deletions(-)
There is only one issue, kconfigxteditor won't reformat correctly the current namespaces of the XMLs
the above
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
will become this,
<kcfg xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.kde.org/standards/kcfg/1.0" xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
 http://www.kde.org/standards/kcfg/1.0/kcfg.xsd">
the issue is in the newline, by removing by hand with $EDITOR fixes the issue.
Diffs (updated)
-----
plasmate/editors/kconfigxt/kconfigxteditor.h e6cd65e
plasmate/editors/kconfigxt/kconfigxteditor.cpp 6f585fc
plasmate/editors/kconfigxt/kconfigxtreader.h 8e923e9
plasmate/editors/kconfigxt/kconfigxtreader.cpp 21ce6ea
plasmate/editors/kconfigxt/kconfigxtwriter.h d3560cd
plasmate/editors/kconfigxt/kconfigxtwriter.cpp 20d6459
plasmate/mainwindow.cpp ee2666f
Diff: http://git.reviewboard.kde.org/r/107394/diff/
Testing
-------
In the attached image I have modified the main.xml of dictionary and it works.
Thanks,
Giorgos Tsiapaliokas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20121210/c12a512c/attachment.html>
More information about the Plasma-devel
mailing list