[cheese] lib: properly prefix photo/video suffix constants in cheese namespace



commit e3fd74e372984149b560331f4b74698b79174702
Author: Lucas Rocha <lucasr gnome org>
Date:   Sun Apr 3 16:01:44 2011 +0100

    lib: properly prefix photo/video suffix constants in cheese namespace
    
    If this is part of the public API, it should be prefixed accordingly.

 libcheese/cheese-fileutil.c       |   18 +++++++++---------
 libcheese/cheese-fileutil.h       |    4 ++--
 src/thumbview/cheese-thumb-view.c |    6 +++---
 3 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/libcheese/cheese-fileutil.c b/libcheese/cheese-fileutil.c
index d86dc50..0425fbf 100644
--- a/libcheese/cheese-fileutil.c
+++ b/libcheese/cheese-fileutil.c
@@ -90,7 +90,7 @@ cheese_fileutil_get_new_media_filename (CheeseFileUtil *fileutil, CheeseMediaMod
 
   if (mode == CHEESE_MEDIA_MODE_PHOTO)
   {
-    filename = g_strdup_printf ("%s%s%s%s", path, G_DIR_SEPARATOR_S, date, PHOTO_NAME_SUFFIX);
+    filename = g_strdup_printf ("%s%s%s%s", path, G_DIR_SEPARATOR_S, date, CHEESE_PHOTO_NAME_SUFFIX);
   }
   else if (mode == CHEESE_MEDIA_MODE_BURST)
   {
@@ -98,11 +98,11 @@ cheese_fileutil_get_new_media_filename (CheeseFileUtil *fileutil, CheeseMediaMod
     if (strlen (priv->burst_raw_name) == 0)
       priv->burst_raw_name = g_strdup_printf ("%s%s%s", path, G_DIR_SEPARATOR_S, date);
 
-    filename = g_strdup_printf ("%s_%d%s", priv->burst_raw_name, priv->burst_count, PHOTO_NAME_SUFFIX);
+    filename = g_strdup_printf ("%s_%d%s", priv->burst_raw_name, priv->burst_count, CHEESE_PHOTO_NAME_SUFFIX);
   }
   else
   {
-    filename = g_strdup_printf ("%s%s%s%s", path, G_DIR_SEPARATOR_S, date, VIDEO_NAME_SUFFIX);
+    filename = g_strdup_printf ("%s%s%s%s", path, G_DIR_SEPARATOR_S, date, CHEESE_VIDEO_NAME_SUFFIX);
   }
 
   file = g_file_new_for_path (filename);
@@ -111,11 +111,11 @@ cheese_fileutil_get_new_media_filename (CheeseFileUtil *fileutil, CheeseMediaMod
   {
     num = 1;
     if (mode == CHEESE_MEDIA_MODE_PHOTO)
-      filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, PHOTO_NAME_SUFFIX);
+      filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, CHEESE_PHOTO_NAME_SUFFIX);
     else if (mode == CHEESE_MEDIA_MODE_BURST)
-      filename = g_strdup_printf ("%s_%d (%d)%s", priv->burst_raw_name, priv->burst_count, num, PHOTO_NAME_SUFFIX);
+      filename = g_strdup_printf ("%s_%d (%d)%s", priv->burst_raw_name, priv->burst_count, num, CHEESE_PHOTO_NAME_SUFFIX);
     else
-      filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, VIDEO_NAME_SUFFIX);
+      filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, CHEESE_VIDEO_NAME_SUFFIX);
 
     file = g_file_new_for_path (filename);
 
@@ -123,11 +123,11 @@ cheese_fileutil_get_new_media_filename (CheeseFileUtil *fileutil, CheeseMediaMod
     {
       num++;
       if (mode == CHEESE_MEDIA_MODE_PHOTO)
-        filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, PHOTO_NAME_SUFFIX);
+        filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, CHEESE_PHOTO_NAME_SUFFIX);
       else if (mode == CHEESE_MEDIA_MODE_BURST)
-        filename = g_strdup_printf ("%s_%d (%d)%s", priv->burst_raw_name, priv->burst_count, num, PHOTO_NAME_SUFFIX);
+        filename = g_strdup_printf ("%s_%d (%d)%s", priv->burst_raw_name, priv->burst_count, num, CHEESE_PHOTO_NAME_SUFFIX);
       else
-        filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, VIDEO_NAME_SUFFIX);
+        filename = g_strdup_printf ("%s%s%s (%d)%s", path, G_DIR_SEPARATOR_S, date, num, CHEESE_VIDEO_NAME_SUFFIX);
 
       file = g_file_new_for_path (filename);
     }
diff --git a/libcheese/cheese-fileutil.h b/libcheese/cheese-fileutil.h
index 010fac0..a15f75d 100644
--- a/libcheese/cheese-fileutil.h
+++ b/libcheese/cheese-fileutil.h
@@ -24,8 +24,8 @@
 
 #include <glib-object.h>
 
-#define PHOTO_NAME_SUFFIX ".jpg"
-#define VIDEO_NAME_SUFFIX ".ogv"
+#define CHEESE_PHOTO_NAME_SUFFIX ".jpg"
+#define CHEESE_VIDEO_NAME_SUFFIX ".ogv"
 
 G_BEGIN_DECLS
 
diff --git a/src/thumbview/cheese-thumb-view.c b/src/thumbview/cheese-thumb-view.c
index d5502c8..19ddeda 100644
--- a/src/thumbview/cheese-thumb-view.c
+++ b/src/thumbview/cheese-thumb-view.c
@@ -192,7 +192,7 @@ cheese_thumb_view_append_item (CheeseThumbView *thumb_view, GFile *file)
 
   filename = g_file_get_path (file);
 
-  if (!(g_str_has_suffix (filename, PHOTO_NAME_SUFFIX)) && !(g_str_has_suffix (filename, VIDEO_NAME_SUFFIX)))
+  if (!(g_str_has_suffix (filename, CHEESE_PHOTO_NAME_SUFFIX)) && !(g_str_has_suffix (filename, CHEESE_VIDEO_NAME_SUFFIX)))
   {
     g_free (filename);
     return;
@@ -515,7 +515,7 @@ cheese_thumb_view_fill (CheeseThumbView *thumb_view)
     /* read videos from the vid directory */
     while ((name = g_dir_read_name (dir_videos)))
     {
-      if (!(g_str_has_suffix (name, VIDEO_NAME_SUFFIX)))
+      if (!(g_str_has_suffix (name, CHEESE_VIDEO_NAME_SUFFIX)))
         continue;
 
       filename = g_build_filename (path_videos, name, NULL);
@@ -533,7 +533,7 @@ cheese_thumb_view_fill (CheeseThumbView *thumb_view)
     /* read photos from the photo directory */
     while ((name = g_dir_read_name (dir_photos)))
     {
-      if (!(g_str_has_suffix (name, PHOTO_NAME_SUFFIX)))
+      if (!(g_str_has_suffix (name, CHEESE_PHOTO_NAME_SUFFIX)))
         continue;
 
       filename = g_build_filename (path_photos, name, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]