[gedit] Updated to g_typelib_new_from_mapped_file API change
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Updated to g_typelib_new_from_mapped_file API change
- Date: Sat, 17 Jul 2010 17:10:15 +0000 (UTC)
commit 72cd9216e764a9cf7f98925414ce64f258360963
Author: Jesse van den Kieboom <jesse icecrew nl>
Date: Sat Jul 17 19:09:57 2010 +0200
Updated to g_typelib_new_from_mapped_file API change
It now requires a GError. The code also nicely fails with a warning
if any problems occur while loading the typelib
gedit/gedit-plugins-engine.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-plugins-engine.c b/gedit/gedit-plugins-engine.c
index 2db87fc..8024849 100644
--- a/gedit/gedit-plugins-engine.c
+++ b/gedit/gedit-plugins-engine.c
@@ -137,6 +137,7 @@ require_private_typelib (void)
GMappedFile *mfile;
GTypelib *typelib;
const gchar *ns;
+ GError *error = NULL;
lib_dir = gedit_dirs_get_gedit_lib_dir ();
filename = g_build_filename (lib_dir,
@@ -154,7 +155,17 @@ require_private_typelib (void)
return;
}
- typelib = g_typelib_new_from_mapped_file (mfile);
+ typelib = g_typelib_new_from_mapped_file (mfile, &error);
+
+ if (typelib == NULL)
+ {
+ g_warning ("Private typelib 'Gedit-3.0' could not be loaded: %s",
+ error->message);
+
+ g_error_free (error);
+ return;
+ }
+
ns = g_irepository_load_typelib (g_irepository_get_default (),
typelib,
0,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]