Page 1 of 1

Messed up QXW file with many Command Items

Posted: Sat Sep 16, 2017 9:08 pm
by benste
Hi there,
it seems that in my safefile pressing the save button in QLC+ almost always adds a <Command> tag to all script functions.
I only noticed because i added the qxw to my VCS for the other project, but is the QXW supposed to look like this?

Code: Select all

  <Function ID="113" Type="Script" Name="Lied 1 Teil2">
   <Speed FadeIn="0" FadeOut="0" Duration="0"/>
   <Direction>Forward</Direction>
   <RunOrder>Loop</RunOrder>
   <Command>%2F%2Fsetfixture%3A162%20ch%3A0%20val%3A255%20%2F%2F%20Loopback%20Stop%20all%20functions</Command>
   <Command>%2F%2Fwait%3A2ms</Command>
   <Command>%2F%2Fsetfixture%3A162%20ch%3A0%20val%3A0%20%2F%2F%20Loopback%20Stop%20all%20functions</Command>
   <Command></Command>
   <Command>startfunction%3A83%20%2F%2F%20Decke%20Chaser%20gruem</Command>
   <Command>startfunction%3A114%20%2F%2F%20Saeule%20Ping%20Pong%202</Command>
   <Command></Command>
   <Command>startfunction%3A111%20%2F%2F%20Saeule%2050%25</Command>
   <Command>startfunction%3A110%20%2F%2F%20Saeule%20blau</Command>
   <Command></Command>
   <Command>wait%3A10h01s</Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
   <Command></Command>
  </Function>
Could this be some index for an Array which kind of has issues with its bounds?

Re: Messed up QXW file with many Command Items

Posted: Sat Sep 16, 2017 9:34 pm
by janosvitok
Good catch!

Confirmed on latest git.
The problem is that LoadXml calls appendData that adds all commands together with LF appended after each command (including the last).

When writing data back to XML, the string is split again, keeping empty parts (so that empty commands are kept). This however also creates the last empty command.

Re: Messed up QXW file with many Command Items

Posted: Sat Sep 16, 2017 10:20 pm
by janosvitok