<div>Ok, thanks for these indications :)<br></div><div><br></div><div>I continued to search for the pattern "= '\0'", and I found many more components where STR_IS_EMPTY() could be used.<br></div><div>But this also led me to find places where xfce_expand_field_codes() could be used (the main function I added in <a href="https://gitlab.xfce.org/xfce/libxfce4util/-/merge_requests/1">https://gitlab.xfce.org/xfce/libxfce4util/-/merge_requests/1</a>), so I also searched systematically for the pattern "= '%'" to find all of them.<br></div><div><br></div><div>Now I think I will start with these cases (at least when libxfce4util is already a dependency), in a component by component approach, taking the opportunity to also replace the occurrences of STR_IS_EMPTY() and xfce_append_quoted(), and see what is the opinion of the maintainers of each project about these changes.<br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user"><div>Best regards,<br></div><div>Tamaranch<br></div></div></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Saturday, July 4, 2020 11:38 PM, Simon Steinbeiss <simon@xfce.org> wrote:<br></div><div> <br></div><blockquote class="protonmail_quote" type="cite"><div dir="ltr"><div>Hi Tamaranch,<br></div><div><br></div><div>first of all thanks a lot for making the effort to cleaning up code and making it more maintainable! Most people are only interested in adding (or requesting) features.<br></div><div>Secondly the mailing list is a good - albeit sometimes rather quiet - place for such general discussions.<br></div><div><br></div><div>ad 1) I would say that for most core components the dependency on libxfce4util is rather harmless (xfce4-panel, thunar, xfce4-settings already depend on it). And by extension panel plugins can decide to rely on libxfce4util because this library is anyway required by the panel...<br></div><div>For components that may also be used independently (like tumbler, iirc it was used for Nokia's own Android competitor back in the day) this can be a separate discussion if it's really just about a single macro vs. the dependency on an additional library to cover that. I would <br></div><div><br></div><div>ad 2) The central place for the two functions you started to unify was also well-chosen as I'd rather take things out of exo than continue to build it up. From where I stand there are a few things in exo which should perform an exodus (pun intended) - much as we did for the exo-helpers and preferred apps dialog already by moving it to xfce4-settings.<br></div><div><br></div><div>But these are just my personal 2cents.<br></div><div>Cheers<br></div><div>Simon<br></div></div><div><br></div><div class="gmail_quote"><div dir="ltr">On Sat, Jul 4, 2020 at 11:36 PM Tamaranch <<a href="mailto:trash.paradise@protonmail.com">trash.paradise@protonmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hi everyone,<br></div><div><br></div><div>The following concerns potentially all XFCE components, so I thought of using the mailing list rather than Gitlab: sorry if it wasn't a good idea, and thanks by advance to indicate me a better place for this type of comment in this case.<br></div><div><br></div><div>In a previous MR (<a href="https://gitlab.xfce.org/xfce/libxfce4util/-/merge_requests/1" target="_blank">https://gitlab.xfce.org/xfce/libxfce4util/-/merge_requests/1</a>), I added the function xfce_append_quoted() and the macro STR_IS_EMPTY() to libxfce4util API, in order to replace later their various occurrences in XFCE components, where they appear in one form or another.<br></div><div><br></div><div>Now that I took a closer look, I don't know how this should be done, or even if this should be done, despite the fact that using this kind of utilities from only one (or a few) central place, seems obviously a better way to do than duplicating the code in all components that need them.<br></div><div><br></div><div>Here are the two problems I encounter:<br></div><div>1. Using these utilities from a central place implies to add this central place as a dependency to many XFCE components, which is not necessarily harmless.<br></div><div>2. Should there be one central place or several, and if there is only one, which one?<br></div><div>For instance, in the case of STR_IS_EMPTY(), exo appears as a concurrent to libxfce4util, with its exo_str_is_empty().<br></div><div><br></div><div>To finish and illustrate, here is a list of XFCE components where I found occurrences of these patterns:<br></div><div>1. _append_quoted:<br></div><div>xfce4-panel: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=_append_quoted&group_id=&project_id=13&search_code=true&repository_ref=master&nav_source=navbar" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=_append_quoted&group_id=&project_id=13&search_code=true&repository_ref=master&nav_source=navbar</a><br></div><div>tumbler: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=_append_quoted&group_id=&project_id=10&search_code=true&repository_ref=master&nav_source=navbar" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=_append_quoted&group_id=&project_id=10&search_code=true&repository_ref=master&nav_source=navbar</a><br></div><div>thunar: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=_append_quoted&group_id=&project_id=8&search_code=true&repository_ref=master&nav_source=navbar" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=_append_quoted&group_id=&project_id=8&search_code=true&repository_ref=master&nav_source=navbar</a><br></div><div><br></div><div>2. str_is_empty:<br></div><div>xfce4-panel: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&snippets=&scope=&repository_ref=master&search=str_is_empty&project_id=13" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&snippets=&scope=&repository_ref=master&search=str_is_empty&project_id=13</a><br></div><div>thunar: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&snippets=&scope=&repository_ref=master&search=str_is_empty&project_id=8" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&snippets=&scope=&repository_ref=master&search=str_is_empty&project_id=8</a><br></div><div>xfce4-settings: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=16&search_code=true&repository_ref=master&nav_source=navbar" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=16&search_code=true&repository_ref=master&nav_source=navbar</a><br></div><div>exo: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=4&search_code=true&repository_ref=master&nav_source=navbar" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=4&search_code=true&repository_ref=master&nav_source=navbar</a><br></div><div>xfce4-whiskermenu-plugin: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=74&search_code=true&repository_ref=master&nav_source=navbar" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=74&search_code=true&repository_ref=master&nav_source=navbar</a><br></div><div>xfce4-mailwatch-plugin: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=55&search_code=true&repository_ref=master&nav_source=navbar" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=55&search_code=true&repository_ref=master&nav_source=navbar</a><br></div><div>xfce4-indicator-plugin: <a href="https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=53&search_code=true&repository_ref=master&nav_source=navbar" target="_blank">https://gitlab.xfce.org/search?utf8=%E2%9C%93&search=str_is_empty&group_id=&project_id=53&search_code=true&repository_ref=master&nav_source=navbar</a><br></div><div><br></div><div>Note that it remains the components where the code of STR_IS_EMPTY() (or ! STR_IS_EMPTY()) appears directly in one form or another, like in mousepad (I did not search for all these occurrences yet):<br></div><div>text == NULL || *text == '\0'<br></div><div>filename != NULL && *filename != '\0'<br></div><div><br></div><div><div><div>Best regards,<br></div><div>Tamaranch<br></div></div></div><div><br></div><div>_______________________________________________<br></div><div> Xfce4-dev mailing list<br></div><div> <a href="mailto:Xfce4-dev@xfce.org" target="_blank">Xfce4-dev@xfce.org</a><br></div><div> <a href="https://mail.xfce.org/mailman/listinfo/xfce4-dev" rel="noreferrer" target="_blank">https://mail.xfce.org/mailman/listinfo/xfce4-dev</a><br></div></blockquote></div></blockquote><div><br></div>