[gnac/devel] Fixed a bug



commit feec725a2d8e3988ee59a587db53ad15f5e197a9
Author: BenoÃt Dupasquier <bdupasqu src gnome org>
Date:   Sat Oct 22 12:58:49 2011 +0100

    Fixed a bug

 src/profiles/gnac-profiles-manager.c    |    5 +----
 src/profiles/gnac-profiles-properties.c |    7 ++++---
 2 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/profiles/gnac-profiles-manager.c b/src/profiles/gnac-profiles-manager.c
index 4c1a817..abbc35f 100644
--- a/src/profiles/gnac-profiles-manager.c
+++ b/src/profiles/gnac-profiles-manager.c
@@ -560,7 +560,6 @@ gnac_profiles_mgr_show(void)
 
   g_list_foreach(selected, (GFunc)gtk_tree_row_reference_free, NULL);
   g_list_free(selected);
-  g_mem_profile();
 }
 
 
@@ -1053,7 +1052,7 @@ gnac_profiles_mgr_on_drag_profile_copied(goffset  current_num_bytes,
     } else {
       profile = gnac_profiles_properties_load_profile_from_file(
           copy_data->path, copy_data->name, copy_data->error);
-      if (profile != NULL) {
+      if (profile != NULL && !(*(copy_data->error))) {
         gdk_threads_enter();
         gnac_profiles_properties_save_profile(profile);
         gnac_profiles_mgr_insert(profile);
@@ -1077,9 +1076,7 @@ gnac_profiles_mgr_on_drag_data_get(GtkWidget        *widget,
                                    gpointer          user_data)
 {
   gchar **uris;
-
   uris = gnac_profiles_mgr_get_selected_uris();
-
   gtk_selection_data_set_uris(data, uris);
 }
 
diff --git a/src/profiles/gnac-profiles-properties.c b/src/profiles/gnac-profiles-properties.c
index 002a8ab..b6e4653 100644
--- a/src/profiles/gnac-profiles-properties.c
+++ b/src/profiles/gnac-profiles-properties.c
@@ -532,7 +532,7 @@ gnac_profiles_properties_on_save(GtkWidget *widget,
     widget = GTK_WIDGET(gtk_builder_get_object(profiles_properties_builder,
         "name_entry"));
     name = gtk_entry_get_text(GTK_ENTRY(widget));
-    
+
     if (!g_strcmp0(name, "")) {
       gnac_profiles_properties_display_status_message(
           _("The profile name must be non-empty"));
@@ -668,6 +668,8 @@ gnac_profiles_properties_load_profile_from_file(const gchar  *path,
                                                const gchar   *filename,
                                                GError       **error)
 {
+  g_return_val_if_fail(error == NULL || *error == NULL, NULL);
+
   XMLDoc *doc;
   AudioProfileGeneric *profile;
   FormatModule *format_module;
@@ -703,9 +705,9 @@ gboolean
 gnac_profiles_properties_saved_profiles_contain_name(const gchar *name,
                                                      gboolean     add_ext)
 {
+  gboolean  exists;
   gchar    *path;
   GFile    *file;
-  gboolean  exists;
   
   if (!add_ext) {
     path = g_strconcat(GNAC_SAVED_PROFILES_URL(name), NULL);
@@ -716,7 +718,6 @@ gnac_profiles_properties_saved_profiles_contain_name(const gchar *name,
   file = g_file_new_for_path(path);
   exists = g_file_query_exists(file, NULL);
 
-  /* Cleanup */
   g_free(path);
   g_object_unref(file);
 



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