[nautilus-actions] Revert commit 3acf600874



commit 2fef42ce957c8149b7d2706ac596674648ac9e44
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sat Jan 22 18:35:54 2011 +0100

    Revert commit 3acf600874

 ChangeLog                   |    7 +++++++
 src/nact/base-application.c |    7 ++-----
 src/nact/base-application.h |   11 +++--------
 src/nact/nact-application.c |    5 +++++
 4 files changed, 17 insertions(+), 13 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 1f6c42b..ee36cba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-01-22 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/base-application.c (appli_initialize_manage_options):
+	* src/nact/base-application.h (manage_options):
+	* src/nact/nact-application.c (appli_manage_options):
+	Revert commit 3acf600874.
+
+	* src/test/test-virtuals.c: Do some more tests on virtual methods.
+
 	* src/nact/base-window.c (on_initialize_gtk_toplevel_class_handler,
 	on_initialize_base_window_class_handler,
 	on_all_widgets_showed_class_handler, base_window_is_willing_to_quit):
diff --git a/src/nact/base-application.c b/src/nact/base-application.c
index accdfdd..7e5455f 100644
--- a/src/nact/base-application.c
+++ b/src/nact/base-application.c
@@ -547,16 +547,13 @@ appli_initialize_manage_options( const BaseApplication *application, int *code )
 {
 	static const gchar *thisfn = "base_application_appli_initialize_manage_options";
 	gboolean ret;
-	GObjectClass *class;
 
 	g_debug( "%s: application=%p, code=%p (%d)", thisfn, ( void * ) application, ( void * ) code, *code );
 
 	ret = TRUE;
 
-	for( class = G_OBJECT_GET_CLASS( application ) ; ret && BASE_IS_APPLICATION_CLASS( class ) ; class = g_type_class_peek_parent( class )){
-		if( BASE_APPLICATION_CLASS( class )->manage_options ){
-			ret = BASE_APPLICATION_CLASS( class )->manage_options( application, code );
-		}
+	if( BASE_APPLICATION_GET_CLASS( application )->manage_options ){
+		ret = BASE_APPLICATION_GET_CLASS( application )->manage_options( application, code );
 	}
 
 	return( ret );
diff --git a/src/nact/base-application.h b/src/nact/base-application.h
index ab806c4..32452cc 100644
--- a/src/nact/base-application.h
+++ b/src/nact/base-application.h
@@ -113,14 +113,9 @@ typedef struct {
 	 * function.
 	 *
 	 * This let the derived class an opportunity to manage command-line
-	 * arguments.
-	 *
-	 * The BaseApplication base class takes care of successively invoking
-	 * all manage_options() methods of derived classes, from the topmost
-	 * derived class up to the BaseApplication base class, while each methods
-	 * returns %TRUE.
-	 *
-	 * In other words, it stops this loop as soon as a method returns %FALSE.
+	 * arguments. Unless it decides to stop the execution of the program,
+	 * the derived class should call the parent class method in order to
+	 * let it manage its own options.
 	 *
 	 * Returns: %TRUE to continue execution, %FALSE to stop it.
 	 */
diff --git a/src/nact/nact-application.c b/src/nact/nact-application.c
index db6eb0e..d7c4d54 100644
--- a/src/nact/nact-application.c
+++ b/src/nact/nact-application.c
@@ -323,6 +323,11 @@ appli_manage_options( const BaseApplication *application, int *code )
 		g_object_set( G_OBJECT( application ), BASE_PROP_UNIQUE_APP_NAME, "", NULL );
 	}
 
+	/* call parent class */
+	if( ret && BASE_APPLICATION_CLASS( st_parent_class )->manage_options ){
+		ret = BASE_APPLICATION_CLASS( st_parent_class )->manage_options( application, code );
+	}
+
 	return( ret );
 }
 



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