gimp r25420 - in branches/weskaggs: . app/core app/widgets



Author: weskaggs
Date: Tue Apr  8 22:37:23 2008
New Revision: 25420
URL: http://svn.gnome.org/viewvc/gimp?rev=25420&view=rev

Log:
Bill Skaggs  <weskaggs primate ucdavis edu>

	* app/core/gimpdatafactory.c (gimp_data_factory_get_save_dir):
	simplify code.

	* app/widgets/gimpdatachooserdialog.c: remove a bit of 
	debugging code.


Modified:
   branches/weskaggs/ChangeLog
   branches/weskaggs/app/core/gimpdatafactory.c
   branches/weskaggs/app/widgets/gimpdatachooserdialog.c

Modified: branches/weskaggs/app/core/gimpdatafactory.c
==============================================================================
--- branches/weskaggs/app/core/gimpdatafactory.c	(original)
+++ branches/weskaggs/app/core/gimpdatafactory.c	Tue Apr  8 22:37:23 2008
@@ -617,48 +617,31 @@
 
 /*  private functions  */
 
+/*
+ * returns the workspace dir for the factory's data type
+ */
 static gchar *
 gimp_data_factory_get_save_dir (GimpDataFactory *factory)
 {
-  gchar *path;
   gchar *writable_path;
   gchar *tmp;
-  GList *path_list;
   GList *writable_list;
-  GList *list;
   gchar *writable_dir = NULL;
 
   g_object_get (factory->gimp->config,
-                factory->path_property_name,     &path,
                 factory->writable_property_name, &writable_path,
                 NULL);
 
-  tmp = gimp_config_path_expand (path, TRUE, NULL);
-  g_free (path);
-  path = tmp;
-
   tmp = gimp_config_path_expand (writable_path, TRUE, NULL);
   g_free (writable_path);
   writable_path = tmp;
 
-  path_list     = gimp_path_parse (path,          16, TRUE, NULL);
   writable_list = gimp_path_parse (writable_path, 16, TRUE, NULL);
 
-  g_free (path);
   g_free (writable_path);
 
-  for (list = writable_list; list; list = g_list_next (list))
-    {
-      GList *found = g_list_find_custom (path_list,
-                                         list->data, (GCompareFunc) strcmp);
-      if (found)
-        {
-          writable_dir = g_strdup (found->data);
-          break;
-        }
-    }
+  writable_dir = g_strdup (writable_list->data);
 
-  gimp_path_free (path_list);
   gimp_path_free (writable_list);
 
   return writable_dir;

Modified: branches/weskaggs/app/widgets/gimpdatachooserdialog.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpdatachooserdialog.c	(original)
+++ branches/weskaggs/app/widgets/gimpdatachooserdialog.c	Tue Apr  8 22:37:23 2008
@@ -476,8 +476,6 @@
       gtk_tree_model_get (model, &iter, 0, &dirname, -1);
     }
 
-  g_print ("dirname is %s\n", dirname);
-
   orig_filename = data_to_save->filename;
 
   g_file_get_contents (orig_filename, &contents, &length, &error);



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