2015-05-17 0:45 GMT+02:00 Uwe Stöhr :

> Am 16.05.2015 um 11:27 schrieb Juergen Spitzmueller:
>
>  commit bec3f7bc8c3add410014f3ac0315b3189b6b411a
>>
>
> Dear Jürgen,
>
> I appreciate your coding skills but with commits like that you degrade me
> to a third class coder. It seems that it is OK that I provide some ideas
> and you do it "right".
>

This is how collaboaratve coding works, Uwe. Observe how often my
contributions are improved by others. This does not imply that I am a thir
class coder (although I most certainly am), but it rather improves LyX's
code quality and coherence. For my art, I am grateful for that.



> I tested my patch thoroughly and it worked well. If you find a bug you can
> mail me to give me chance to fix it. I mean, how should I learn something
> when I don't have a chance?
> I am open to learn how to code better but if nobody explains me why e.g.
> your code is now better than mine how should I do it better the next time?
>
> What is the advantage of your code compared to mine?


One of the greatest advantages of Qt is that it provides view/data
separation. This means that for combo boxes (as in your code), you can add
to the combo box a localized string to display _and_ a styble value, i.e.

combo->addItem(qt_("Brown"), "brown")

will display "Brown" or "Braun" or whatever the localized version is, but
will return "brown" in all cases. Observe that "brown" happens to be the
LaTeXName of the color.

The advantage is that you do not have to fiddle with comparing localized
strings or count values. Both methods are fragile (and, in the case of
count values, you need to use unnecessary tests, since the count values
change when you add a new item to the combo, whereas the value stays
stable, no matter what you do with the combo.

Note further that we use this view/data separation all over the place in
LyX's frontend, also in the Box dialog, so your code was, in that sense, a
step back from the standard.



> I can even not compile yours:
>
>   ..\..\..\..\src\frontends\qt4\GuiBox.cpp(175): error C2899: The typename
> cannot be used outside of a template declaration
> [D:\LyXGit\Master\compile-result\src\frontends\qt4\frontend_qt.vcxproj]
>

I am sorry for that. It compiled on Linux.


> My code did exactly what it should why is there a need to refactor it
> without speaking with me. You added FIXMEs without asking that is not fair.
> These are no fixmes, it was my intention to use the LaTeX names.
>

I was not aware that we are supposed to ask before adding FIXMEs. Note that
FIXMEs are not accusations, should you have read it like such.


>
> I posted the patch to the list and you were active during that day on the
> list. So I can assume that you have seen my patch and could have shout.
>

I did not have time to review back then.

Jürgen



>
> regards Uwe
>

Reply via email to