Bug 805202 - Depend on GIO 2.20 and directly call g_app_info_get_commandline() r=karlt
authorLandry Breuil <landry@openbsd.org>
Sat, 27 Oct 2012 00:38:43 +0200
changeset 111706 a4e9d21b8ca8a36a5d5dc0230fc6757052a86bc6
parent 111705 a94c45bf8d2482160c6402cd4a0b6d2013c74ab5
child 111707 4b8cc8b4db5e124ac15b5f2e4c055777c02e59b3
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewerskarlt
bugs805202
milestone19.0a1
Bug 805202 - Depend on GIO 2.20 and directly call g_app_info_get_commandline() r=karlt
configure.in
toolkit/system/gnome/nsGIOService.cpp
--- a/configure.in
+++ b/configure.in
@@ -65,17 +65,17 @@ PERL_VERSION=5.006
 CAIRO_VERSION=1.10
 PANGO_VERSION=1.14.0
 GTK2_VERSION=2.10.0
 WINDRES_VERSION=2.14.90
 W32API_VERSION=3.14
 GNOMEVFS_VERSION=2.0
 GNOMEUI_VERSION=2.2.0
 GCONF_VERSION=1.2.1
-GIO_VERSION=2.18
+GIO_VERSION=2.20
 STARTUP_NOTIFICATION_VERSION=0.8
 DBUS_VERSION=0.60
 SQLITE_VERSION=3.7.14.1
 
 MSMANIFEST_TOOL=
 
 dnl Set various checks
 dnl ========================================================
--- a/toolkit/system/gnome/nsGIOService.cpp
+++ b/toolkit/system/gnome/nsGIOService.cpp
@@ -4,24 +4,21 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsGIOService.h"
 #include "nsStringAPI.h"
 #include "nsIURI.h"
 #include "nsTArray.h"
 #include "nsIStringEnumerator.h"
 #include "nsAutoPtr.h"
-#include <dlfcn.h>
 
 #include <gio/gio.h>
 #include <gtk/gtk.h>
 
 
-typedef const char* (*get_commandline_t)(GAppInfo*);
-
 char *
 get_content_type_from_mime_type(const char *mimeType)
 {
   GList* contentTypes = g_content_types_get_registered();
   GList* ct_ptr = contentTypes;
   char* foundContentType = NULL;
 
   while (ct_ptr) {
@@ -66,34 +63,20 @@ nsGIOMimeApp::GetName(nsACString& aName)
 {
   aName.Assign(g_app_info_get_name(mApp));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsGIOMimeApp::GetCommand(nsACString& aCommand)
 {
-  get_commandline_t g_app_info_get_commandline_ptr;
-
-  void *libHandle = dlopen("libgio-2.0.so.0", RTLD_LAZY);
-  if (!libHandle) {
+  const char *cmd = g_app_info_get_commandline(mApp);
+  if (!cmd)
     return NS_ERROR_FAILURE;
-  }
-  dlerror(); /* clear any existing error */
-  g_app_info_get_commandline_ptr =
-    (get_commandline_t) dlsym(libHandle, "g_app_info_get_commandline");
-  if (dlerror() == NULL) {
-    const char *cmd = g_app_info_get_commandline_ptr(mApp);
-    if (!cmd) {
-      dlclose(libHandle);
-      return NS_ERROR_FAILURE;
-    }
-    aCommand.Assign(cmd);
-  }
-  dlclose(libHandle);
+  aCommand.Assign(cmd);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsGIOMimeApp::GetExpectsURIs(int32_t* aExpects)
 {
   *aExpects = g_app_info_supports_uris(mApp);
   return NS_OK;