[Github-comments] [geany/geany] Make document_rename_file() return a gboolean; Abort save if rename fails (#1180)

konsolebox notifications at xxxxx
Thu Aug 18 08:42:50 UTC 2016


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

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1180
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160818/1b5f484f/attachment.html>


More information about the Github-comments mailing list