[maemo-commits] [maemo-commits] r12869 - in projects/haf/trunk/hildon-home-webshortcut: . plugin

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jul 27 11:33:28 EEST 2007
Author: jobi
Date: 2007-07-27 11:33:27 +0300 (Fri, 27 Jul 2007)
New Revision: 12869

Modified:
   projects/haf/trunk/hildon-home-webshortcut/ChangeLog
   projects/haf/trunk/hildon-home-webshortcut/plugin/hildon-home-webshortcut.c
Log:

2007-06-27  Johan Bilien  <johan.bilien at nokia.com>

	* plugin/hildon-home-webshortcut.c:
	- added _set_uri
	- use hildon_uri to check if the uri is valid.
	Fixes: NB#48685



Modified: projects/haf/trunk/hildon-home-webshortcut/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-home-webshortcut/ChangeLog	2007-07-27 08:14:43 UTC (rev 12868)
+++ projects/haf/trunk/hildon-home-webshortcut/ChangeLog	2007-07-27 08:33:27 UTC (rev 12869)
@@ -1,6 +1,13 @@
 2007-06-27  Johan Bilien  <johan.bilien at nokia.com>
 
 	* plugin/hildon-home-webshortcut.c:
+	- added _set_uri
+	- use hildon_uri to check if the uri is valid.
+	Fixes: NB#48685
+
+2007-06-27  Johan Bilien  <johan.bilien at nokia.com>
+
+	* plugin/hildon-home-webshortcut.c:
 	- fixed expose event, use the offsets in case of double buffering
 	* plugin/hildon-home-webshortcut.h:
 	- removed wrong include

Modified: projects/haf/trunk/hildon-home-webshortcut/plugin/hildon-home-webshortcut.c
===================================================================
--- projects/haf/trunk/hildon-home-webshortcut/plugin/hildon-home-webshortcut.c	2007-07-27 08:14:43 UTC (rev 12868)
+++ projects/haf/trunk/hildon-home-webshortcut/plugin/hildon-home-webshortcut.c	2007-07-27 08:33:27 UTC (rev 12869)
@@ -313,6 +313,44 @@
 }
 
 static void
+hhws_set_uri (Hhws *hhws, const gchar *uri)
+{
+  HhwsPrivate  *priv = hhws->priv;
+  GSList       *actions         = NULL;
+  GError       *error           = NULL;
+
+  if (!g_strrstr (uri, ":"))
+  {
+    /* No : in the URL, adding http:// */
+    gchar *http_url = g_strconcat("http://", uri, NULL);
+
+    g_free (priv->uri);
+    priv->uri = http_url;
+
+    return;
+  }
+
+  actions = hildon_uri_get_actions_by_uri (uri,
+                                           HILDON_URI_ACTION_NEUTRAL,
+                                           &error);
+
+  if (error)
+  {
+    hhws_show_information_note (hhws, HHWS_INVALID_URL);
+    g_error_free (error);
+  }
+  else
+  {
+    g_free (priv->uri);
+    priv->uri = g_strdup (uri);
+  }
+
+  if (actions)
+    hildon_uri_free_actions (actions);
+
+}
+
+static void
 hhws_load_configuration (Hhws *hhws)
 {
   HhwsPrivate  *priv = hhws->priv;
@@ -497,18 +535,7 @@
               hhws_apply_and_save_background (hhws, background);
               g_object_unref (background);
 
-              g_free (priv->uri);
-
-              if (!g_strrstr (new_url_str, ":"))
-                {
-                  /* No : in the URL, adding http:// */
-                  gchar *http_url = g_strconcat("http://", new_url_str, NULL);
-
-                  priv->uri = http_url;
-                }
-              else
-                priv->uri = g_strdup (new_url_str);
-
+              hhws_set_uri (hhws, new_url_str);
               hhws_save_configuration (hhws);
 
               g_free (priv->selected_image_uri);


More information about the maemo-commits mailing list