← Back to team overview

kicad-developers team mailing list archive

Re: PATCH: fix strange string concatenation in component_tree_search_container.cpp

 

Hi,
I have updated Cirilo's patch to make sure the _("Unit") is a
translated string (so apply this patch instead).

Also, don't use a #define that spills the global namespace, use a
local constant for COLUMN_DESCR_POS, and give a reasonable default
explained in the comment.

Commit message:
* Fix string concatenation for _("Unit") + wxT(" "). This failed
  compiling on some platforms (thanks Cirilo Bernardo ).
* Base the indentation on a measured observation with explanation
   (98%-ile of name-length found in library). The previously chosen 24
   character indentation was too wide for most.
* Don't use a #define spilling into the global namespace, but use
  a locally defined constant for COLUMN_DESCR_POS.

View here:
https://github.com/hzeller/kicad/compare/master...fix-string-concat

Download here:
https://github.com/hzeller/kicad/compare/master...fix-string-concat.diff

-h

On 22 February 2014 17:25, Henner Zeller <h.zeller@xxxxxxx> wrote:
> On 22 February 2014 17:18, Henner Zeller <h.zeller@xxxxxxx> wrote:
>> On 22 February 2014 17:13, Henner Zeller <h.zeller@xxxxxxx> wrote:
>>> Looks like jp already changd that part by using _("Unit "); though I
>>> am not sure if the space should be part of the translated text.
>>
>> Ah, no, wait, his patch actually broke the build, and Cirilo's patch fixes it.
>
> But this patch actually doesn't make 'Unit' a translated thing.
> I'll send an updated patch that does that (and some other smallish cleanup).
>
> -h
>
>>
>>>
>>> On 22 February 2014 15:21, Wayne Stambaugh <stambaughw@xxxxxxxxxxx> wrote:
>>>> On 2/22/2014 4:55 PM, Cirilo Bernardo wrote:
>>>>> In the last commit there was a strange string concatenation which
>>>>> would not build on my machine:
>>>>>
>>>>> _("Unit") + wxT( " " ) + unitName
>>>>>
>>>>>
>>>>> This patch breaks the operation into 2 steps, first defining the
>>>>> wxString "Unit " and concatenating the name.
>>>>>
>>>>> - Cirilo
>>>>>
>>>>
>>>> Cirilo,
>>>>
>>>> Are you building with wxWidgets 2.8?  I'll commit this patch but I need
>>>> a little more substance for the commit message.
>>>>
>>>> Thanks,
>>>>
>>>> Wayne
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>> More help   : https://help.launchpad.net/ListHelp


Follow ups

References