[kde-edu]: STEP inertia change

Volodymyr Kuznetsov ks.vladimir at gmail.com
Wed Jun 9 21:27:06 CEST 2010


On Tue, Jun 8, 2010 at 10:48 PM, Jeremy Whiting <jpwhiting at kde.org> wrote:
> On Wed, May 26, 2010 at 9:14 PM, Aditya C.S <aditya.gnu at gmail.com> wrote:
>>
>> The experiments won't break. I have tested it. But if there is any .step
>> files other than the files i have fixed, please send those files to me. I
>> will fix those also. According to my knowledge there is no other files, if
>> suppose it's there send it to me i will fix that aslo
>
> As step has been around for a couple of years, some people likely have their
> own files with inertia in them.  If you could provide a way to convert those
> (via script) or even better read the old format and interpret it in the new
> way (autoconvert old files on open) that would work also.

Yes, I think a way to convert old files should be implemented before
commiting the patch. Forcing users to do the conversion manually would
not be too friendly to them.

Step files already have a version identifier, which is currently set
to "1.0". The best solution would be to:

- Set the version identifier to "1.1" for all new files.
- Check the version identifier before loading the file. It it less
then "1.1" then execute a simple function that will convert file to
"1.1" format before opening.

The conversion function could be implemented by parsing XML to DOM
(using QDomDocument), renaming "intertia" property in appropriate
places and serializing DOM back to a string. Or the same using SAX. Or
using XSLT (it looks like QT can run some XSLT scripts). Whatever is
the easiest to work with :-)


More information about the kde-edu mailing list