Author: akv
Date: 2009-12-21 18:32:16 +0100 (Mon, 21 Dec 2009)
New Revision: 2834

Modified:
   trunk/src/rs-library.c
   trunk/src/rs-library.h
   trunk/src/rs-store.c
Log:
Added rs_library_add_photo_with_metadata() to add photo and autotag it in one 
go and bail out if the photo is known.

Modified: trunk/src/rs-library.c
===================================================================
--- trunk/src/rs-library.c      2009-12-21 17:05:56 UTC (rev 2833)
+++ trunk/src/rs-library.c      2009-12-21 17:32:16 UTC (rev 2834)
@@ -524,10 +524,6 @@
 {
        g_assert(RS_IS_LIBRARY(library));
 
-       /* Bail out if we already know the photo */
-       if (library_find_photo_id(library, photo) > -1)
-               return;
-
        GList *tags = NULL;
 
        rs_library_add_photo(library, photo);
@@ -855,3 +851,15 @@
        gtk_entry_set_text(GTK_ENTRY(tag_search_entry), str);
        return TRUE;
 }
+
+void
+rs_library_add_photo_with_metadata(RSLibrary *library, const gchar *photo, 
RSMetadata *metadata)
+{
+       /* Bail out if we already know the photo */
+       if (library_find_photo_id(library, photo) > -1)
+               return;
+
+       rs_library_add_photo(library, photo);
+       rs_library_photo_default_tags(library, photo, metadata);
+}
+

Modified: trunk/src/rs-library.h
===================================================================
--- trunk/src/rs-library.h      2009-12-21 17:05:56 UTC (rev 2833)
+++ trunk/src/rs-library.h      2009-12-21 17:32:16 UTC (rev 2834)
@@ -56,6 +56,7 @@
 GtkWidget *rs_library_toolbox_new(RSLibrary *library, RSStore *store);
 GtkWidget *rs_library_tag_entry_new(RSLibrary *library);
 gboolean rs_library_set_tag_search(gchar *str);
+void rs_library_add_photo_with_metadata(RSLibrary *library, const gchar 
*photo, RSMetadata *metadata);
 
 G_END_DECLS
 

Modified: trunk/src/rs-store.c
===================================================================
--- trunk/src/rs-store.c        2009-12-21 17:05:56 UTC (rev 2833)
+++ trunk/src/rs-store.c        2009-12-21 17:32:16 UTC (rev 2834)
@@ -1094,10 +1094,6 @@
                if (rs_filetype_can_load(fullname))
                {
                        rs_store_load_file(store, fullname);
-
-                       /* Add photo to library */
-                       rs_library_add_photo(library, fullname);
-
                        count++;
                }
                else if (load_recursive && g_file_test(fullname, 
G_FILE_TEST_IS_DIR))
@@ -2435,7 +2431,7 @@
                }
 
                /* Add to library */
-               rs_library_photo_default_tags(rs_library_get_singleton(), 
job->filename, metadata);
+               rs_library_add_photo_with_metadata(rs_library_get_singleton(), 
job->filename, metadata);
 
                gdk_threads_leave();
 


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to