[nautilus-actions] nact_window_has_writable_providers(): removed function
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] nact_window_has_writable_providers(): removed function
- Date: Thu, 3 Feb 2011 00:51:00 +0000 (UTC)
commit 3bf298cada12527ab8b3c24880cadc0a87e7b1f9
Author: Pierre Wieser <pwieser trychlos org>
Date: Tue Feb 1 22:57:34 2011 +0100
nact_window_has_writable_providers(): removed function
ChangeLog | 7 +++++++
src/nact/nact-menubar-priv.h | 10 ++++++++--
src/nact/nact-menubar.c | 5 ++---
src/nact/nact-window.c | 32 --------------------------------
src/nact/nact-window.h | 2 --
5 files changed, 17 insertions(+), 39 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 25712a8..87d388b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2011-02-01 Pierre Wieser <pwieser trychlos org>
+ * src/nact/nact-window.c:
+ * src/nact/nact-window.h (nact_window_has_writable_providers):
+ Removed function.
+
+ * src/nact/nact-menubar-priv.h:
+ * src/nact/nact-menubar.c: Updated accordingly.
+
* src/core/na-iprefs.c:
* src/core/na-iprefs.h (na_iprefs_is_level_zero_writable):
Moved to NAUpdater class.
diff --git a/src/nact/nact-menubar-priv.h b/src/nact/nact-menubar-priv.h
index 54cf096..9d35738 100644
--- a/src/nact/nact-menubar-priv.h
+++ b/src/nact/nact-menubar-priv.h
@@ -49,13 +49,20 @@ G_BEGIN_DECLS
struct _NactMenubarPrivate {
/*< private >*/
gboolean dispose_has_run;
+
+ /* set at instanciation time
+ */
BaseWindow *window;
+
+ /* set at initialization time
+ */
GtkUIManager *ui_manager;
GtkActionGroup *action_group;
NAUpdater *updater;
+ gboolean is_level_zero_writable;
+ gboolean has_writable_providers;
gboolean is_parent_writable;
- gboolean is_level_zero_writable;
/* *** */
gint selected_menus;
@@ -73,7 +80,6 @@ struct _NactMenubarPrivate {
gboolean level_zero_order_changed;
gulong popup_handler;
- gboolean has_writable_providers;
guint count_selected;
GList *selected_items;
/* *** */
diff --git a/src/nact/nact-menubar.c b/src/nact/nact-menubar.c
index db8fbee..52a5481 100644
--- a/src/nact/nact-menubar.c
+++ b/src/nact/nact-menubar.c
@@ -503,6 +503,8 @@ on_base_initialize_window( BaseWindow *window, gpointer user_data )
application = NACT_APPLICATION( base_window_get_application( bar->private->window ));
bar->private->updater = nact_application_get_updater( application );
bar->private->is_level_zero_writable = na_updater_is_level_zero_writable( bar->private->updater );
+ bar->private->has_writable_providers =
+ ( na_io_provider_find_writable_io_provider( NA_PIVOT( bar->private->updater )) != NULL );
/* connect to all signal which may have an influence on the menu
* items sensitivity
@@ -775,9 +777,6 @@ on_update_sensitivities( NactMainWindow *window, gpointer user_data )
g_debug( "%s: window=%p, user_data=%p", thisfn, ( void * ) window, ( void * ) user_data );
- bar->private->has_writable_providers = nact_window_has_writable_providers( NACT_WINDOW( window ));
- g_debug( "%s: has_writable_providers=%s", thisfn, bar->private->has_writable_providers ? "True":"False" );
-
bar->private->selected_items = nact_iactions_list_bis_get_selected_items( NACT_IACTIONS_LIST( window ));
bar->private->count_selected = bar->private->selected_items ? g_list_length( bar->private->selected_items ) : 0;
g_debug( "%s: count_selected=%d", thisfn, bar->private->count_selected );
diff --git a/src/nact/nact-window.c b/src/nact/nact-window.c
index 5aeac3f..c8d1557 100644
--- a/src/nact/nact-window.c
+++ b/src/nact/nact-window.c
@@ -181,38 +181,6 @@ instance_finalize( GObject *window )
}
/**
- * nact_window_has_writable_providers:
- * @window: this #NactWindow instance.
- *
- * Returns: %TRUE if at least one I/O provider is writable, %FALSE else.
- */
-gboolean
-nact_window_has_writable_providers( NactWindow *window )
-{
- gboolean has_writables;
- NactApplication *application;
- NAUpdater *updater;
- NAIOProvider *provider;
-
- has_writables = FALSE;
-
- g_return_val_if_fail( NACT_IS_WINDOW( window ), has_writables );
-
- if( !window->private->dispose_has_run ){
-
- application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
- updater = nact_application_get_updater( application );
- provider = na_io_provider_find_writable_io_provider( NA_PIVOT( updater ));
-
- if( provider ){
- has_writables = TRUE;
- }
- }
-
- return( has_writables );
-}
-
-/**
* nact_window_save_item:
* @window: this #NactWindow instance.
* @item: the #NAObjectItem to be saved.
diff --git a/src/nact/nact-window.h b/src/nact/nact-window.h
index fe71fea..0fd26b4 100644
--- a/src/nact/nact-window.h
+++ b/src/nact/nact-window.h
@@ -75,8 +75,6 @@ typedef struct {
GType nact_window_get_type( void );
-gboolean nact_window_has_writable_providers( NactWindow *window );
-
gboolean nact_window_save_item ( NactWindow *window, NAObjectItem *item, gchar **msgerr );
gboolean nact_window_delete_item( NactWindow *window, const NAObjectItem *item, gchar **msgerr );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]