gnome-desktop r5366 - trunk/libgnome-desktop



Author: federico
Date: Tue Jan 27 20:28:40 2009
New Revision: 5366
URL: http://svn.gnome.org/viewvc/gnome-desktop?rev=5366&view=rev

Log:
bgo545115 - Don't fall back to the pre-XDG version of the configuration file format - it's way obsolete now

	Remove the use of the "old" version of the configuration format
	(which was never in a public release):

	* gnome-rr-config.c (get_old_config_filename): Removed.
	(configurations_read): Don't fall back to the pre-XDG location of
	the configuration file.
	(gnome_rr_config_save): Don't delete the pre-XDG configuration
	file anymore.

Signed-off-by: Federico Mena Quintero <federico novell com>

Modified:
   trunk/libgnome-desktop/ChangeLog
   trunk/libgnome-desktop/gnome-rr-config.c

Modified: trunk/libgnome-desktop/gnome-rr-config.c
==============================================================================
--- trunk/libgnome-desktop/gnome-rr-config.c	(original)
+++ trunk/libgnome-desktop/gnome-rr-config.c	Tue Jan 27 20:28:40 2009
@@ -78,8 +78,6 @@
 static void             output_free           (GnomeOutputInfo  *output);
 static GnomeOutputInfo *output_copy           (GnomeOutputInfo  *output);
 
-static gchar *get_old_config_filename (void);
-
 typedef struct Parser Parser;
 
 /* Parser for monitor configurations */
@@ -428,34 +426,13 @@
 {
     char *filename;
     GnomeRRConfig **configs;
-    GError *err;
-
-    /* Try the new configuration file... */
 
     filename = gnome_rr_config_get_intended_filename ();
 
-    err = NULL;
-    
-    configs = configurations_read_from_file (filename, &err);
+    configs = configurations_read_from_file (filename, error);
 
     g_free (filename);
 
-    if (err)
-    {
-	if (g_error_matches (err, G_FILE_ERROR, G_FILE_ERROR_NOENT))
-	{
-	    g_error_free (err);
-	    
-	    /* Okay, so try the old configuration file */
-	    filename = get_old_config_filename ();
-	    configs = configurations_read_from_file (filename, error);
-	    g_free (filename);
-	}
-	else
-	{
-	    g_propagate_error (error, err);
-	}
-    }
     return configs;
 }
 
@@ -923,13 +900,6 @@
     g_mkdir_with_parents (g_get_user_config_dir (), 0700);
 }
 
-static gchar *
-get_old_config_filename (void)
-{
-    ensure_config_directory ();
-    return g_build_filename (g_get_home_dir(), ".gnome2", CONFIG_INTENDED_BASENAME, NULL);
-}
-
 char *
 gnome_rr_config_get_backup_filename (void)
 {
@@ -1107,17 +1077,7 @@
 
     result = g_file_set_contents (intended_filename, output->str, -1, error);
 
-    if (result)
-    {
-	char *filename;
-
-	/* Only remove the old config file if we were successful in saving the new one */
-
-	filename = get_old_config_filename ();
-	g_unlink (filename);
-
-	g_free (filename);
-    } else
+    if (!result)
 	rename (backup_filename, intended_filename); /* no error checking because the backup may not even exist */
 
     g_free (backup_filename);



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