[gnome-latex: 143/205] Delete templates: save only if template(s) deleted
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-latex: 143/205] Delete templates: save only if template(s) deleted
- Date: Fri, 14 Dec 2018 10:58:54 +0000 (UTC)
commit 566dd49dfecd43f1051f0e74fe641220b57772bb
Author: Sébastien Wilmet <sebastien wilmet gmail com>
Date: Fri Dec 18 22:49:14 2009 +0100
Delete templates: save only if template(s) deleted
src/templates.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/templates.c b/src/templates.c
index ef0920e..653e48d 100644
--- a/src/templates.c
+++ b/src/templates.c
@@ -236,6 +236,8 @@ cb_delete_template (void)
gtk_widget_show_all (content_area);
+ gint nb_personnal_templates_before = nb_personnal_templates;
+
while (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
{
GList *selected_items = gtk_icon_view_get_selected_items (
@@ -259,8 +261,11 @@ cb_delete_template (void)
g_list_free (selected_items);
}
- save_rc_file ();
- save_contents ();
+ if (nb_personnal_templates != nb_personnal_templates_before)
+ {
+ save_rc_file ();
+ save_contents ();
+ }
gtk_widget_destroy (dialog);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]