seed r85 - trunk/libseed
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r85 - trunk/libseed
- Date: Mon, 3 Nov 2008 10:32:24 +0000 (UTC)
Author: racarr
Date: Mon Nov 3 10:32:23 2008
New Revision: 85
URL: http://svn.gnome.org/viewvc/seed?rev=85&view=rev
Log:
Throw exceptions when GObject properties are set to out of range values.
Modified:
trunk/libseed/seed-engine.c
trunk/libseed/seed-engine.h
Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c (original)
+++ trunk/libseed/seed-engine.c Mon Nov 3 10:32:23 2008
@@ -29,9 +29,11 @@
GParamSpec ** global_prop_cache;
+gchar * glib_message = 0;
+
void seed_make_exception(JSValueRef * exception,
- gchar * name, gchar * message)
+ const gchar * name, const gchar * message)
{
JSStringRef js_name = 0;
JSStringRef js_message = 0;
@@ -562,6 +564,14 @@
}
g_object_set_property(obj, cproperty_name, &gval);
+ if (glib_message != 0)
+ {
+ seed_make_exception(exception, "PropertyError", glib_message);
+
+ g_free(glib_message);
+ glib_message = 0;
+ return FALSE;
+ }
g_free(cproperty_name);
return TRUE;
@@ -852,11 +862,20 @@
seed_value_set_property(obj, name, oref);
}
+static void seed_log_handler (const gchar * domain,
+ GLogLevelFlags log_level,
+ const gchar * message,
+ gpointer user_data)
+{
+ glib_message = g_strdup(message);
+}
+
gboolean seed_init(int * argc, char *** argv)
{
JSObjectRef seed_obj_ref;
g_type_init ();
+ g_log_set_handler("GLib-GObject", G_LOG_LEVEL_WARNING, seed_log_handler, 0);
qname = g_quark_from_static_string("js-type");
qprototype = g_quark_from_static_string("js-prototype");
Modified: trunk/libseed/seed-engine.h
==============================================================================
--- trunk/libseed/seed-engine.h (original)
+++ trunk/libseed/seed-engine.h Mon Nov 3 10:32:23 2008
@@ -43,5 +43,5 @@
void seed_gobject_define_property_from_function_info(GIFunctionInfo *info, JSObjectRef object, gboolean instance);
void seed_create_function(char * name, gpointer func, JSObjectRef obj);
void seed_make_exception(JSValueRef * exception,
- gchar * name, gchar * message);
+ const gchar * name, const gchar * message);
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]