gedit r6700 - branches/win32/gedit



Author: pborelli
Date: Tue Dec 23 20:13:40 2008
New Revision: 6700
URL: http://svn.gnome.org/viewvc/gedit?rev=6700&view=rev

Log:
also move the accel file definition to gedit-dirs


Modified:
   branches/win32/gedit/gedit-app.c
   branches/win32/gedit/gedit-dirs.c
   branches/win32/gedit/gedit-dirs.h

Modified: branches/win32/gedit/gedit-app.c
==============================================================================
--- branches/win32/gedit/gedit-app.c	(original)
+++ branches/win32/gedit/gedit-app.c	Tue Dec 23 20:13:40 2008
@@ -127,32 +127,12 @@
 	g_type_class_add_private (object_class, sizeof(GeditAppPrivate));
 }
 
-static gchar *
-get_accel_file (void)
-{
-	gchar *config_dir;
-	gchar *accel_file = NULL;
-	
-	config_dir = gedit_dirs_get_config_dir ();
-	
-	if (config_dir != NULL)
-	{
-		accel_file = g_build_filename (config_dir,
-					       "accels",
-					       "gedit",
-					       NULL);
-		g_free (config_dir);
-	}
-
-	return accel_file;
-}
-
 static void
 load_accels (void)
 {
 	gchar *filename;
 
-	filename = get_accel_file ();
+	filename = gedit_dirs_get_accels_file ();
 	if (filename != NULL)
 	{
 		gedit_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename);		
@@ -166,7 +146,7 @@
 {
 	gchar *filename;
 
-	filename = get_accel_file ();
+	filename = gedit_dirs_get_accels_file ();
 	if (filename != NULL)
 	{
 		gedit_debug_message (DEBUG_APP, "Saving keybindings in %s\n", filename);		

Modified: branches/win32/gedit/gedit-dirs.c
==============================================================================
--- branches/win32/gedit/gedit-dirs.c	(original)
+++ branches/win32/gedit/gedit-dirs.c	Tue Dec 23 20:13:40 2008
@@ -58,6 +58,44 @@
 }
 
 gchar *
+gedit_dirs_get_accels_file ()
+{
+	gchar *accels = NULL;
+
+#ifndef G_OS_WIN32
+	const gchar *home;
+	
+	home = g_get_home_dir ();
+
+	if (home != NULL)
+	{
+		/* on linux accels are stored in .gnome2/accels
+		 * for historic reasons (backward compat with the
+		 * old libgnome that took care of saving them */
+		accels = g_build_filename (home,
+					   ".gnome2",
+					   "accels",
+					   "gedit",
+					   NULL);
+	}
+#else
+	{
+		gchar *config_dir = NULL;
+
+		config_dir = gedit_dirs_get_config_dir ();
+		accels = g_build_filename (config_dir,
+					   "accels",
+					   "gedit",
+					   NULL);
+
+		g_free (config_dir);
+	}
+#endif
+
+	return accels;
+}
+
+gchar *
 gedit_dirs_get_gedit_data_dir (void)
 {
 	gchar *data_dir;

Modified: branches/win32/gedit/gedit-dirs.h
==============================================================================
--- branches/win32/gedit/gedit-dirs.h	(original)
+++ branches/win32/gedit/gedit-dirs.h	Tue Dec 23 20:13:40 2008
@@ -32,6 +32,8 @@
 
 gchar		*gedit_dirs_get_cache_dir		(void);
 
+gchar		*gedit_dirs_get_accels_file		(void);
+
 gchar		*gedit_dirs_get_gedit_data_dir		(void);
 
 gchar		*gedit_dirs_get_gedit_locale_dir	(void);



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