gnome-media r3806 - in trunk: . grecord/src profiles



Author: malureau
Date: Sat Mar 22 21:21:29 2008
New Revision: 3806
URL: http://svn.gnome.org/viewvc/gnome-media?rev=3806&view=rev

Log:
2008-03-22  Marc-Andre Lureau  <marcandre lureau gmail com>

	* profiles/audio-profile-choose.c (audio_profile_forgotten):
	Remove deleted profiles from the profile choose combo-box.
	Replace GMP_DEBUG macro with GST_DEBUG.

	* grecord/src/gsr-window.c: more checking before string
	comparisons. (Bug #493503)

2008-03-22  Marc-Andre Lureau  <marcandre lureau gmail com>


Modified:
   trunk/ChangeLog
   trunk/grecord/src/gsr-window.c
   trunk/profiles/audio-profile-choose.c
   trunk/profiles/audio-profile-edit.c
   trunk/profiles/audio-profile-private.h
   trunk/profiles/audio-profile.c
   trunk/profiles/audio-profiles-edit.c
   trunk/profiles/gmp-util.c
   trunk/profiles/gmp-util.h
   trunk/profiles/gnome-audio-profiles-properties.c
   trunk/profiles/gnome-audio-profiles-test.c
   trunk/profiles/gnome-media-profiles.c

Modified: trunk/grecord/src/gsr-window.c
==============================================================================
--- trunk/grecord/src/gsr-window.c	(original)
+++ trunk/grecord/src/gsr-window.c	Sat Mar 22 21:21:29 2008
@@ -654,14 +654,11 @@
 	      const char *_name)
 {
 	GSRWindowPrivate *priv;
-        GMAudioProfile *profile;
 	char *tmp, *src, *name;
 	GnomeVFSURI *src_uri, *dst_uri;
 
 	priv = window->priv;
 
-        profile = gm_audio_profile_choose_get_active (priv->profile);
-
 	if (window->priv->extension == NULL ||
 	    g_str_has_suffix (_name, window->priv->extension))
 		name = g_strdup (_name);
@@ -735,7 +732,6 @@
 		char *basename;
 		gchar *filename, *filename_ext, *extension;
 		gint length;
-		GMAudioProfile *profile;
 
 		basename = g_path_get_basename (window->priv->filename);
 		length = strlen (basename);
@@ -746,7 +742,6 @@
 		}
 
 		filename = g_strndup (basename,length);
-		profile = gm_audio_profile_choose_get_active (window->priv->profile);
 		if (window->priv->extension)
 			filename_ext = g_strdup_printf ("%s.%s", filename,
 						window->priv->extension);
@@ -1561,12 +1556,15 @@
 	gchar *id;
 
 	g_return_if_fail (GTK_IS_COMBO_BOX (object));
+
 	profile = gm_audio_profile_choose_get_active (GTK_WIDGET (object));
-  
-	id = g_strdup (gm_audio_profile_get_id (profile));
-	GST_DEBUG ("profile changed to %s", GST_STR_NULL (id));
-	gconf_client_set_string (gconf_client, KEY_LAST_PROFILE_ID, id, NULL);
-	g_free (id);
+
+	if (profile != NULL) {
+		id = g_strdup (gm_audio_profile_get_id (profile));
+		GST_DEBUG ("profile changed to %s", GST_STR_NULL (id));
+		gconf_client_set_string (gconf_client, KEY_LAST_PROFILE_ID, id, NULL);
+		g_free (id);
+	}
 }
 
 static void
@@ -1720,7 +1718,7 @@
 		window->priv->record_id = g_idle_add (record_start, window);
 		g_free (window->priv->extension);
 		profile = gm_audio_profile_choose_get_active (window->priv->profile);
-		window->priv->extension = g_strdup (gm_audio_profile_get_extension (profile));
+		window->priv->extension = g_strdup (profile ? gm_audio_profile_get_extension (profile) : NULL);
 		gtk_widget_set_sensitive (window->priv->profile, FALSE);
 		gtk_widget_set_sensitive (window->priv->input, FALSE);
 		break;
@@ -1905,6 +1903,8 @@
 	gst_bin_add (GST_BIN (pipeline->pipeline), source);
 
 	profile = gm_audio_profile_choose_get_active (window->priv->profile);
+	if (profile == NULL)
+		return NULL;
 	profile_pipeline_desc = gm_audio_profile_get_pipeline (profile);
 	name = gm_audio_profile_get_name (profile);
 

Modified: trunk/profiles/audio-profile-choose.c
==============================================================================
--- trunk/profiles/audio-profile-choose.c	(original)
+++ trunk/profiles/audio-profile-choose.c	Sat Mar 22 21:21:29 2008
@@ -19,17 +19,21 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <string.h>
 #include <glib/gi18n.h>
-#include "gmp-util.h"
-#include "audio-profile-choose.h"
-#include "audio-profile.h"
 #include <gtk/gtk.h>
 #include <glade/glade-xml.h>
 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
 #include <libgnomevfs/gnome-vfs-mime.h>
+#include <gst/gst.h>
+
+#include "gmp-util.h"
+#include "audio-profile-choose.h"
+#include "audio-profile.h"
 
 enum
 {
@@ -38,6 +42,41 @@
   N_COLUMNS
 };
 
+static void
+audio_profile_forgotten (GMAudioProfile *profile, GtkWidget *combo)
+{
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  char *tmp;
+  const char *id;
+
+  g_return_if_fail (GTK_IS_COMBO_BOX (combo));
+  g_return_if_fail (GM_AUDIO_PROFILE (profile));
+
+  id = gm_audio_profile_get_id (profile);
+  GST_DEBUG ("forgotten id: %s", id);
+
+  model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo));
+
+  if (!gtk_tree_model_get_iter_first (model, &iter))
+    return;
+
+  while (1)
+    {
+      gtk_tree_model_get (model, &iter, ID_COLUMN, &tmp, -1);
+      if (g_str_equal (tmp, id))
+	{
+	  gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
+	  g_free (tmp);
+	  return;
+	}
+      g_free (tmp);
+
+      if (!gtk_tree_model_iter_next (model, &iter))
+	break;
+    }
+}
+
 /* create and return a new Profile Choose combobox widget
  * given the GConf connection
  */
@@ -54,6 +93,8 @@
   /* Create the model */
   list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING);
   orig = profiles = gm_audio_profile_get_active_list ();
+  combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (list_store));
+
   while (profiles) {
     GMAudioProfile *profile = profiles->data;
     char *profile_name, *temp_file_name;
@@ -69,11 +110,13 @@
                         NAME_COLUMN, profile_name,
                         ID_COLUMN, gm_audio_profile_get_id (profile),
                         -1);
+
+    g_signal_connect (profile, "forgotten", G_CALLBACK (audio_profile_forgotten), combo);
+
     profiles = profiles->next;
     g_free (profile_name);
   }
   g_list_free (orig);
-  combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (list_store));
 
   /* display name in the combobox */
   renderer = gtk_cell_renderer_text_new ();
@@ -86,6 +129,7 @@
 
   /* activate first one */
   gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
+
   return combo;
 }
 

Modified: trunk/profiles/audio-profile-edit.c
==============================================================================
--- trunk/profiles/audio-profile-edit.c	(original)
+++ trunk/profiles/audio-profile-edit.c	Sat Mar 22 21:21:29 2008
@@ -19,17 +19,21 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <string.h>
 #include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <glade/glade-xml.h>
+#include <libgnomeui/gnome-help.h>
+#include <gst/gst.h>
+
 #include "gmp-util.h"
 #include "audio-profile-edit.h"
 #include "audio-profile.h"
 #include "audio-profile-private.h"
-#include <gtk/gtk.h>
-#include <glade/glade-xml.h>
-#include <libgnomeui/gnome-help.h>
 
 struct _GMAudioProfileEditPrivate
 {
@@ -292,12 +296,12 @@
 {
   char *s;
 
-  GMP_DEBUG("entry_set_text_if_changed on entry %p with text %s\n", entry, text);
+  GST_DEBUG ("entry_set_text_if_changed on entry %p with text %s\n", entry, text);
   s = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
-  GMP_DEBUG("got editable text %s\n", s);
+  GST_DEBUG ("got editable text %s\n", s);
   if (text && strcmp (s, text) != 0)
     gtk_entry_set_text (GTK_ENTRY (entry), text);
-  GMP_DEBUG("entry_set_text_if_changed: got %s\n", s);
+  GST_DEBUG ("entry_set_text_if_changed: got %s\n", s);
 
   g_free (s);
 }
@@ -308,14 +312,14 @@
   char *s;
   GtkTextBuffer *tb;
 
-  GMP_DEBUG("textview_set_text_if_changed on textview %p with text %s\n",
+  GST_DEBUG ("textview_set_text_if_changed on textview %p with text %s\n",
 	    view, text);
   tb = gtk_text_view_get_buffer (view);
   g_object_get (G_OBJECT (tb), "text", &s, NULL);
-  GMP_DEBUG("got textview text %s\n", s);
+  GST_DEBUG ("got textview text %s\n", s);
   if (s && strcmp (s, text) != 0)
     g_object_set (G_OBJECT (tb), "text", text, NULL);
-  GMP_DEBUG("textview_set_text_if_changed: got %s\n", s);
+  GST_DEBUG ("textview_set_text_if_changed: got %s\n", s);
 
   g_free (s);
 }
@@ -329,7 +333,7 @@
 
   s = g_strdup_printf (_("Editing profile \"%s\""),
                        gm_audio_profile_get_name (profile));
-  GMP_DEBUG("g_p_e_u_n: title %s\n", s);
+  GST_DEBUG ("g_p_e_u_n: title %s\n", s);
 
   gtk_window_set_title (GTK_WINDOW (dialog), s);
 

Modified: trunk/profiles/audio-profile-private.h
==============================================================================
--- trunk/profiles/audio-profile-private.h	(original)
+++ trunk/profiles/audio-profile-private.h	Sat Mar 22 21:21:29 2008
@@ -22,12 +22,13 @@
 #ifndef AUDIO_PROFILE_PRIVATE_H
 #define AUDIO_PROFILE_PRIVATE_H
 
-#include "audio-profile.h"
 #include <gconf/gconf-client.h>
-#include "gmp-conf.h"
 #include <glade/glade.h>
 #include <glade/glade-build.h>
 
+#include "gmp-conf.h"
+#include "audio-profile.h"
+
 G_BEGIN_DECLS
 
 GMAudioProfile*	gm_audio_profile_new		(const char *name,

Modified: trunk/profiles/audio-profile.c
==============================================================================
--- trunk/profiles/audio-profile.c	(original)
+++ trunk/profiles/audio-profile.c	Sat Mar 22 21:21:29 2008
@@ -20,9 +20,9 @@
  */
 
 #include <string.h>
+#include <glib/gi18n.h>
 #include <gst/gst.h>
 
-#include <glib/gi18n.h>
 #include "gmp-util.h"
 #include "audio-profile.h"
 #include "audio-profile-private.h"
@@ -218,13 +218,13 @@
   gboolean need_new_default;
   GMAudioProfile *fallback;
 
-  GMP_DEBUG("sync_list: start\n");
+  GST_DEBUG ("sync_list: start\n");
   if (use_this_list)
-    GMP_DEBUG("Using given list of length %d\n", g_slist_length (this_list));
+    GST_DEBUG ("Using given list of length %d\n", g_slist_length (this_list));
   else
-    GMP_DEBUG("using list from gconf\n");
+    GST_DEBUG ("using list from gconf\n");
   known = gm_audio_profile_get_list ();
-    GMP_DEBUG("list of known profiles: size %d\n", g_list_length (known));
+    GST_DEBUG ("list of known profiles: size %d\n", g_list_length (known));
 
   if (use_this_list)
     {
@@ -244,7 +244,7 @@
         }
     }
 
-  GMP_DEBUG("updated: slist of %d items\n", g_slist_length (updated));
+  GST_DEBUG ("updated: slist of %d items\n", g_slist_length (updated));
   /* Add any new ones; ie go through updated and if any of them isn't in
    * the hash yet, add it.  If it is in the list of known profiles,  remove
    * it from our copy of that list. */
@@ -258,7 +258,7 @@
       if (link)
         {
           /* make known point to profiles we didn't find in the list */
-          GMP_DEBUG("id %s found in known profiles list, deleting from known\n",
+          GST_DEBUG ("id %s found in known profiles list, deleting from known\n",
                     (char *) tmp_slist->data);
           known = g_list_delete_link (known, link);
         }
@@ -266,7 +266,7 @@
         {
           GMAudioProfile *profile;
 
-          GMP_DEBUG("adding new profile with id %s to global hash\n",
+          GST_DEBUG ("adding new profile with id %s to global hash\n",
                    (const char *) tmp_slist->data);
           profile = gm_audio_profile_new (tmp_slist->data, _conf);
 
@@ -292,7 +292,7 @@
 
       forgotten = GM_AUDIO_PROFILE (tmp_list->data);
 
-      GMP_DEBUG("sync_list: forgetting profile with id %s\n",
+      GST_DEBUG ("sync_list: forgetting profile with id %s\n",
                gm_audio_profile_get_id (forgotten));
       gm_audio_profile_forget (forgotten);
 
@@ -300,7 +300,7 @@
     }
 
   g_list_free (known);
-  GMP_DEBUG("sync_list: stop\n");
+  GST_DEBUG ("sync_list: stop\n");
 
   //FIXME: g_assert (terminal_profile_get_count () > 0);
 }
@@ -318,7 +318,7 @@
   GMAudioProfile *profile;
   GError *err;
 
-  GMP_DEBUG("creating new GMAudioProfile for id %s\n", id);
+  GST_DEBUG ("creating new GMAudioProfile for id %s\n", id);
   g_return_val_if_fail (profiles != NULL, NULL);
   g_return_val_if_fail (gm_audio_profile_lookup (id) == NULL, NULL);
 
@@ -332,7 +332,7 @@
                                                          profile->priv->id);
 
   err = NULL;
-  GMP_DEBUG("loading config from GConf dir %s\n",
+  GST_DEBUG ("loading config from GConf dir %s\n",
            profile->priv->profile_dir);
   gconf_client_add_dir (conf, profile->priv->profile_dir,
                         GCONF_CLIENT_PRELOAD_ONELEVEL,
@@ -345,7 +345,7 @@
     }
 
   err = NULL;
-  GMP_DEBUG("adding notify for GConf profile\n");
+  GST_DEBUG ("adding notify for GConf profile\n");
   profile->priv->notify_id =
     gconf_client_notify_add (conf,
                              profile->priv->profile_dir,
@@ -360,9 +360,9 @@
       g_error_free (err);
     }
 
-  GMP_DEBUG("inserting in hash table done\n");
+  GST_DEBUG ("inserting in hash table done\n");
   g_hash_table_insert (profiles, profile->priv->id, profile);
-  GMP_DEBUG("audio_profile_new done\n");
+  GST_DEBUG ("audio_profile_new done\n");
 
   return profile;
 }
@@ -609,7 +609,7 @@
   GMAudioSettingMask mask; /* to keep track of what has changed */
 
   profile = GM_AUDIO_PROFILE (user_data);
-  GMP_DEBUG("profile_change_notify: start in profile with name %s\n",
+  GST_DEBUG ("profile_change_notify: start in profile with name %s\n",
            profile->priv->name);
 
   val = gconf_entry_get_value (entry);
@@ -662,10 +662,10 @@
 
   if (!(gm_audio_setting_mask_is_empty (&mask)))
   {
-    GMP_DEBUG("emit changed\n");
+    GST_DEBUG ("emit changed\n");
     emit_changed (profile, &mask);
   }
-  GMP_DEBUG("PROFILE_CHANGE_NOTIFY: changed stuff\n");
+  GST_DEBUG ("PROFILE_CHANGE_NOTIFY: changed stuff\n");
 }
 
 /* GConf notification callback for profile_list */
@@ -680,7 +680,7 @@
   GSList *string_list;
   GSList *tmp;
 
-  GMP_DEBUG("profile_list changed\n");
+  GST_DEBUG ("profile_list changed\n");
   val = gconf_entry_get_value (entry);
 
   if (val == NULL ||
@@ -917,7 +917,7 @@
 
   if (profiles)
   {
-    GMP_DEBUG("a_p_l: profiles exists, returning hash table lookup of %s\n", id);
+    GST_DEBUG ("a_p_l: profiles exists, returning hash table lookup of %s\n", id);
     return g_hash_table_lookup (profiles, id);
   }
   else
@@ -927,14 +927,14 @@
 void
 gm_audio_profile_forget (GMAudioProfile *profile)
 {
-  GMP_DEBUG("audio_profile_forget: forgetting name %s\n",
+  GST_DEBUG ("audio_profile_forget: forgetting name %s\n",
            gm_audio_profile_get_name (profile));
   if (!profile->priv->forgotten)
   {
     GError *err;
 
     err = NULL;
-    GMP_DEBUG("audio_profile_forget: removing from gconf\n");
+    GST_DEBUG ("audio_profile_forget: removing from gconf\n");
     /* FIXME: remove_dir doesn't actually work.  Either unset all keys
      * manually or use recursive_unset on HEAD */
     gconf_client_remove_dir (profile->priv->conf,
@@ -953,7 +953,7 @@
     g_signal_emit (G_OBJECT (profile), signals[FORGOTTEN], 0);
   }
   else
-    GMP_DEBUG("audio_profile_forget: profile->priv->forgotten\n");
+    GST_DEBUG ("audio_profile_forget: profile->priv->forgotten\n");
 }
 
 gboolean
@@ -991,7 +991,7 @@
   GSList *id_list = NULL;
   GList *tmp;
 
-  GMP_DEBUG("a_p_c: Creating profile for %s\n", name);
+  GST_DEBUG ("a_p_c: Creating profile for %s\n", name);
   /* This is for extra bonus paranoia against CORBA reentrancy */
   //g_object_ref (G_OBJECT (transient_parent));
 #define BAIL_OUT_CHECK() do {                           \
@@ -1002,7 +1002,7 @@
   /* Pick a unique name for storing in gconf (based on visible name) */
   profile_id = gconf_escape_key (name, -1);
   s = g_strdup (profile_id);
-  GMP_DEBUG("profile_id: %s\n", s);
+  GST_DEBUG ("profile_id: %s\n", s);
   i = 0;
   while (gm_audio_profile_lookup (s))
   {
@@ -1075,7 +1075,7 @@
 
   id_list = g_slist_prepend (id_list, g_strdup (profile_id));
 
-  GMP_DEBUG("setting gconf list\n");
+  GST_DEBUG ("setting gconf list\n");
   err = NULL;
   gconf_client_set_list (conf,
                          CONF_GLOBAL_PREFIX"/profile_list",
@@ -1134,12 +1134,12 @@
   */
   if (err)
   {
-    GMP_DEBUG("WARNING: error: %s !\n", err->message);
+    GST_DEBUG ("WARNING: error: %s !\n", err->message);
     *error = err;
   }
 
   //g_object_unref (G_OBJECT (transient_parent));
-  GMP_DEBUG("a_p_c: done\n");
+  GST_DEBUG ("a_p_c: done\n");
   return profile_id;
 }
 
@@ -1180,7 +1180,7 @@
 
   g_list_free (current_profiles);
   err = NULL;
-  GMP_DEBUG("setting profile_list in GConf\n");
+  GST_DEBUG ("setting profile_list in GConf\n");
   gconf_client_set_list (conf,
                          CONF_GLOBAL_PREFIX"/profile_list",
                          GCONF_VALUE_STRING,

Modified: trunk/profiles/audio-profiles-edit.c
==============================================================================
--- trunk/profiles/audio-profiles-edit.c	(original)
+++ trunk/profiles/audio-profiles-edit.c	Sat Mar 22 21:21:29 2008
@@ -19,17 +19,21 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
+#include <gtk/gtk.h>
+#include <glade/glade-xml.h>
+#include <gst/gst.h>
+
 #include "audio-profile.h"
 #include "audio-profile-edit.h"
 #include "audio-profile-private.h"
 #include "gmp-util.h"
 #include "audio-profiles-edit.h"
-#include <gtk/gtk.h>
-#include <glade/glade-xml.h>
 
 #define MANAGE_STOCK_EDIT "manage-edit"
 
@@ -206,7 +210,7 @@
   GList *selected_profiles;
   GtkTreeIter iter;
 
-  GMP_DEBUG("refill_profile_treeview: start\n");
+  GST_DEBUG ("refill_profile_treeview: start\n");
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
   model = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (tree_view)));
 
@@ -223,7 +227,7 @@
   {
     GMAudioProfile *profile = tmp->data;
 
-    GMP_DEBUG("refill: appending profile with name %s\n",
+    GST_DEBUG ("refill: appending profile with name %s\n",
              gm_audio_profile_get_name (profile));
     gtk_list_store_append (model, &iter);
 
@@ -255,7 +259,7 @@
   }
 
   free_profiles_list (selected_profiles);
-  GMP_DEBUG("refill_profile_treeview: stop\n");
+  GST_DEBUG ("refill_profile_treeview: stop\n");
 }
 
 
@@ -544,7 +548,7 @@
 static void
 on_gm_audio_profiles_edit_destroy (GtkWidget *dialog, gpointer *user_data)
 {
-      GMP_DEBUG("on_destroy: destroying dialog widget\n");
+      GST_DEBUG ("on_destroy: destroying dialog widget\n");
   /* FIXME: set stuff to NULL here */
 }
 
@@ -559,7 +563,7 @@
   GMAudioProfilesEdit *dialog;
 
   dialog = (GMAudioProfilesEdit *) user_data;
-  GMP_DEBUG("profile_list changed, notified from gconf, redrawing\n");
+  GST_DEBUG ("profile_list changed, notified from gconf, redrawing\n");
   /* refill the profile tree view */
 
   refill_profile_treeview (dialog->priv->manage_profiles_list);
@@ -775,7 +779,7 @@
   /* subscribe to changes to profile list */
 /*
   err = NULL;
-  GMP_DEBUG("gap_p_e_new: subscribing to profile_list changes\n");
+  GST_DEBUG ("gap_p_e_new: subscribing to profile_list changes\n");
   gconf_client_notify_add (dialog->priv->conf,
                            CONF_GLOBAL_PREFIX"/profile_list",
                            gm_audio_profiles_list_notify,
@@ -861,7 +865,7 @@
     gtk_widget_destroy (new_profile_dialog);
 
     /* FIXME: hm, not very proud of having to unstatic this function */
-    GMP_DEBUG("new profile callback: syncing list\n");
+    GST_DEBUG ("new profile callback: syncing list\n");
     //FIXME: in gnome-terminal, it's TRUE, &n, which then gets overruled
     // by some other sync call with the new list
     //audio_profile_sync_list (TRUE, &n);
@@ -880,7 +884,7 @@
   {
     gtk_widget_destroy (new_profile_dialog);
   }
-  GMP_DEBUG("done creating new profile\n");
+  GST_DEBUG ("done creating new profile\n");
 }
 
 static void

Modified: trunk/profiles/gmp-util.c
==============================================================================
--- trunk/profiles/gmp-util.c	(original)
+++ trunk/profiles/gmp-util.c	Sat Mar 22 21:21:29 2008
@@ -19,12 +19,16 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "config.h"
-#include "gmp-util.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <glade/glade-xml.h>
 
+#include "gmp-util.h"
+
 GladeXML*
 gmp_util_load_glade_file (const char *filename,
                           const char *widget_root,

Modified: trunk/profiles/gmp-util.h
==============================================================================
--- trunk/profiles/gmp-util.h	(original)
+++ trunk/profiles/gmp-util.h	Sat Mar 22 21:21:29 2008
@@ -19,7 +19,10 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 
@@ -36,11 +39,3 @@
 void
 gmp_util_run_error_dialog (GtkWindow *transient_parent,
                            const char *message_format, ...);
-
-#ifdef DEBUG
-#define GMP_DEBUG(...) G_STMT_START{ \
-  { g_print ("DEBUG: "); g_print (__VA_ARGS__); } \
-  } G_STMT_END
-#else
-#define GMP_DEBUG(...)
-#endif

Modified: trunk/profiles/gnome-audio-profiles-properties.c
==============================================================================
--- trunk/profiles/gnome-audio-profiles-properties.c	(original)
+++ trunk/profiles/gnome-audio-profiles-properties.c	Sat Mar 22 21:21:29 2008
@@ -19,10 +19,14 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#endif
+
 #include <gtk/gtkmain.h>
 #include <libgnome/gnome-program.h>
 #include <libgnomeui/gnome-ui-init.h>
+
 #include "gnome-media-profiles.h"
 #include "audio-profile-private.h"
 

Modified: trunk/profiles/gnome-audio-profiles-test.c
==============================================================================
--- trunk/profiles/gnome-audio-profiles-test.c	(original)
+++ trunk/profiles/gnome-audio-profiles-test.c	Sat Mar 22 21:21:29 2008
@@ -18,11 +18,15 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <gtk/gtk.h>
-#include <gst/gst.h>
 #include <gconf/gconf-client.h>
 #include <libgnomeui/libgnomeui.h>
+#include <gst/gst.h>
+
 #include <profiles/gnome-media-profiles.h>
 
 static void

Modified: trunk/profiles/gnome-media-profiles.c
==============================================================================
--- trunk/profiles/gnome-media-profiles.c	(original)
+++ trunk/profiles/gnome-media-profiles.c	Sat Mar 22 21:21:29 2008
@@ -23,16 +23,17 @@
 #include <config.h>
 #endif
 
-#include "audio-profile-private.h"
-#include "audio-profile-edit.h"
-#include "gmp-conf.h"
-#include "gmp-util.h"
 #include <glade/glade.h>
 #include <glade/glade-build.h>
 #include <string.h>
 #include <glib/gi18n.h>
 #include <gconf/gconf-client.h>
 
+#include "audio-profile-private.h"
+#include "audio-profile-edit.h"
+#include "gmp-conf.h"
+#include "gmp-util.h"
+
 void
 gtk_dialog_build_children (GladeXML *self, GtkWidget *w,
 			  GladeWidgetInfo *info)



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