From bece9de31705d57c83822ce3ece6dd24f92b9283 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 8 Oct 2009 18:43:10 -0400 Subject: Making it so that we're not using g_return_if_fail as it messes up the test suite. --- libindicator/indicator-object.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'libindicator') diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index afeaf19..06ca48f 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -83,14 +83,20 @@ indicator_object_finalize (GObject *object) IndicatorObject * indicator_object_new_from_file (const gchar * file) { - g_return_val_if_fail(file != NULL, NULL); + if (file != NULL) + return NULL; GModule * module = g_module_open(file, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); - g_return_val_if_fail(module != NULL, NULL); + if(module != NULL) { + g_warning("Unable to load module: %s", file); + return NULL; + } get_version_t lget_version = NULL; - g_return_val_if_fail(g_module_symbol(module, INDICATOR_GET_VERSION_S, (gpointer *)(&lget_version)), FALSE); + if (!g_module_symbol(module, INDICATOR_GET_VERSION_S, (gpointer *)(&lget_version))) + return NULL; + if (!INDICATOR_VERSION_CHECK(lget_version())) { g_warning("Indicator using API version '%s' we're expecting '%s'", lget_version(), INDICATOR_VERSION); return NULL; -- cgit v1.2.3