]> spindle.queued.net Git - midori/commitdiff
Implement an optional "website" property in MidoriExtension
authorPrzemek Sitek <el.pescado@gazeta.pl>
Fri, 5 Jun 2009 21:38:32 +0000 (23:38 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 5 Jun 2009 21:38:32 +0000 (23:38 +0200)
midori/midori-extension.c

index 9950a0bb1453df8640db7c6cebc6ece25912df05..ece419fdda65108262acf930fac41284286912a8 100644 (file)
@@ -28,6 +28,7 @@ struct _MidoriExtensionPrivate
     gchar* description;
     gchar* version;
     gchar* authors;
+    gchar* website;
 
     MidoriApp* app;
     gint active;
@@ -129,7 +130,8 @@ enum
     PROP_NAME,
     PROP_DESCRIPTION,
     PROP_VERSION,
-    PROP_AUTHORS
+    PROP_AUTHORS,
+    PROP_WEBSITE
 };
 
 enum {
@@ -227,6 +229,22 @@ midori_extension_class_init (MidoriExtensionClass* class)
                                      NULL,
                                      flags));
 
+    /**
+     * MidoriExtension:website:
+     *
+     * The website of the extension.
+     *
+     * Since: 0.1.8
+     */
+    g_object_class_install_property (gobject_class,
+                                     PROP_WEBSITE,
+                                     g_param_spec_string (
+                                     "website",
+                                     "Website",
+                                     "The website of the extension",
+                                     NULL,
+                                     flags));
+
     g_type_class_add_private (class, sizeof (MidoriExtensionPrivate));
 }
 
@@ -346,6 +364,7 @@ midori_extension_finalize (GObject* object)
     katze_assign (extension->priv->description, NULL);
     katze_assign (extension->priv->version, NULL);
     katze_assign (extension->priv->authors, NULL);
+    katze_assign (extension->priv->website, NULL);
 
     katze_assign (extension->priv->config_dir, NULL);
     g_list_free (extension->priv->lsettings);
@@ -376,6 +395,9 @@ midori_extension_set_property (GObject*      object,
     case PROP_AUTHORS:
         katze_assign (extension->priv->authors, g_value_dup_string (value));
         break;
+    case PROP_WEBSITE:
+        katze_assign (extension->priv->website, g_value_dup_string (value));
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
         break;
@@ -404,6 +426,9 @@ midori_extension_get_property (GObject*    object,
     case PROP_AUTHORS:
         g_value_set_string (value, extension->priv->authors);
         break;
+    case PROP_WEBSITE:
+        g_value_set_string (value, extension->priv->website);
+        break;
     default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
         break;