[accounts-dialog] Don't explode when we get the faces images if we try to run accoundsdialog in a prefix
- From: Richard Hughes <rhughes src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [accounts-dialog] Don't explode when we get the faces images if we try to run accoundsdialog in a prefix
- Date: Fri, 22 Jan 2010 15:05:34 +0000 (UTC)
commit 7eeac9afbf32427bb86ad3c6bde505618cb09d14
Author: Richard Hughes <richard hughsie com>
Date: Fri Jan 22 15:05:02 2010 +0000
Don't explode when we get the faces images if we try to run accoundsdialog in a prefix
src/um-photo-dialog.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/um-photo-dialog.c b/src/um-photo-dialog.c
index 8ae0d63..e705e7d 100644
--- a/src/um-photo-dialog.c
+++ b/src/um-photo-dialog.c
@@ -363,6 +363,7 @@ setup_photo_popup (UmPhotoDialog *um)
guint x, y;
GDir *dir;
const char *face;
+ GError *error;
menu = gtk_menu_new ();
@@ -414,7 +415,14 @@ setup_photo_popup (UmPhotoDialog *um)
#else
y = 4;
#endif /* HAVE_CHEESE */
- dir = g_dir_open (DATADIR "/pixmaps/faces", 0, NULL);
+ error = NULL;
+ dir = g_dir_open (DATADIR "/pixmaps/faces", 0, &error);
+ if (dir == NULL) {
+ g_warning ("Failed to load faces: %s", error->message);
+ g_error_free (error);
+ goto out;
+ }
+
while ((face = g_dir_read_name (dir)) != NULL) {
char *filename;
@@ -435,7 +443,7 @@ setup_photo_popup (UmPhotoDialog *um)
}
}
g_dir_close (dir);
-
+out:
um->photo_popup = menu;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]