[gnac/devel] Code refactoring



commit eb0e4dd120996d0853244390b874b1b08fdb8eac
Author: BenoÃt Dupasquier <bdupasqu src gnome org>
Date:   Thu Dec 29 18:18:41 2011 +0100

    Code refactoring

 libgnac/libgnac-output.c                     |    9 +++++----
 src/profiles/formats/gnac-profiles-aac.c     |    4 ++--
 src/profiles/formats/gnac-profiles-flac.c    |    4 ++--
 src/profiles/formats/gnac-profiles-lame.c    |    4 ++--
 src/profiles/formats/gnac-profiles-speex.c   |    4 ++--
 src/profiles/formats/gnac-profiles-unknown.c |    4 ++--
 src/profiles/formats/gnac-profiles-vorbis.c  |    4 ++--
 src/profiles/formats/gnac-profiles-wav.c     |    4 ++--
 src/profiles/formats/gnac-profiles-wavpack.c |    4 ++--
 src/profiles/gnac-profiles-default.h         |    2 +-
 src/profiles/gnac-profiles-properties.c      |    4 ++--
 11 files changed, 24 insertions(+), 23 deletions(-)
---
diff --git a/libgnac/libgnac-output.c b/libgnac/libgnac-output.c
index 7db062d..97354cd 100644
--- a/libgnac/libgnac-output.c
+++ b/libgnac/libgnac-output.c
@@ -270,7 +270,7 @@ static void
 libgnac_output_rename_patterns_init(LibgnacTags *tags)
 {
   if (!rename_patterns) {
-    gint i;
+    guint i;
     for (i = 0; rename_pattern_id[i] != -1; i++)
     {
       rename_patterns = g_slist_append(rename_patterns, 
@@ -306,7 +306,7 @@ libgnac_output_get_filename(GFile        *source,
                             const gchar  *rename_pattern,
                             GError      **error)
 {
-  gchar  *output = NULL;
+  gchar *output = NULL;
 
   LibgnacTags *tags = libgnac_metadata_extract(metadata, source, NULL);
   if (tags) {
@@ -346,8 +346,6 @@ libgnac_output_build_output(GFile                *source,
   g_return_val_if_fail(!error || !*error, NULL);
 
   GError *output_error = NULL;
-  GFile  *out_directory;
-  gchar  *output_name;
 
   gchar *filename = libgnac_output_get_filename(source,
       config->rename_pattern, &output_error);
@@ -357,6 +355,9 @@ libgnac_output_build_output(GFile                *source,
     return NULL;
   }
   
+  GFile *out_directory;
+  gchar *output_name;
+
   switch (config->folder_type)
   {
     case FOLDER_SUBDIRECTORY: {
diff --git a/src/profiles/formats/gnac-profiles-aac.c b/src/profiles/formats/gnac-profiles-aac.c
index b5169be..eeb82f1 100755
--- a/src/profiles/formats/gnac-profiles-aac.c
+++ b/src/profiles/formats/gnac-profiles-aac.c
@@ -120,7 +120,7 @@ gnac_profiles_aac_reset_ui(void)
 
 
 static void
-gnac_profiles_aac_fullfill_fields(gpointer data)
+gnac_profiles_aac_set_fields(gpointer data)
 {
   if (!data) {
     gnac_profiles_aac_reset_ui();
@@ -265,7 +265,7 @@ gnac_profiles_aac_get_funcs(void)
     gnac_profiles_aac_generate_pipeline,
     gnac_profiles_aac_generate_audio_profile,
     gnac_profiles_aac_free_audio_profile,
-    gnac_profiles_aac_fullfill_fields,
+    gnac_profiles_aac_set_fields,
     gnac_profiles_aac_get_widget,
     gnac_profiles_aac_save_profile,
     gnac_profiles_aac_load_specific_properties,
diff --git a/src/profiles/formats/gnac-profiles-flac.c b/src/profiles/formats/gnac-profiles-flac.c
index 6a7ff5d..019c64a 100755
--- a/src/profiles/formats/gnac-profiles-flac.c
+++ b/src/profiles/formats/gnac-profiles-flac.c
@@ -92,7 +92,7 @@ gnac_profiles_flac_reset_ui(void)
 
 
 static void
-gnac_profiles_flac_fullfill_fields(gpointer data)
+gnac_profiles_flac_set_fields(gpointer data)
 {
   if (!data) {
     gnac_profiles_flac_reset_ui();
@@ -217,7 +217,7 @@ gnac_profiles_flac_get_funcs(void)
     gnac_profiles_flac_generate_pipeline,
     gnac_profiles_flac_generate_audio_profile,
     gnac_profiles_flac_free_audio_profile,
-    gnac_profiles_flac_fullfill_fields,
+    gnac_profiles_flac_set_fields,
     gnac_profiles_flac_get_widget,
     gnac_profiles_flac_save_profile,
     gnac_profiles_flac_load_specific_properties,
diff --git a/src/profiles/formats/gnac-profiles-lame.c b/src/profiles/formats/gnac-profiles-lame.c
index 677bceb..108c8e9 100755
--- a/src/profiles/formats/gnac-profiles-lame.c
+++ b/src/profiles/formats/gnac-profiles-lame.c
@@ -345,7 +345,7 @@ gnac_profiles_lame_reset_ui(void)
 
 
 static void
-gnac_profiles_lame_fullfill_fields(gpointer data)
+gnac_profiles_lame_set_fields(gpointer data)
 {
   if (!data) {
     gnac_profiles_lame_reset_ui();
@@ -643,7 +643,7 @@ gnac_profiles_lame_get_funcs(void)
     gnac_profiles_lame_generate_pipeline,
     gnac_profiles_lame_generate_audio_profile,
     gnac_profiles_lame_free_audio_profile,
-    gnac_profiles_lame_fullfill_fields,
+    gnac_profiles_lame_set_fields,
     gnac_profiles_lame_get_widget,
     gnac_profiles_lame_save_profile,
     gnac_profiles_lame_load_specific_properties,
diff --git a/src/profiles/formats/gnac-profiles-speex.c b/src/profiles/formats/gnac-profiles-speex.c
index 5430d2a..a580f73 100644
--- a/src/profiles/formats/gnac-profiles-speex.c
+++ b/src/profiles/formats/gnac-profiles-speex.c
@@ -333,7 +333,7 @@ gnac_profiles_speex_reset_ui(void)
 
 
 static void
-gnac_profiles_speex_fullfill_fields(gpointer data)
+gnac_profiles_speex_set_fields(gpointer data)
 {
   if (!data) {
     gnac_profiles_speex_reset_ui();
@@ -622,7 +622,7 @@ gnac_profiles_speex_get_funcs(void)
     gnac_profiles_speex_generate_pipeline,
     gnac_profiles_speex_generate_audio_profile,
     gnac_profiles_speex_free_audio_profile,
-    gnac_profiles_speex_fullfill_fields,
+    gnac_profiles_speex_set_fields,
     gnac_profiles_speex_get_widget,
     gnac_profiles_speex_save_profile,
     gnac_profiles_speex_load_specific_properties,
diff --git a/src/profiles/formats/gnac-profiles-unknown.c b/src/profiles/formats/gnac-profiles-unknown.c
index a8c93c9..6c3bed1 100644
--- a/src/profiles/formats/gnac-profiles-unknown.c
+++ b/src/profiles/formats/gnac-profiles-unknown.c
@@ -102,7 +102,7 @@ gnac_profiles_unknown_reset_ui(void)
 
 
 static void
-gnac_profiles_unknown_fullfill_fields(gpointer data)
+gnac_profiles_unknown_set_fields(gpointer data)
 {
   if (!data) {
     gnac_profiles_unknown_reset_ui();
@@ -273,7 +273,7 @@ gnac_profiles_unknown_get_funcs(void)
     gnac_profiles_unknown_generate_pipeline,
     gnac_profiles_unknown_generate_audio_profile,
     gnac_profiles_unknown_free_audio_profile,
-    gnac_profiles_unknown_fullfill_fields,
+    gnac_profiles_unknown_set_fields,
     gnac_profiles_unknown_get_widget,
     gnac_profiles_unknown_save_profile,
     gnac_profiles_unknown_load_specific_properties,
diff --git a/src/profiles/formats/gnac-profiles-vorbis.c b/src/profiles/formats/gnac-profiles-vorbis.c
index 467c20f..63ed324 100755
--- a/src/profiles/formats/gnac-profiles-vorbis.c
+++ b/src/profiles/formats/gnac-profiles-vorbis.c
@@ -212,7 +212,7 @@ gnac_profiles_vorbis_reset_ui(void)
 
 
 static void
-gnac_profiles_vorbis_fullfill_fields(gpointer data)
+gnac_profiles_vorbis_set_fields(gpointer data)
 {
   if (!data) {
     gnac_profiles_vorbis_reset_ui();
@@ -389,7 +389,7 @@ gnac_profiles_vorbis_get_funcs(void)
     gnac_profiles_vorbis_generate_pipeline,
     gnac_profiles_vorbis_generate_audio_profile,
     gnac_profiles_vorbis_free_audio_profile,
-    gnac_profiles_vorbis_fullfill_fields,
+    gnac_profiles_vorbis_set_fields,
     gnac_profiles_vorbis_get_widget,
     gnac_profiles_vorbis_save_profile,
     gnac_profiles_vorbis_load_specific_properties,
diff --git a/src/profiles/formats/gnac-profiles-wav.c b/src/profiles/formats/gnac-profiles-wav.c
index 2748244..01f527b 100755
--- a/src/profiles/formats/gnac-profiles-wav.c
+++ b/src/profiles/formats/gnac-profiles-wav.c
@@ -70,7 +70,7 @@ gnac_profiles_wav_generate_pipeline(void)
 
 
 static void
-gnac_profiles_wav_fullfill_fields(gpointer data)
+gnac_profiles_wav_set_fields(gpointer data)
 {
   /* nothing to do */
 }
@@ -158,7 +158,7 @@ gnac_profiles_wav_get_funcs(void)
     gnac_profiles_wav_generate_pipeline,
     gnac_profiles_wav_generate_audio_profile,
     gnac_profiles_wav_free_audio_profile,
-    gnac_profiles_wav_fullfill_fields,
+    gnac_profiles_wav_set_fields,
     gnac_profiles_wav_get_widget,
     gnac_profiles_wav_save_profile,
     gnac_profiles_wav_load_specific_properties,
diff --git a/src/profiles/formats/gnac-profiles-wavpack.c b/src/profiles/formats/gnac-profiles-wavpack.c
index 109e109..738b9bf 100644
--- a/src/profiles/formats/gnac-profiles-wavpack.c
+++ b/src/profiles/formats/gnac-profiles-wavpack.c
@@ -268,7 +268,7 @@ gnac_profiles_wavpack_reset_ui(void)
 
 
 static void
-gnac_profiles_wavpack_fullfill_fields(gpointer data)
+gnac_profiles_wavpack_set_fields(gpointer data)
 {
   if (!data) {
     gnac_profiles_wavpack_reset_ui();
@@ -497,7 +497,7 @@ gnac_profiles_wavpack_get_funcs(void)
     gnac_profiles_wavpack_generate_pipeline,
     gnac_profiles_wavpack_generate_audio_profile,
     gnac_profiles_wavpack_free_audio_profile,
-    gnac_profiles_wavpack_fullfill_fields,
+    gnac_profiles_wavpack_set_fields,
     gnac_profiles_wavpack_get_widget,
     gnac_profiles_wavpack_save_profile,
     gnac_profiles_wavpack_load_specific_properties,
diff --git a/src/profiles/gnac-profiles-default.h b/src/profiles/gnac-profiles-default.h
index 85a6b72..1acede5 100755
--- a/src/profiles/gnac-profiles-default.h
+++ b/src/profiles/gnac-profiles-default.h
@@ -36,7 +36,7 @@ typedef struct {
   void         (*generate_pipeline)       (void);
   gpointer     (*generate_audio_profile)  (GError **);
   void         (*free_audio_profile)      (gpointer);
-  void         (*fullfill_fields)         (gpointer);
+  void         (*set_fields)              (gpointer);
   GtkWidget   *(*get_widget)              (void);
   void         (*save_profile_in_file)    (gpointer);
   gpointer     (*load_specific_properties)(XMLDoc *, AudioProfileGeneric *);
diff --git a/src/profiles/gnac-profiles-properties.c b/src/profiles/gnac-profiles-properties.c
index e1b25e0..fee31cd 100644
--- a/src/profiles/gnac-profiles-properties.c
+++ b/src/profiles/gnac-profiles-properties.c
@@ -239,7 +239,7 @@ gnac_profiles_properties_show(gpointer     profile,
   GtkTreeModel *model = gtk_combo_box_get_model(GTK_COMBO_BOX(format_combo_box));
   gnac_profiles_properties_name_description_set_text(generic->name,
       generic->description);
-  format_module->funcs.fullfill_fields(profile);
+  format_module->funcs.set_fields(profile);
 
   GtkTreeIter iter;
   GtkTreePath *path = gtk_tree_row_reference_get_path(format_module->tree_ref);
@@ -375,7 +375,7 @@ gnac_profiles_properties_reset(void)
   GList *list = g_hash_table_get_values(formats);
 
   for (temp = list; temp; temp = g_list_next(temp)) {
-    ((FormatModule *) temp->data)->funcs.fullfill_fields(NULL);
+    ((FormatModule *) temp->data)->funcs.set_fields(NULL);
   }
 
   g_list_free(list);



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