Virtually it's more correct that if `document_rename_file()` fails, `handle_save_as()` would no longer proceed to call `document_save_file_as()`. I'm not sure if unexpected things in runtime would not happen if `document_save_file_as()` somehow succeeds even if `document_rename_file()` fails, but it's certainly not what the user would be expecting. I.e., being able to save to the target file but the originally file remains to exist. This might be a rare case, but it still stands to be programmatically incorrect.
I decided to include changing `document_rename_file()` itself in this update rather than creating another non-API function, because I believe it's the only correct way to do it. Sooner or later, it would have to be changed anyway. And I don't think it's likeable that an old non-gboolean function which no code would use would exist just for the sake of not breaking the API. This should also be helpful to future code that might rely on it. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1180
-- Commit Summary --
* Make document_rename_file() return a gboolean. * Abort save if rename fails
-- File Changes --
M src/dialogs.c (6) M src/document.c (4) M src/document.h (2)
-- Patch Links --
https://github.com/geany/geany/pull/1180.patch https://github.com/geany/geany/pull/1180.diff