Revision: 3689 http://geany.svn.sourceforge.net/geany/?rev=3689&view=rev Author: eht16 Date: 2009-04-05 21:41:38 +0000 (Sun, 05 Apr 2009)
Log Message: ----------- Show a message dialog when renaming a file fails.
Modified Paths: -------------- trunk/ChangeLog trunk/src/document.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-04-05 21:22:49 UTC (rev 3688) +++ trunk/ChangeLog 2009-04-05 21:41:38 UTC (rev 3689) @@ -23,6 +23,8 @@ * src/highlighting.c: Fix typo in the G_LIKELY checks, introduced in last commit. Fix the size of the styles array. + * src/document.c: + Show a message dialog when renaming a file fails.
2009-04-03 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2009-04-05 21:22:49 UTC (rev 3688) +++ trunk/src/document.c 2009-04-05 21:41:38 UTC (rev 3689) @@ -1517,13 +1517,18 @@ { gchar *old_locale_filename = utils_get_locale_from_utf8(doc->file_name); gchar *new_locale_filename = utils_get_locale_from_utf8(new_filename); + gint result;
/* stop file monitoring to avoid getting events for deleting/creating files, * it's re-setup in document_save_file_as() */ document_stop_file_monitoring(doc);
- g_rename(old_locale_filename, new_locale_filename); - + result = g_rename(old_locale_filename, new_locale_filename); + if (G_UNLIKELY(result != 0)) + { + dialogs_show_msgbox_with_secondary(GTK_MESSAGE_ERROR, + _("Error renaming file."), g_strerror(errno)); + } g_free(old_locale_filename); g_free(new_locale_filename); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.