@b4n commented on this pull request.
if (main_status.main_window_realized) - dialogs_show_msgbox(GTK_MESSAGE_WARNING, warn_msg, display_filename); + dialogs_show_msgbox(GTK_MESSAGE_WARNING, "%s", warn_msg); + + ui_set_statusbar(TRUE, "%s", warn_msg);
which patch?
https://github.com/geany/geany/pull/3665/commits/14d4bb0e05b85024db18349e4b8... but that's irrelevant given I didn't understand what you meant, see below.
My point was that `ui_set_statusbar` printfs the input then calls `msgwin_status_add` with `%s` to re-printf the result string that it just printfed ((mis)using printf as a verb), so maybe that should use `msgwin_status_add_string()`?
Ooh, OK. Indeed, `ui_set_statusbar()` should call `msgwin_status_add_string()` instead of `msgwin_status_add()`. I can add (pun intended) it here, although it's kind of an unrelated optimization.
12 out of 87 calls pass "%s"
Not inconsiderable. In this case you need to printf the string before sending it to the status bar because it is used in the dialog, but since status bar is always doing GTK with the result the cost of re-printfing possibly is immaterial.
Well, I can do an "optimize printf usage" pass and introduce `ui_set_statusbar_string()`, but as you say I believe it's not gonna matter at the performance level (handling format `"%s"` is likely pretty trivial, as would be handling formats without placeholders).