[Rawstudio-commit] r3201 - in trunk: plugins/output-facebook src

Anders Kvist anders at kvistmail.dk
Sat Feb 13 03:29:04 CET 2010


Author: akv
Date: 2010-02-13 03:29:04 +0100 (Sat, 13 Feb 2010)
New Revision: 3201

Modified:
   trunk/plugins/output-facebook/output-facebook.c
   trunk/src/rs-batch.c
Log:
Removed filename from facebook plugin.

Modified: trunk/plugins/output-facebook/output-facebook.c
===================================================================
--- trunk/plugins/output-facebook/output-facebook.c	2010-02-13 01:58:14 UTC (rev 3200)
+++ trunk/plugins/output-facebook/output-facebook.c	2010-02-13 02:29:04 UTC (rev 3201)
@@ -53,7 +53,6 @@
 	RSOutput parent;
 
 	gint quality;
-	gchar *filename; /* Required for a output plugin - not in use */
 	gchar *caption;
 	gchar *album_id;
 };
@@ -76,7 +75,6 @@
 	PROP_0,
 	PROP_LOGO,
 	PROP_JPEG_QUALITY,
-	PROP_FILENAME, /* Required for a output plugin - not in use */
 	PROP_CAPTION,
 	PROP_ALBUM_SELECTOR
 };
@@ -116,13 +114,6 @@
 									  NULL,
 									  G_PARAM_READWRITE));
 
-	g_object_class_install_property (object_class, /* Required for a output plugin - not in use */
-					 PROP_FILENAME, g_param_spec_string ("filename",
-									  "filename",
-									  "Filename",
-									  NULL,
-									  G_PARAM_READWRITE));
-
 	g_object_class_install_property (object_class,
 					 PROP_ALBUM_SELECTOR, g_param_spec_object ("album selector",
 										   "album selector",
@@ -157,9 +148,6 @@
 	case PROP_JPEG_QUALITY:
 		g_value_set_int (value, facebook->quality);
 		break;
-	case PROP_FILENAME: /* Required for a output plugin - not in use */
-		g_value_set_string (value, facebook->filename);
-		break;
 	case PROP_CAPTION:
 		g_value_set_string (value, facebook->caption);
 		break;
@@ -184,9 +172,6 @@
 	case PROP_JPEG_QUALITY:
 		facebook->quality = g_value_get_int (value);
 		break;
-	case PROP_FILENAME: /* Required for a output plugin - not in use */
-		facebook->filename = g_value_dup_string (value);
-		break;
 	case PROP_CAPTION:
 		facebook->caption = g_value_dup_string (value);
 		break;
@@ -378,9 +363,6 @@
 	rs_output_execute (jpegsave, filter);
 	g_object_unref (jpegsave);
 
-	if (facebook->filename) /* Most likely batch */
-		facebook->caption = g_path_get_basename(facebook->filename);
-
 	gboolean ret = rs_facebook_client_upload_image(facebook_client, temp_file, facebook->caption, facebook->album_id, &error);
 	deal_with_error(&error);
 

Modified: trunk/src/rs-batch.c
===================================================================
--- trunk/src/rs-batch.c	2010-02-13 01:58:14 UTC (rev 3200)
+++ trunk/src/rs-batch.c	2010-02-13 02:29:04 UTC (rev 3201)
@@ -616,7 +616,16 @@
 				NULL);
 
 			/* Save the image */
-			g_object_set(queue->output, "filename", parsed_filename, NULL);
+			if (g_object_class_find_property(G_OBJECT_GET_CLASS(queue->output), "filename"))
+				g_object_set(queue->output, "filename", parsed_filename, NULL);
+
+			if (g_object_class_find_property(G_OBJECT_GET_CLASS(queue->output), "caption"))
+			{
+				gchar *basename = g_path_get_basename(parsed_filename);
+				g_object_set(queue->output, "caption", basename, NULL);
+				g_free(basename);
+			}
+
 			g_assert(RS_IS_OUTPUT(queue->output));
 			g_assert(RS_IS_FILTER(fend));
 			rs_output_execute(queue->output, fend);




More information about the Rawstudio-commit mailing list