[Geany-devel] encoding combo boxes bug

Matthew Brush mbrush at xxxxx
Fri Jan 20 21:29:57 UTC 2012


On 01/20/2012 10:39 AM, Colomban Wendling wrote:
> Le 20/01/2012 00:07, Lex Trotman a écrit :
>> On Fri, Jan 20, 2012 at 9:58 AM, Lex Trotman<elextr at gmail.com> wrote:
>>> On Thu, Jan 19, 2012 at 11:53 PM, Nick Treleaven
>>> <nick.treleaven at btinternet.com> wrote:
>>>> Hi,
>>>> I'm seeing wrong encoding names in the encoding combo boxes on the
>>>> Files tab
>>>> of the Prefs dialog. E.g. where it should say UTF-8 I see Hebrew.
>>>> Another
>>>> Glade-related bug?
>>>
>>> Sort of, according to glade combo_new_encoding, combo_open_encoding
>>> and combo_eol all share the same underlying list model.
>>>
>>> So when we initialise them, all the entries go in the same list, so
>>> all three show the encodings twice and the end of line entries at the
>>> bottom.
>>>
>>> Two of these need to be pointed to different list models.
>>
>> PS the two encodings combos could probably share the same list, so
>> long as we only initialise it once in prefs.c, but eol needs its own
>> list
>
> Thanks for the catch & analysis, it's now fixed -- actually I did broke
> it in ca922e0ddc8022283ec3c1f49aaa15ab7c5ba213, stupid me.
>
> @All: I added ui_builder_get_object() to be able to fetch a non-widget
> (list store here) from prefs.c, but I'm not completely sure it's the
> prefect fix. If you have any idea on how to improve this, spread them! :)
>

IMO, it'd be better to just move the builder object to the header file 
(maybe in a suitable struct), so that all files can access it. Then 
there's no need to add 1 line wrapper functions for every function we 
use from GtkBuilder's API. This isn't unprecedented, I think there's at 
least a handful of globals like this in Geany already (even in 
ui_utils.h). Alternatively, we could add a function called 
`ui_get_builder()` to get access to the builder to use with GtkBuilder API.

Otherwise, it's not too big of a deal, maybe we don't need much more 
from the GtkBuilder API.

Cheers,
Matthew Brush



More information about the Devel mailing list