[nautilus-actions] Make NactApplication initializes with these new properties



commit e07b7dd91eda57f11d098daa267395e514cce000
Author: Pierre Wieser <pwieser trychlos org>
Date:   Fri Jan 21 01:32:25 2011 +0100

    Make NactApplication initializes with these new properties

 ChangeLog                   |    3 +++
 src/nact/base-application.c |    4 +++-
 src/nact/nact-application.c |   32 ++++++++++++++++++++++----------
 3 files changed, 28 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 13fdc9e..2f55c7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-01-20 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-application.c (nact_application_new_with_args):
+	Make NactApplication initializes with these new properties.
+
 	* src/nact/base-application.c:
 	* src/nact/base-application.h: Define new properties.
 
diff --git a/src/nact/base-application.c b/src/nact/base-application.c
index da3b62c..5ba46e8 100644
--- a/src/nact/base-application.c
+++ b/src/nact/base-application.c
@@ -422,7 +422,9 @@ instance_set_property( GObject *object, guint property_id, const GValue *value,
 				break;
 
 			case BASE_PROP_ARGV_ID:
-				g_boxed_free( G_TYPE_STRV, self->private->argv );
+				if( self->private->argv ){
+					g_boxed_free( G_TYPE_STRV, self->private->argv );
+				}
 				self->private->argv = g_value_dup_boxed( value );
 				break;
 
diff --git a/src/nact/nact-application.c b/src/nact/nact-application.c
index bb1d54c..4c140c1 100644
--- a/src/nact/nact-application.c
+++ b/src/nact/nact-application.c
@@ -33,7 +33,7 @@
 #endif
 
 #include <glib/gi18n.h>
-#include <gtk/gtk.h>
+#include <libintl.h>
 
 #include <api/na-core-utils.h>
 
@@ -67,7 +67,10 @@ enum {
 static gboolean     st_non_unique_opt = FALSE;
 static gboolean     st_version_opt    = FALSE;
 
-static GOptionEntry st_entries[] = {
+static const gchar *st_application_name = N_( "Nautilus-Actions Configuration Tool" );
+static const gchar *st_unique_app_name  = "org.nautilus-actions.ConfigurationTool";
+
+static GOptionEntry st_option_entries[] = {
 	{ "non-unique", 'n', 0, G_OPTION_ARG_NONE, &st_non_unique_opt,
 			N_( "Set it to run multiple instances of the program [unique]" ), NULL },
 	{ "version"   , 'v', 0, G_OPTION_ARG_NONE, &st_version_opt,
@@ -292,14 +295,23 @@ instance_finalize( GObject *application )
 NactApplication *
 nact_application_new_with_args( int argc, char **argv )
 {
-	return(
-			g_object_new(
-					NACT_APPLICATION_TYPE,
-					BASE_PROP_ARGC, argc,
-					BASE_PROP_ARGV, argv,
-					BASE_PROP_OPTIONS, st_entries,
-					NULL )
-	);
+	NactApplication *application;
+	gchar *icon_name;
+
+	icon_name = na_iabout_get_icon_name();
+
+	application = g_object_new( NACT_APPLICATION_TYPE,
+			BASE_PROP_ARGC,             argc,
+			BASE_PROP_ARGV,             argv,
+			BASE_PROP_OPTIONS,          st_option_entries,
+			BASE_PROP_APPLICATION_NAME, st_application_name,
+			BASE_PROP_ICON_NAME,        icon_name,
+			BASE_PROP_UNIQUE_APP_NAME,  st_unique_app_name,
+			NULL );
+
+	g_free( icon_name );
+
+	return( application );
 }
 
 /**



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