[nautilus-actions] Converts v2 %f to v3 %b



commit 8b5de27c971c398149d82d35c28c1776a32faca7
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sun Aug 15 19:26:20 2010 +0200

    Converts v2 %f to v3 %b

 ChangeLog                    |    5 +++++
 src/core/na-object-profile.c |   12 ++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 30f5d02..f126f04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-15 Pierre Wieser <pwieser trychlos org>
+
+	* src/core/na-object-profile.c (convert_pre_v3_parameters_str):
+	%f used to be the name of the file (a basename), converts it to %b.
+
 2010-08-13 Pierre Wieser <pwieser trychlos org>
 
 	* doc/api/nautilus-actions-sections.txt:
diff --git a/src/core/na-object-profile.c b/src/core/na-object-profile.c
index ae084fb..927f811 100644
--- a/src/core/na-object-profile.c
+++ b/src/core/na-object-profile.c
@@ -389,12 +389,12 @@ icontext_is_candidate( NAIContext *object, guint target, GList *selection )
  * starting wih v3, parameters are relabeled
  *   pre-v3 parameters					post-v3 parameters
  *   ----------------------------		-----------------------------------
- *   									%b: (first) basename	(new)
+ *   									%b: (first) basename	(was %f)
  *   									%B: list of basenames	(was %m)
  *   									%c: count				(new)
  * 	 %d: (first) base directory			...................		(unchanged)
  * 										%D: list of base dir	(new)
- *   %f: (first) pathname				...................		(unchanged)
+ *   %f: (first) filename	-> %b		%f: (first) pathname	(new)
  *   									%F: list of pathnames	(was %M)
  *   %h: (first) hostname				...................		(unchanged)
  *   %m: list of basenames	-> %B		-						(removed)
@@ -412,6 +412,7 @@ icontext_is_candidate( NAIContext *object, guint target, GList *selection )
  *   %%: %								...................		(unchanged)
  *
  * For pre-v3 items,
+ * - substitute %f with %b
  * - substitute %m with %B
  * - substitute %M with %F
  * - substitute %U with %n
@@ -467,6 +468,13 @@ convert_pre_v3_parameters_str( gchar *str )
 		g_debug( "convert_pre_v3_parameters_str: iter[1]='%c'", iter[1] );
 		switch( iter[1] ){
 
+			/* %f (first filename) becomes %b
+			 */
+			case 'f':
+				iter[1] = 'b';
+				changed = TRUE;
+				break;
+
 			/* %m (list of basenames) becomes %B
 			 */
 			case 'm':



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