Branch: refs/heads/master Author: Nick Treleaven ntrel002@gmail.com Committer: Nick Treleaven ntrel002@gmail.com Date: Thu, 16 Feb 2023 17:29:24 UTC Commit: 54cc6add80c72739de299fd671e75d57b6b528eb https://github.com/geany/geany/commit/54cc6add80c72739de299fd671e75d57b6b528...
Log Message: ----------- Add recent filename on saving when real_path is not set
real_path is set for any documents on disk.
Don't add new document opened from CLI to recent files, because it doesn't exist yet. No need now to add recent file on Save As, because real_path is nulled before calling document_save_file.
Modified Paths: -------------- src/document.c src/libmain.c
Modified: src/document.c 4 lines changed, 1 insertions(+), 3 deletions(-) =================================================================== @@ -1860,9 +1860,6 @@ gboolean document_save_file_as(GeanyDocument *doc, const gchar *utf8_fname) * to ignore any earlier events */ monitor_file_setup(doc); doc->priv->file_disk_status = FILE_IGNORE; - - if (ret) - ui_add_recent_document(doc); return ret; }
@@ -2038,6 +2035,7 @@ static gchar *save_doc(GeanyDocument *doc, const gchar *locale_filename, doc->real_path = utils_get_real_path(locale_filename); doc->priv->is_remote = utils_is_remote_path(locale_filename); monitor_file_setup(doc); + ui_add_recent_document(doc); } return NULL; }
Modified: src/libmain.c 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -852,8 +852,6 @@ gboolean main_handle_filename(const gchar *locale_filename) document_show_tab(doc); else doc = document_new_file(utf8_filename, NULL, NULL); - if (doc != NULL) - ui_add_recent_document(doc); g_free(utf8_filename); g_free(filename); return TRUE;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).