Version: 0.9.2 (using KDE 4.3.2) OS: Linux Installed from: Ubuntu Packages Putting more than one synonym to a word doesn work properly. The kvtml file confuses synonym (and other word aspects) relations. Reading the kvtml file after saving a word list with multiple synonym (or other word aspects) relations, delivered this result. It seems, that the programm isnt aible to make more than two pairs, as this is the modus of saving synonym (a.o.) relations between several words. Please analyse a save file (kvtml) with regard of the part "synonyms".
I used Parley for learning latin (ca. 1500 words, file-size: 1,5 MB). All in all I found out 8 bugs. The descripted one seems to be the most seriously. I also have a wishlist with a few items, but Im not fond of translating them all into english, because Im german. If theres interest, I can send an email.
I added a patch for checking synonyms in a transitive way. This bug here only occurs if we introduce a circular connection between synonyms. Using transitivity we can avoid it. Not a patch but at least something that works until this is fixed. See bug #228708
Created attachment 42339 [details] Fixes destructive writing of synonyms in parley Parley lost synonyms slowly if more than one synonym was saved for an entry. This patch fixes the bug by correctly saving synonym pairs.
I just tested your patch and noticed that it isn't working correctly. When saving three entries which are all connected, the following is written: <pair> <entry id="2"> <translation id="0"/> </entry> </pair> <pair> <entry id="1"> <translation id="0"/> </entry> <entry id="3"> <translation id="0"/> </entry> </pair> <pair> <entry id="2"> <translation id="0"/> </entry> <entry id="3"> <translation id="0"/> </entry> </pair> One of the pairs only contains one entry, which is then marked as a synonym of the entry with the id 0. IIRC, more or less the same happened when I tried to verify this bug in the first place, so I'm not sure what went wrong here. I must also admit that I haven't really looked at the kvtml saving code so I don't really understand how this code works. It would be great if you could have a look at the patch again.
Can you attach the kvtml file? I had the same problem once because I forgot to link parley against the new libkdeedu as the patch is for that library. So maybe make sure that you link against the correct libkdeedu. I will have a look at the patch once I get you kvtml file as I can reproduce it here with my patched version with which saves are done correctly.
Oh, sorry, I take back everything I've said... I shouldn't have trusted Creator to correctly rebuild and link the library. ;) Your patch works fine and since you now have an SVN account, you can go ahead and commit it to trunk and backport it to branches/KDE/4.4. If you have any questions, feel free to ping me.
SVN commit 1113642 by schleinzer: Removed unnecessary checks while writing kvtml files and made sure that pairs always have two entries BUG: 212306 M +19 -20 keduvockvtml2writer.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1113642