gtranslator r3711 - in trunk/src: . dialogs



Author: icq
Date: Mon Sep 22 09:44:18 2008
New Revision: 3711
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3711&view=rev

Log:
	* actions-file.c:
	(gtranslator_file_quit):
	Checking if the profiles list is empty before saving
	profiles in xml.
	* dialogs/preferences-dialog.c:
	(setup_tm_pages):
	Checking if filename is NULL before calling
	(gtranslator_prefs_manager_set_tm_lang_entry).

Modified:
   trunk/src/ChangeLog
   trunk/src/actions-file.c
   trunk/src/dialogs/preferences-dialog.c

Modified: trunk/src/actions-file.c
==============================================================================
--- trunk/src/actions-file.c	(original)
+++ trunk/src/actions-file.c	Mon Sep 22 09:44:18 2008
@@ -692,6 +692,7 @@
 	GtranslatorPo *po;
 	gint pages;
 	GList *list = NULL;
+	GList *profiles_list = NULL;
 	gchar *config_folder;
 	gchar *filename;
 	GFile *file;
@@ -703,17 +704,20 @@
 	
 	file = g_file_new_for_path (filename);
 	
-	if (g_file_query_exists (file, NULL)) {
-	  g_file_delete (file, NULL, NULL);
-	  gtranslator_profile_save_profiles_in_xml (filename);
-	} else {
-	  g_file_create (file,
-			 G_FILE_CREATE_NONE,
-			 NULL,
-			 NULL);
-	  gtranslator_profile_save_profiles_in_xml (filename);
+	profiles_list = gtranslator_application_get_profiles (GTR_APP);
+
+	if (profiles_list != NULL) {
+	  if (g_file_query_exists (file, NULL)) {
+	    g_file_delete (file, NULL, NULL);
+	    gtranslator_profile_save_profiles_in_xml (filename);
+	  } else {
+	    g_file_create (file,
+			   G_FILE_CREATE_NONE,
+			   NULL,
+			   NULL);
+	    gtranslator_profile_save_profiles_in_xml (filename);
+	  }
 	}
-	
 	g_free (config_folder);
 	g_object_unref (file);
 

Modified: trunk/src/dialogs/preferences-dialog.c
==============================================================================
--- trunk/src/dialogs/preferences-dialog.c	(original)
+++ trunk/src/dialogs/preferences-dialog.c	Mon Sep 22 09:44:18 2008
@@ -858,8 +858,9 @@
     gtk_entry_set_text (GTK_ENTRY (dlg->priv->tm_lang_entry),
 			filename);
   }
-
-  gtranslator_prefs_manager_set_tm_lang_entry (filename);
+  
+  if (filename != NULL)
+    gtranslator_prefs_manager_set_tm_lang_entry (filename);
   
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->priv->missing_words_spinbutton),
 			     (gdouble) gtranslator_prefs_manager_get_missing_words ());



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]