gst_plugins_base/gst-libs/gst/pbutils/install-plugins.c
branchRCL_3
changeset 29 567bb019e3e3
parent 0 0e761a78d257
child 30 7e817e7e631c
--- a/gst_plugins_base/gst-libs/gst/pbutils/install-plugins.c	Wed Mar 31 22:03:18 2010 +0300
+++ b/gst_plugins_base/gst-libs/gst/pbutils/install-plugins.c	Tue Aug 31 15:30:33 2010 +0300
@@ -144,7 +144,7 @@
  * as interlocutor to the real installer though, even more so if command line
  * argument munging is required to transform the command line arguments
  * passed by GStreamer to the helper application into arguments that are
- * understood by the reeal installer.
+ * understood by the real installer.
  * </para>
  * <para>
  * The helper application path defined at compile time can be overriden at
@@ -355,7 +355,7 @@
 #endif
 
 #ifdef __SYMBIAN32__
-#include <gst_global.h>
+#include <gst/gst_global.h>
 #endif
 
 #include "install-plugins.h"
@@ -370,6 +370,8 @@
 #include <sys/wait.h>
 #endif
 
+#include <string.h>
+
 /* best effort to make things compile and possibly even work on win32 */
 #ifndef WEXITSTATUS
 # define WEXITSTATUS(status) ((((guint)(status)) & 0xff00) >> 8)
@@ -393,8 +395,9 @@
  *
  * This function is for X11-based applications (such as most Gtk/Qt
  * applications on linux/unix) only. You can use it to tell the external
- * the XID of your main application window, so the installer can make its
- * own window transient to your application windonw during the installation.
+ * installer the XID of your main application window. That way the installer
+ * can make its own window transient to your application window during the
+ * installation.
  *
  * If set, the XID will be passed to the installer via a --transient-for=XID
  * command line option.
@@ -509,6 +512,18 @@
 }
 
 static gboolean
+ptr_array_contains_string (GPtrArray * arr, const gchar * s)
+{
+  gint i;
+
+  for (i = 0; i < arr->len; ++i) {
+    if (strcmp ((const char *) g_ptr_array_index (arr, i), s) == 0)
+      return TRUE;
+  }
+  return FALSE;
+}
+
+static gboolean
 gst_install_plugins_spawn_child (gchar ** details,
     GstInstallPluginsContext * ctx, GPid * child_pid, gint * exit_status)
 {
@@ -528,9 +543,10 @@
     g_ptr_array_add (arr, xid_str);
   }
 
-  /* finally, add the detail strings */
+  /* finally, add the detail strings, but without duplicates */
   while (details != NULL && details[0] != NULL) {
-    g_ptr_array_add (arr, details[0]);
+    if (!ptr_array_contains_string (arr, details[0]))
+      g_ptr_array_add (arr, details[0]);
     ++details;
   }