]> spindle.queued.net Git - midori/commitdiff
Show mismatching build version suffix for extensions
authorChristian Dywan <christian@twotoasts.de>
Tue, 8 Nov 2011 00:53:53 +0000 (01:53 +0100)
committerChristian Dywan <christian@twotoasts.de>
Tue, 8 Nov 2011 00:53:53 +0000 (01:53 +0100)
MIDORI_VERSION_SUFFIX resolves to a string that needs to be
added to each extension's version at build time. If it is
different than the running Midori's, it is shown in the
extension list.

19 files changed:
extensions/adblock.c
extensions/addons.c
extensions/colorful-tabs.c
extensions/cookie-manager/main.c
extensions/copy-tabs.c
extensions/feed-panel/main.c
extensions/formhistory.c
extensions/history-list.vala
extensions/mouse-gestures.c
extensions/shortcuts.c
extensions/status-clock.c
extensions/statusbar-features.c
extensions/tab-panel.c
extensions/tabs-minimized.c
extensions/toolbar-editor.c
extensions/web-cache.c
midori/midori-extension.c
midori/midori.vapi
wscript

index a72c5da5b89591e8609cec78b6668e9687360f5c..a68bf0ad91742535fc0529e66e6722b576f90b02 100644 (file)
@@ -1483,7 +1483,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Advertisement blocker"),
         "description", _("Block advertisements according to a filter list"),
-        "version", "0.5",
+        "version", "0.5" MIDORI_VERSION_SUFFIX,
         "authors", "Christian Dywan <christian@twotoasts.de>",
         NULL);
     midori_extension_install_string_list (extension, "filters", NULL, G_MAXSIZE);
index f23e042958cfcfca0dbbb1dbc1122c19b34ec2fa..dee4206d49a25166415e1d946f98580367975054 100644 (file)
@@ -1889,7 +1889,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("User addons"),
         "description", _("Support for userscripts and userstyles"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "Arno Renevier <arno@renevier.net>",
         NULL);
     g_signal_connect (extension, "activate",
index 1726e290d5140405601622079caaeda744ed0235..c00122f8802c245bce26f275be745cf6893dda4f 100644 (file)
@@ -201,7 +201,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Colorful Tabs"),
         "description", _("Tint each tab distinctly"),
-        "version", "0.5",
+        "version", "0.5" MIDORI_VERSION_SUFFIX,
         "authors", "Christian Dywan <christian@twotoasts.de>, Samuel Creshal <creshal@arcor.de>",
         NULL);
 
index 81391db0abfd40f4ba19e36884e0d3d969be4df5..8a72b707b37d65b7aa86b7397e2f1e9f77d4e313 100644 (file)
@@ -34,7 +34,7 @@ MidoriExtension *extension_init(void)
        MidoriExtension *extension = g_object_new(MIDORI_TYPE_EXTENSION,
                "name", _("Cookie Manager"),
                "description", _("List, view and delete cookies"),
-               "version", "0.2",
+               "version", "0.2" MIDORI_VERSION_SUFFIX,
                "authors", "Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>",
                NULL);
 
index 55c4c31551b2f5fe8ceef38381fac742417edad7..636c1197a250db29f5af329f949d2a2785c961d6 100644 (file)
@@ -94,7 +94,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Copy Addresses of Tabs"),
         "description", _("Copy the addresses of all tabs to the clipboard"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "MonkeyOfDoom <pixelmonkey@ensellitis.com>",
         NULL);
 
index 89567d5e57b1f3e7007e32232b7db3d9f5d3fe1c..8cad47a0d1287c7cffa70ea30f8e9844e9f855b2 100644 (file)
@@ -517,7 +517,7 @@ extension_init (void)
     extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Feed Panel"),
         "description", _("Read Atom/ RSS feeds"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "Dale Whittaker <dayul@users.sf.net>",
         NULL);
 
index e5ea71f6bb18eca765947b570c1facb41e8c73e8..76b39c34cf451c6ea2fde28fa91e831871440dff 100644 (file)
@@ -564,7 +564,7 @@ extension_init (void)
 
     if (formhistory_prepare_js ())
     {
-        ver = "1.0";
+        ver = "1.0" MIDORI_VERSION_SUFFIX;
         desc = g_strdup (_("Stores history of entered form data"));
     }
     else
index fc677a4b2d5c4372a834ba91f06c2e683bf35888..44af649f08800a907cd6fffbdee5b7fd5c48b014 100644 (file)
@@ -568,7 +568,7 @@ namespace HistoryList {
         internal Manager () {
             GLib.Object (name: _("History List"),
                          description: _("Move to the last used tab when switching or closing tabs"),
-                         version: "0.4",
+                         version: "0.4" + Midori.VERSION_SUFFIX,
                          authors: "André Stösel <andre@stoesel.de>");
 
             this.install_integer ("TabClosingBehavior", TabClosingBehavior.LAST);
index bbe38b49d4e736b13e80af750ff7c5d5cf4e9964..b1f5b28ee849e0af266719a8b3dfe162bc30e398 100644 (file)
@@ -300,7 +300,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Mouse Gestures"),
         "description", _("Control Midori by moving the mouse"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "Matthias Kruk <mkruk@matthiaskruk.de>", NULL);
     midori_extension_install_integer (extension, "button", MOUSE_BUTTON_RIGHT);
 
index 85cb80856a4b61693e9a8d3fbd407f9461da4b01..552f169438fceb77b8f3fbe2fb0dea79bb38192e 100644 (file)
@@ -321,7 +321,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Shortcuts"),
         "description", _("View and edit keyboard shortcuts"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "Christian Dywan <christian@twotoasts.de>",
         NULL);
 
index 68bf1f2cef46fadad1f2c17376e9afd311029e0e..639f2ff4229238cff081eb7ef487b8c04592240a 100644 (file)
@@ -173,7 +173,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Statusbar Clock"),
         "description", _("Display date and time in the statusbar"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "Arno Renevier <arno@renevier.net>",
         NULL);
     midori_extension_install_string (extension, "format", DEFAULT_FORMAT);
index 2f0ee996da3600ffb9e76ce57d64c3bd59806e9a..76ca2d3b9a1d01cb02361402181274bbbabcc773 100644 (file)
@@ -191,7 +191,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Statusbar Features"),
         "description", _("Easily toggle features on web pages on and off"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "Christian Dywan <christian@twotoasts.de>",
         NULL);
 
index ce33af079f65cc65dcf608017be15f2848255232..fa54bdf537069caa8670ac294d4aa60bc6e654d6 100644 (file)
@@ -682,7 +682,7 @@ extension_init (void)
     extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Tab Panel"),
         "description", _("Show tabs in a vertical panel"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "Christian Dywan <christian@twotoasts.de>",
         NULL);
 
index feccfed5ded6d925ddbc0d8baad5c31ef017aa46..0e097865d759c027562848e3823ca40cbf732df7 100644 (file)
@@ -75,7 +75,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Only Icons on Tabs by default"),
         "description", _("New tabs have no label by default"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "MonkeyOfDoom <pixelmonkey@ensellitis.com>",
         NULL);
 
index b1fbaf0ac2d2dfe235b8ec0ede65ac142fbc15b2..6d3e10a3eaf4fbeae89f63c8d4d3ffc5e2cfabd3 100644 (file)
@@ -630,7 +630,7 @@ MidoriExtension *extension_init(void)
        MidoriExtension* extension = g_object_new(MIDORI_TYPE_EXTENSION,
                "name", _("Toolbar Editor"),
                "description", _("Easily edit the toolbar layout"),
-               "version", "0.1",
+               "version", "0.1" MIDORI_VERSION_SUFFIX,
                "authors", "Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>",
                NULL);
 
index a5ae6cdc4287962b36ae6a48bfd80d501feeeda3..a3e592bfc9ca7196b8ccfe1888700abf9d7996af 100644 (file)
@@ -461,7 +461,7 @@ extension_init (void)
     MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
         "name", _("Web Cache"),
         "description", _("Cache HTTP communication on disk"),
-        "version", "0.1",
+        "version", "0.1" MIDORI_VERSION_SUFFIX,
         "authors", "Christian Dywan <christian@twotoasts.de>",
         NULL);
 
index 3a5cbd1373bbb45e9d2cb32123e226f61ad8255c..d4244b9cd74a9d2c0a72c62830b3bccd77655d3f 100644 (file)
@@ -425,8 +425,21 @@ midori_extension_set_property (GObject*      object,
         katze_assign (extension->priv->description, g_value_dup_string (value));
         break;
     case PROP_VERSION:
-        katze_assign (extension->priv->version, g_value_dup_string (value));
+    {
+        /* Don't show version suffix if it matches the running Midori */
+        const gchar* version = g_value_get_string (value);
+        if (g_str_has_suffix (version, MIDORI_VERSION_SUFFIX))
+            katze_assign (extension->priv->version,
+                g_strndup (version,
+                           strlen (version) - strlen (MIDORI_VERSION_SUFFIX)));
+        /* No version suffix at all, must be 0.4.1 or 0.4.1 git */
+        else if (!strchr (version, '-') && !strchr (version, '('))
+            katze_assign (extension->priv->version,
+                g_strconcat (version, " (0.4.1)", NULL));
+        else
+            katze_assign (extension->priv->version, g_strdup (version));
         break;
+    }
     case PROP_AUTHORS:
         katze_assign (extension->priv->authors, g_value_dup_string (value));
         break;
index e2052c144857eda7d328eb61bb4ec44a7f24134e..0f92c1f4ebe7799dd3f3a8630a7f4f7fd4a6fdf5 100644 (file)
@@ -3,6 +3,8 @@
 
 [CCode (cprefix = "Midori", lower_case_cprefix = "midori_")]
 namespace Midori {
+    public const string VERSION_SUFFIX;
+
     [CCode (cheader_filename = "midori/midori.h")]
     public class App : GLib.Object {
         public App ();
diff --git a/wscript b/wscript
index 584571e566e2f1d40aca7ec3333cd05c757eaa3f..d717a3aad6014aa6e22699aa9f43f421a648a5c5 100644 (file)
--- a/wscript
+++ b/wscript
@@ -33,12 +33,14 @@ micro = 1
 
 APPNAME = 'midori'
 VERSION = VERSION_FULL = str (major) + '.' + str (minor) + '.' + str (micro)
+VERSION_SUFFIX = ' (%s)' % VERSION
 
 try:
     if os.path.isdir ('.git'):
         git = Utils.cmd_output (['git', 'describe'], silent=True)
         if git:
             VERSION_FULL = git.strip ()
+            VERSION_SUFFIX = VERSION_FULL.replace (VERSION, '')
 except:
     pass
 
@@ -300,8 +302,10 @@ def configure (conf):
 
     if debug_level == 'full':
         conf.define ('PACKAGE_VERSION', '%s (debug)' % VERSION_FULL)
+        conf.env.append_value ('CCFLAGS', '-DMIDORI_VERSION_SUFFIX="%s (debug)"' % VERSION_SUFFIX)
     else:
         conf.define ('PACKAGE_VERSION', VERSION_FULL)
+        conf.env.append_value ('CCFLAGS', '-DMIDORI_VERSION_SUFFIX="%s"' % VERSION_SUFFIX)
     conf.write_config_header ('config.h')
 
     if compiler == 'gcc':