[Geany-devel] encoding combo boxes bug - utility functions

Lex Trotman elextr at xxxxx
Thu Jan 26 05:21:29 UTC 2012


On Thu, Jan 26, 2012 at 3:41 PM, Matthew Brush <mbrush at codebrainz.ca> wrote:
> On 01/25/2012 06:45 PM, Lex Trotman wrote:
>>
>> [...]
>> Hi Matthew,
>>
[...]
>> utils_is_uri() - good utility function, well named
>>
>
> Indeed well named and probably a little clearer that `strstr(uri, "://") !=
> NULL` but that's probably what I'd write if I didn't know Geany had it's own
> function for this, or I'd use g_uri_parse_scheme() or something.

You raise a good point, documentation and awareness of utils
resources.  ATM the only documentation produced is for functions in
the API, needs a version for the utils and any other generally useful
bits.  Can doxygen distinguish two sets of doc comments in the one
file so we can make a utils documentation set as well as the plugin
API?

[...]
>> utils_spawn_async() - I think was used more than one place in the
>> past, also hides the messy #ifdef windoze which is good
>>
>
> If the GLIB functions don't work (ie. on win32), we should send a bug
> report/patch upstream, just as we'd do with Scintilla if we found an obvious
> bug. We shouldn't have our own fixed implementation, IMO (unless it does
> something else I'm not aware of, or upstream refused the fix).
>

You'll have to ask Enrico (I think) why the win API is used and why
builds on windows are synchronous, thankfully most of this was done
before I arrived and I only have a vague awareness of the reasons.
OTOH I don't know that I like your chances of fixing windows Glib and
then it will be in a version we get to a ways in the future so the win
interface will have to stay for some time.

[...]
>> utils_make_filename() - reasonable utility function, probably should
>> be used in more places where filename.ext concat is done explicitly
>>
>
> I never would've thought to use this function over g_strjoin() and
> g_build_filename() or something.

See point above.

Having this seems weird to me, despite it
> being mildly useful and having good doc comment, since the name isn't great
> and the two things it does are so commonly available separately already in
> GLIB.

But they are still two things not just one :)

>
> But anyway, I made this list in 2 minutes scanning utils.c, so possibly not
> the best examples.

Sure, there are certainly some that could go, thats evolution of code
(or code rot if you like) but it is often going to be a judgement
call, so I guess the right path is so you and Nick are equally happy
or unhappy :-D

Cheers
Lex



More information about the Devel mailing list