Menu

Report XML file under source control

scdevelop
2017-05-02
2017-05-02
  • scdevelop

    scdevelop - 2017-05-02

    Each time you open your report in designer and save it back there is no guarantee that the new XML file will be similar to the original, even if you did not make any changes at all.
    When you work with source control and make small changes like adding a field or so, it is not very useful if you "diff" the files and see that all lines were changed. Rather misleading.
    The problem is that the attributes of each element are ordered in a non-deterministic fashion when saving the XML (blame QDomDocument::save and QDomElement::attributes for that).
    My solution to this problem was to create a custom saving function (using QXmlStreamWriter) which writes the attributes in alphabetical order. This way you can open, make some changes, save back and the difference will be just what you changed, no more than that.
    If users are interested I can publish this update for merging.

     
    • aliks-os

      aliks-os - 2017-05-03

      yes, you are right, such changes are presents each time. Nobody from users ask me to fix it - you are the first.

      Publish this update and we will test it. If something will be wrong, we always can revert


      От: scdevelop scdevelop@users.sf.net
      Отправлено: 3 мая 2017 г. 1:42
      Кому: [qtrpt:discussion]
      Тема: [qtrpt:discussion] Report XML file under source control

      Each time you open your report in designer and save it back there is no guarantee that the new XML file will be similar to the original, even if you did not make any changes at all.
      When you work with source control and make small changes like adding a field or so, it is not very useful if you "diff" the files and see that all lines were changed. Rather misleading.
      The problem is that the attributes of each element are ordered in a non-deterministic fashion when saving the XML (blame QDomDocument::save and QDomElement::attributes for that).
      My solution to this problem was to create a custom saving function (using QXmlStreamWriter) which writes the attributes in alphabetical order. This way you can open, make some changes, save back and the difference will be just what you changed, no more than that.
      If users are interested I can publish this update for merging.


      Report XML file under source controlhttps://sourceforge.net/p/qtrpt/discussion/general/thread/8dc84038/?limit=25#0645


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/qtrpt/discussion/general/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

Log in to post a comment.

MongoDB Logo MongoDB