[cheese/gnome-3-6] Handle thumbnail directory creation, bug 671614
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/gnome-3-6] Handle thumbnail directory creation, bug 671614
- Date: Mon, 12 Nov 2012 21:43:02 +0000 (UTC)
commit 8b06d28da36fed275097ee408a0596ee6c387a9a
Author: Shao Changbin <changbin shao intel com>
Date: Thu Sep 6 03:23:14 2012 -0400
Handle thumbnail directory creation, bug 671614
src/thumbview/cheese-thumb-view.c | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
index 3ca6293..c229b1a 100644
--- a/src/thumbview/cheese-thumb-view.c
+++ b/src/thumbview/cheese-thumb-view.c
@@ -378,6 +378,37 @@ cheese_thumb_view_monitor_cb (GFileMonitor *file_monitor,
cheese_thumb_view_append_item (thumb_view, file);
break;
+ case G_FILE_MONITOR_EVENT_CREATED:
+ {
+ CheeseThumbViewPrivate *priv;
+ const char *path_photos;
+ char *filename;
+ GDir *dir_photos;
+ const char *name;
+ char *photo_name;
+ GFile *photo_file;
+
+ priv = CHEESE_THUMB_VIEW_GET_PRIVATE (thumb_view);
+ path_photos = cheese_fileutil_get_photo_path (priv->fileutil);
+ filename = g_file_get_path (file);
+ if (!strcmp(path_photos, filename))
+ {
+ dir_photos = g_dir_open (path_photos, 0, NULL);
+ while ((name = g_dir_read_name (dir_photos)))
+ {
+ if (!(g_str_has_suffix (name, CHEESE_PHOTO_NAME_SUFFIX)))
+ continue;
+ photo_name = g_build_filename (path_photos, name, NULL);
+ photo_file = g_file_new_for_path (photo_name);
+ cheese_thumb_view_append_item (thumb_view, photo_file);
+ g_free (photo_name);
+ g_object_unref (photo_file);
+ }
+ g_dir_close (dir_photos);
+ }
+ break;
+ }
+
default:
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]