From 031206cf1f9c79577259109246a8bf3fe3530246 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 29 Mar 2012 06:32:30 -0400 Subject: [PATCH] extensionSystem: Remove now-unused version_tag, clean up other code as well https://bugzilla.gnome.org/show_bug.cgi?id=676837 --- browser-plugin/browser-plugin.c | 18 ++++-------------- js/ui/extensionSystem.js | 15 +++++---------- js/ui/shellDBus.js | 5 ++--- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/browser-plugin/browser-plugin.c b/browser-plugin/browser-plugin.c index 7f4cad871..2676beb22 100644 --- a/browser-plugin/browser-plugin.c +++ b/browser-plugin/browser-plugin.c @@ -41,7 +41,7 @@ "It can be used only by extensions.gnome.org" #define PLUGIN_MIME_STRING "application/x-gnome-shell-integration::Gnome Shell Integration Dummy Content-Type"; -#define PLUGIN_API_VERSION 3 +#define PLUGIN_API_VERSION 4 typedef struct { GDBusProxy *proxy; @@ -548,11 +548,9 @@ plugin_enable_extension (PluginObject *obj, static gboolean plugin_install_extension (PluginObject *obj, - NPString uuid, - NPString version_tag) + NPString uuid) { gchar *uuid_str = g_strndup (uuid.UTF8Characters, uuid.UTF8Length); - gchar *version_tag_str; if (!uuid_is_valid (uuid_str)) { @@ -560,14 +558,9 @@ plugin_install_extension (PluginObject *obj, return FALSE; } - version_tag_str = g_strndup (version_tag.UTF8Characters, - version_tag.UTF8Length); - g_dbus_proxy_call (obj->proxy, "InstallRemoteExtension", - g_variant_new ("(ss)", - uuid_str, - version_tag_str), + g_variant_new ("(s)", uuid_str), G_DBUS_CALL_FLAGS_NONE, -1, /* timeout */ NULL, /* cancellable */ @@ -575,7 +568,6 @@ plugin_install_extension (PluginObject *obj, NULL /* user_data */); g_free (uuid_str); - g_free (version_tag_str); return TRUE; } @@ -804,11 +796,9 @@ plugin_object_invoke (NPObject *npobj, else if (name == install_extension_id) { if (!NPVARIANT_IS_STRING(args[0])) return FALSE; - if (!NPVARIANT_IS_STRING(args[1])) return FALSE; return plugin_install_extension (obj, - NPVARIANT_TO_STRING(args[0]), - NPVARIANT_TO_STRING(args[1])); + NPVARIANT_TO_STRING(args[0])); } else if (name == uninstall_extension_id) { diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index fe092d2a0..abd9551c0 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -69,18 +69,16 @@ const disconnect = Lang.bind(_signals, _signals.disconnect); const ENABLED_EXTENSIONS_KEY = 'enabled-extensions'; -function installExtensionFromUUID(uuid, version_tag) { +function installExtensionFromUUID(uuid) { let params = { uuid: uuid, - version_tag: version_tag, - shell_version: Config.PACKAGE_VERSION, - api_version: API_VERSION.toString() }; + shell_version: Config.PACKAGE_VERSION }; let message = Soup.form_request_new_from_hash('GET', REPOSITORY_URL_INFO, params); _httpSession.queue_message(message, function(session, message) { let info = JSON.parse(message.response_body.data); - let dialog = new InstallExtensionDialog(uuid, version_tag, info.name); + let dialog = new InstallExtensionDialog(uuid, info.name); dialog.open(global.get_current_time()); }); } @@ -389,11 +387,10 @@ const InstallExtensionDialog = new Lang.Class({ Name: 'InstallExtensionDialog', Extends: ModalDialog.ModalDialog, - _init: function(uuid, version_tag, name) { + _init: function(uuid, name) { this.parent({ styleClass: 'extension-dialog' }); this._uuid = uuid; - this._version_tag = version_tag; this._name = name; this.setButtons([{ label: _("Cancel"), @@ -434,9 +431,7 @@ const InstallExtensionDialog = new Lang.Class({ _signals.emit('extension-state-changed', state); - let params = { version_tag: this._version_tag, - shell_version: Config.PACKAGE_VERSION, - api_version: API_VERSION.toString() }; + let params = { shell_version: Config.PACKAGE_VERSION }; let url = REPOSITORY_URL_DOWNLOAD.format(this._uuid); let message = Soup.form_request_new_from_hash('GET', url, params); diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js index 0921d7cef..66e5dfb87 100644 --- a/js/ui/shellDBus.js +++ b/js/ui/shellDBus.js @@ -58,7 +58,6 @@ const GnomeShellIface = - @@ -254,8 +253,8 @@ const GnomeShell = new Lang.Class({ return extension.errors; }, - InstallRemoteExtension: function(uuid, version_tag) { - ExtensionSystem.installExtensionFromUUID(uuid, version_tag); + InstallRemoteExtension: function(uuid) { + ExtensionSystem.installExtensionFromUUID(uuid); }, UninstallExtension: function(uuid) {