[nautilus-actions] Remove unused BaseApplication properties
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Remove unused BaseApplication properties
- Date: Fri, 21 Jan 2011 18:48:54 +0000 (UTC)
commit b22cc6dc924a964824dd4b0154b493347803d0bf
Author: Pierre Wieser <pwieser trychlos org>
Date: Fri Jan 21 11:39:01 2011 +0100
Remove unused BaseApplication properties
ChangeLog | 1 +
src/nact/base-application.c | 131 +-----------------------------------------
src/nact/base-application.h | 52 +----------------
3 files changed, 7 insertions(+), 177 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8445601..55e96aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* src/nact/base-application.c:
* src/nact/base-application.h:
Define new 'base-application-description' property.
+ Remove unused properties.
* src/nact/nact-application.c (nact_application_new):
Make use of the new property at instanciation time.
diff --git a/src/nact/base-application.c b/src/nact/base-application.c
index 6e279d8..7762cae 100644
--- a/src/nact/base-application.c
+++ b/src/nact/base-application.c
@@ -70,11 +70,6 @@ struct _BaseApplicationPrivate {
BaseBuilder *builder;
BaseWindow *main_window;
UniqueApp *unique_app_handle;
-
- gboolean is_gtk_initialized;
- int exit_code;
- gchar *exit_message1;
- gchar *exit_message2;
};
/* instance properties
@@ -89,13 +84,6 @@ enum {
BASE_PROP_DESCRIPTION_ID,
BASE_PROP_ICON_NAME_ID,
BASE_PROP_UNIQUE_APP_NAME_ID,
- BASE_APPLICATION_PROP_IS_GTK_INITIALIZED_ID,
- BASE_APPLICATION_PROP_UNIQUE_APP_HANDLE_ID,
- BASE_APPLICATION_PROP_EXIT_CODE_ID,
- BASE_APPLICATION_PROP_EXIT_MESSAGE1_ID,
- BASE_APPLICATION_PROP_EXIT_MESSAGE2_ID,
- BASE_APPLICATION_PROP_BUILDER_ID,
- BASE_APPLICATION_PROP_MAIN_WINDOW_ID,
BASE_PROP_N_PROPERTIES
};
@@ -172,7 +160,6 @@ class_init( BaseApplicationClass *klass )
{
static const gchar *thisfn = "base_application_class_init";
GObjectClass *object_class;
- GParamSpec *spec;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -239,55 +226,6 @@ class_init( BaseApplicationClass *klass )
"",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE ));
- spec = g_param_spec_boolean(
- BASE_APPLICATION_PROP_IS_GTK_INITIALIZED,
- "Gtk+ initialization flag",
- "Has Gtk+ be initialized ?", FALSE,
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
- g_object_class_install_property( object_class, BASE_APPLICATION_PROP_IS_GTK_INITIALIZED_ID, spec );
-
- spec = g_param_spec_pointer(
- BASE_APPLICATION_PROP_UNIQUE_APP_HANDLE,
- "UniqueApp object pointer",
- "A reference to the UniqueApp object if any",
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
- g_object_class_install_property( object_class, BASE_APPLICATION_PROP_UNIQUE_APP_HANDLE_ID, spec );
-
- spec = g_param_spec_int(
- BASE_APPLICATION_PROP_EXIT_CODE,
- "Exit code",
- "Exit code of the application", 0, 65535, 0,
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
- g_object_class_install_property( object_class, BASE_APPLICATION_PROP_EXIT_CODE_ID, spec );
-
- spec = g_param_spec_string(
- BASE_APPLICATION_PROP_EXIT_MESSAGE1,
- "Error message",
- "First line of the error message displayed when exit_code not nul", "",
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
- g_object_class_install_property( object_class, BASE_APPLICATION_PROP_EXIT_MESSAGE1_ID, spec );
-
- spec = g_param_spec_string(
- BASE_APPLICATION_PROP_EXIT_MESSAGE2,
- "Error message",
- "Second line of the error message displayed when exit_code not nul", "",
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
- g_object_class_install_property( object_class, BASE_APPLICATION_PROP_EXIT_MESSAGE2_ID, spec );
-
- spec = g_param_spec_pointer(
- BASE_APPLICATION_PROP_BUILDER,
- "UI object pointer",
- "A reference to the UI definition from GtkBuilder",
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
- g_object_class_install_property( object_class, BASE_APPLICATION_PROP_BUILDER_ID, spec );
-
- spec = g_param_spec_pointer(
- BASE_APPLICATION_PROP_MAIN_WINDOW,
- "Main BaseWindow object",
- "A reference to the main BaseWindow object",
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
- g_object_class_install_property( object_class, BASE_APPLICATION_PROP_MAIN_WINDOW_ID, spec );
-
klass->private = g_new0( BaseApplicationClassPrivate, 1 );
klass->manage_options = NULL;
@@ -351,34 +289,6 @@ instance_get_property( GObject *object, guint property_id, GValue *value, GParam
g_value_set_string( value, self->private->unique_app_name );
break;
- case BASE_APPLICATION_PROP_IS_GTK_INITIALIZED_ID:
- g_value_set_boolean( value, self->private->is_gtk_initialized );
- break;
-
- case BASE_APPLICATION_PROP_UNIQUE_APP_HANDLE_ID:
- g_value_set_pointer( value, self->private->unique_app_handle );
- break;
-
- case BASE_APPLICATION_PROP_EXIT_CODE_ID:
- g_value_set_int( value, self->private->exit_code );
- break;
-
- case BASE_APPLICATION_PROP_EXIT_MESSAGE1_ID:
- g_value_set_string( value, self->private->exit_message1 );
- break;
-
- case BASE_APPLICATION_PROP_EXIT_MESSAGE2_ID:
- g_value_set_string( value, self->private->exit_message2 );
- break;
-
- case BASE_APPLICATION_PROP_BUILDER_ID:
- g_value_set_pointer( value, self->private->builder );
- break;
-
- case BASE_APPLICATION_PROP_MAIN_WINDOW_ID:
- g_value_set_pointer( value, self->private->main_window );
- break;
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec );
break;
@@ -432,36 +342,6 @@ instance_set_property( GObject *object, guint property_id, const GValue *value,
self->private->unique_app_name = g_value_dup_string( value );
break;
- case BASE_APPLICATION_PROP_IS_GTK_INITIALIZED_ID:
- self->private->is_gtk_initialized = g_value_get_boolean( value );
- break;
-
- case BASE_APPLICATION_PROP_UNIQUE_APP_HANDLE_ID:
- self->private->unique_app_handle = g_value_get_pointer( value );
- break;
-
- case BASE_APPLICATION_PROP_EXIT_CODE_ID:
- self->private->exit_code = g_value_get_int( value );
- break;
-
- case BASE_APPLICATION_PROP_EXIT_MESSAGE1_ID:
- g_free( self->private->exit_message1 );
- self->private->exit_message1 = g_value_dup_string( value );
- break;
-
- case BASE_APPLICATION_PROP_EXIT_MESSAGE2_ID:
- g_free( self->private->exit_message2 );
- self->private->exit_message2 = g_value_dup_string( value );
- break;
-
- case BASE_APPLICATION_PROP_BUILDER_ID:
- self->private->builder = g_value_get_pointer( value );
- break;
-
- case BASE_APPLICATION_PROP_MAIN_WINDOW_ID:
- self->private->main_window = g_value_get_pointer( value );
- break;
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec );
break;
@@ -520,9 +400,6 @@ instance_finalize( GObject *application )
g_free( self->private->icon_name );
g_free( self->private->unique_app_name );
- g_free( self->private->exit_message1 );
- g_free( self->private->exit_message2 );
-
g_free( self->private );
/* chain call to parent class */
@@ -571,7 +448,8 @@ base_application_run( BaseApplication *application )
if( BASE_APPLICATION_GET_CLASS( application )->main_window_new ){
- application->private->main_window = ( BaseWindow * ) BASE_APPLICATION_GET_CLASS( application )->main_window_new( application, &application->private->exit_code );
+ application->private->main_window =
+ ( BaseWindow * ) BASE_APPLICATION_GET_CLASS( application )->main_window_new( application, &code );
} else {
code = BASE_EXIT_CODE_MAIN_WINDOW;
}
@@ -848,15 +726,14 @@ base_application_get_application_name( const BaseApplication *application )
* Returns: the default #BaseBuilder object for the application.
*/
BaseBuilder *
-base_application_get_builder( BaseApplication *application )
+base_application_get_builder( const BaseApplication *application )
{
- /*static const gchar *thisfn = "base_application_get_application_name";
- g_debug( "%s: application=%p", thisfn, application );*/
BaseBuilder *builder = NULL;
g_return_val_if_fail( BASE_IS_APPLICATION( application ), NULL );
if( !application->private->dispose_has_run ){
+
builder = application->private->builder;
}
diff --git a/src/nact/base-application.h b/src/nact/base-application.h
index 969b4f1..082c29d 100644
--- a/src/nact/base-application.h
+++ b/src/nact/base-application.h
@@ -181,10 +181,7 @@ typedef enum {
BASE_EXIT_CODE_ARGS,
BASE_EXIT_CODE_UNIQUE_APP,
BASE_EXIT_CODE_MAIN_WINDOW,
-
- BASE_APPLICATION_ERROR_UI_FNAME, /* empty XML filename */
- BASE_APPLICATION_ERROR_UI_LOAD, /* unable to load the XML definition of the UI */
- BASE_APPLICATION_ERROR_DEFAULT_ICON /* unable to set default icon */
+ BASE_EXIT_CODE_USER_APP
}
BaseExitCode;
@@ -193,54 +190,9 @@ GType base_application_get_type( void );
int base_application_run( BaseApplication *application );
gchar *base_application_get_application_name( const BaseApplication *application );
-
-/**
- * @BASE_APPLICATION_PROP_IS_GTK_INITIALIZED: set to %TRUE after
- * successfully returning from the application_initialize_gtk() virtual
- * function.
- *
- * While this flag is not %TRUE, error messages are printed to
- * stdout. When %TRUE, error messages are displayed with a dialog
- * box.
- */
-#define BASE_APPLICATION_PROP_IS_GTK_INITIALIZED "base-application-is-gtk-initialized"
-
-/**
- * @BASE_APPLICATION_PROP_UNIQUE_APP_HANDLE: the UniqueApp object allocated
- * if the derived-class has provided a UniqueApp name (see
- * #application_get_unique_app_name). Rather for internal use.
- */
-#define BASE_APPLICATION_PROP_UNIQUE_APP_HANDLE "base-application-unique-app-handle"
-
-/**
- * @BASE_APPLICATION_PROP_EXIT_CODE: the code which will be returned by the
- * program to the operating system.
- * @BASE_APPLICATION_PROP_EXIT_MESSAGE1:
- * @BASE_APPLICATION_PROP_EXIT_MESSAGE2: the message which will be displayed
- * at program terminaison if @BASE_APPLICATION_PROP_EXIT_CODE is not zero.
- * When in graphical mode, the first line is displayed as bold.
- *
- * See @BASE_APPLICATION_PROP_IS_GTK_INITIALIZED for how the
- * @BASE_APPLICATION_PROP_EXIT_MESSAGE is actually displayed.
- */
-#define BASE_APPLICATION_PROP_EXIT_CODE "base-application-exit-code"
-#define BASE_APPLICATION_PROP_EXIT_MESSAGE1 "base-application-exit-message1"
-#define BASE_APPLICATION_PROP_EXIT_MESSAGE2 "base-application-exit-message2"
-
-/**
- * @BASE_APPLICATION_PROP_BUILDER: the #BaseBuilder object allocated to
- * handle the user interface XML definition. Rather for internal use.
- */
-#define BASE_APPLICATION_PROP_BUILDER "base-application-builder"
-
-/**
- * @BASE_APPLICATION_PROP_MAIN_WINDOW: as its name says: a pointer to the
- * #BaseWindow-derived main window of the application.
- */
-#define BASE_APPLICATION_PROP_MAIN_WINDOW "base-application-main-window"
+BaseBuilder *base_application_get_builder ( const BaseApplication *application );
gchar *base_application_get_ui_filename( BaseApplication *application );
-BaseBuilder *base_application_get_builder( BaseApplication *application );
void base_application_message_dlg( BaseApplication *application, GSList *message );
void base_application_error_dlg( BaseApplication *application, GtkMessageType type, const gchar *first, const gchar *second );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]