[nautilus-actions] Concatenate path and parameters fields to the Exec key
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Concatenate path and parameters fields to the Exec key
- Date: Sat, 3 Jul 2010 07:57:26 +0000 (UTC)
commit 792ebd362f7aedc2dde01161f4cccc83d949c16f
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Jun 28 07:05:23 2010 +0200
Concatenate path and parameters fields to the Exec key
ChangeLog | 4 ++++
src/io-desktop/nadp-writer.c | 14 ++++++++++++++
2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 519902e..c9c8ff1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2010-06-28 Pierre Wieser <pwieser trychlos org>
+ * src/io-desktop/nadp-writer.c
+ (nadp_writer_ifactory_provider_write_data):
+ Concatenate path and parameters fields to the Exec key.
+
* src/nact/nact-assistant-import.c (has_readable_files):
Get ride of warning messages in some usual situations.
diff --git a/src/io-desktop/nadp-writer.c b/src/io-desktop/nadp-writer.c
index 44992bf..d0fed77 100644
--- a/src/io-desktop/nadp-writer.c
+++ b/src/io-desktop/nadp-writer.c
@@ -374,6 +374,10 @@ nadp_writer_ifactory_provider_write_start( const NAIFactoryProvider *provider, v
return( NA_IIO_PROVIDER_CODE_OK );
}
+/*
+ * when writing to .desktop file a profile which has both a path and parameters,
+ * then concatenate these two fields to the 'Exec' key
+ */
guint
nadp_writer_ifactory_provider_write_data(
const NAIFactoryProvider *provider, void *writer_data, const NAIFactoryObject *object,
@@ -389,6 +393,7 @@ nadp_writer_ifactory_provider_write_data(
gboolean bool_value;
GSList *slist_value;
guint uint_value;
+ gchar *parms, *tmp;
g_return_val_if_fail( NADP_IS_DESKTOP_FILE( writer_data ), NA_IIO_PROVIDER_CODE_PROGRAM_ERROR );
/*g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ));*/
@@ -414,6 +419,15 @@ nadp_writer_ifactory_provider_write_data(
case NAFD_TYPE_STRING:
str_value = na_data_boxed_get_as_string( boxed );
+
+ if( !strcmp( def->name, NAFO_DATA_PATH )){
+ parms = na_object_get_parameters( object );
+ tmp = g_strdup_printf( "%s %s", str_value, parms );
+ g_free( str_value );
+ g_free( parms );
+ str_value = tmp;
+ }
+
nadp_desktop_file_set_string( ndf, group_name, def->desktop_entry, str_value );
g_free( str_value );
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]