зеркало из https://github.com/mozilla/gecko-dev.git
Bug 805202 - Depend on GIO 2.20 and directly call g_app_info_get_commandline() r=karlt
This commit is contained in:
Родитель
3a00ca73a2
Коммит
71fc6e1a14
|
@ -70,7 +70,7 @@ 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
|
||||
|
|
|
@ -9,14 +9,11 @@
|
|||
#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)
|
||||
{
|
||||
|
@ -71,24 +68,10 @@ nsGIOMimeApp::GetName(nsACString& aName)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче