[maemo-commits] [maemo-commits] r12386 - in projects/haf/trunk/libhildonmime: . debian libhildonmime tests

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jun 19 16:20:19 EEST 2007
Author: martyn
Date: 2007-06-19 16:20:11 +0300 (Tue, 19 Jun 2007)
New Revision: 12386

Modified:
   projects/haf/trunk/libhildonmime/ChangeLog
   projects/haf/trunk/libhildonmime/debian/changelog
   projects/haf/trunk/libhildonmime/libhildonmime/hildon-uri.c
   projects/haf/trunk/libhildonmime/tests/test-all.c
Log:
	* libhildonmime/hildon-uri.c: (hildon_uri_open): Fixed call to
	_get_actions_by_uri() here which was using the scheme instead of
	the uri. Well spotted Richard.

	* tests/test-all.c: (test_get_actions), (test_failure_conditions):
	Test the bug we just fixed is handled properly by trying to use
	just a scheme and a non-valid scheme in the _get_actions_by_uri()
	call.


Modified: projects/haf/trunk/libhildonmime/ChangeLog
===================================================================
--- projects/haf/trunk/libhildonmime/ChangeLog	2007-06-19 13:04:28 UTC (rev 12385)
+++ projects/haf/trunk/libhildonmime/ChangeLog	2007-06-19 13:20:11 UTC (rev 12386)
@@ -1,3 +1,14 @@
+2007-06-19  Martyn Russell  <martyn at imendio.com>
+
+	* libhildonmime/hildon-uri.c: (hildon_uri_open): Fixed call to
+	_get_actions_by_uri() here which was using the scheme instead of
+	the uri. Well spotted Richard.
+	
+	* tests/test-all.c: (test_get_actions), (test_failure_conditions):
+	Test the bug we just fixed is handled properly by trying to use
+	just a scheme and a non-valid scheme in the _get_actions_by_uri()
+	call. 
+
 2007-06-18  Martyn Russell  <martyn at imendio.com>
 
 	* configure.in:

Modified: projects/haf/trunk/libhildonmime/debian/changelog
===================================================================
--- projects/haf/trunk/libhildonmime/debian/changelog	2007-06-19 13:04:28 UTC (rev 12385)
+++ projects/haf/trunk/libhildonmime/debian/changelog	2007-06-19 13:20:11 UTC (rev 12386)
@@ -2,6 +2,7 @@
 
   * UNRELEASED!
   * Updated action filter function to sort by action type.
+  * Fixed hildon_uri_open() call to  _get_actions_by_uri() with uri not scheme.
   * Fixed hildon_uri_open() to use _by_uri() API when getting default action.
   * Fixed test-uri -u option which was using old API.
 

Modified: projects/haf/trunk/libhildonmime/libhildonmime/hildon-uri.c
===================================================================
--- projects/haf/trunk/libhildonmime/libhildonmime/hildon-uri.c	2007-06-19 13:04:28 UTC (rev 12385)
+++ projects/haf/trunk/libhildonmime/libhildonmime/hildon-uri.c	2007-06-19 13:20:11 UTC (rev 12386)
@@ -63,8 +63,8 @@
 #define APP_LAUNCH_BANNER_METHOD              "app_launch_banner"
 
 
-/* #define DEBUG_MSG(x)  */
-#define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n"); 
+#define DEBUG_MSG(x)  
+/* #define DEBUG_MSG(args) g_printerr args ; g_printerr ("\n");  */
 
 /* The ID is the group name in the desktop file for this
  * action, the domain is the translation domain used for the
@@ -2274,7 +2274,7 @@
 			 * an error further down, we want to use it
 			 * for that.
 			 */
-			actions = hildon_uri_get_actions_by_uri (scheme, -1, NULL);
+			actions = hildon_uri_get_actions_by_uri (uri, -1, NULL);
 
 			/* At this stage we choose the first action
 			 * available from the long list picked up in

Modified: projects/haf/trunk/libhildonmime/tests/test-all.c
===================================================================
--- projects/haf/trunk/libhildonmime/tests/test-all.c	2007-06-19 13:04:28 UTC (rev 12385)
+++ projects/haf/trunk/libhildonmime/tests/test-all.c	2007-06-19 13:20:11 UTC (rev 12386)
@@ -180,14 +180,14 @@
 	/* Another one, just proves that you can get the action for a plugin
 	 * that adds a scheme, even though the same app handles the service.
 	 */
-	g_print ("For testplugin\n");
+	g_print ("For testplugin scheme\n");
 	actions = hildon_uri_get_actions ("testplugin", NULL);
 	assert_int (g_slist_length (actions), 1);
 	action = actions->data;
 	hildon_uri_free_actions (actions);
 
 	/* Test the fields in the action. */
-	g_print ("Test fields in the action\n");
+	g_print ("For test-action-fields scheme\n");
 	actions = hildon_uri_get_actions ("test-action-fields", NULL);
 	assert_int (g_slist_length (actions), 1);
 	action = actions->data;
@@ -197,7 +197,7 @@
 	hildon_uri_free_actions (actions);
 	
 	/* Test the fields in the action, service is specifed in the action. */
-	g_print ("Test fields in another action\n");
+	g_print ("For test-action-fields2 scheme\n");
 	actions = hildon_uri_get_actions ("test-action-fields2", NULL);
 	assert_int (g_slist_length (actions), 1);
 	action = actions->data;
@@ -279,6 +279,12 @@
 	actions = hildon_uri_get_actions_by_uri (NULL, -1, NULL);
 	assert_expr (actions == NULL);
 
+	actions = hildon_uri_get_actions_by_uri ("foo", -1, NULL);
+	assert_expr (actions == NULL);
+
+	actions = hildon_uri_get_actions_by_uri ("http", -1, NULL);
+	assert_expr (actions == NULL);
+
 	/* Misc functions */
 	str = hildon_uri_get_scheme_from_uri (NULL, NULL);
 	assert_expr (str == NULL);
@@ -337,8 +343,6 @@
 	unlink (TEST_DATADIR "-local/applications/uri-action-defaults.list");
 
 	/* The browser should be the default for http. */
-	g_print ("For http\n");
-
 	uri_str = "http://www.nokia.com/index.html";
 	actions = hildon_uri_get_actions_by_uri (uri_str, -1, NULL);
 	assert_int (g_slist_length (actions), 4);
@@ -401,7 +405,6 @@
 	unlink (TEST_DATADIR "-local/applications/uri-action-defaults.list");
 
 	/* The browser should be the default for http. */
-	g_print ("For http\n");
 	actions = hildon_uri_get_actions_by_uri ("http://www.imendio.com/index.html", -1, NULL);
 	assert_int (g_slist_length (actions), 4);
 


More information about the maemo-commits mailing list