[nautilus-actions] Remove unused nact_window_is_item_writable() function



commit 8f62303026508dbf1ed13070d32e5a58fbdc6044
Author: Pierre Wieser <pwieser trychlos org>
Date:   Sun Jan 23 10:24:53 2011 +0100

    Remove unused nact_window_is_item_writable() function

 ChangeLog              |    4 ++
 src/nact/nact-window.c |  100 ------------------------------------------------
 src/nact/nact-window.h |   14 +++----
 3 files changed, 10 insertions(+), 108 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f3423f8..f5817c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-01-22 Pierre Wieser <pwieser trychlos org>
 
+	* src/nact/nact-window.c:
+	* src/nact/nact-window.h
+	(nact_window_is_item_writable): Remove unused function.
+
 	* src/nact/base-window.c:
 	* src/nact/base-window.h
 	(runtime_init_toplevel): Renamed as initialize_base_window().
diff --git a/src/nact/nact-window.c b/src/nact/nact-window.c
index 9bec5d4..5aeac3f 100644
--- a/src/nact/nact-window.c
+++ b/src/nact/nact-window.c
@@ -212,106 +212,6 @@ nact_window_has_writable_providers( NactWindow *window )
 	return( has_writables );
 }
 
-#if 0
-/**
- * nact_window_is_item_writable:
- * @window: this #NactWindow object.
- * @item: the #NAObjectItem to be evaluated.
- * @reason: the reason for what @item may not be writable.
- *
- * Returns: %TRUE: if @item is actually writable, given the current
- * status of its provider, %FALSE else.
- *
- * For an item be actually writable:
- * - the item must not be itself in a read-only store, which has been
- *   checked when first reading it
- * - the provider must be willing (resp. able) to write
- * - the provider must not has been locked by the admin
- * - the writability of the provider must not have been removed by the user
- * - the whole configuration must not have been locked by the admin.
- */
-gboolean
-nact_window_is_item_writable( const NactWindow *window, const NAObjectItem *item, guint *reason )
-{
-	gboolean writable;
-	NactApplication *application;
-	NAUpdater *updater;
-	NAIOProvider *provider;
-
-	g_return_val_if_fail( NA_IS_OBJECT_ITEM( item ), FALSE );
-
-	writable = FALSE;
-	if( reason ){
-		*reason = NA_IIO_PROVIDER_STATUS_UNDETERMINED;
-	}
-
-	if( !window->private->dispose_has_run ){
-
-		application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
-		updater = nact_application_get_updater( application );
-
-		writable = TRUE;
-		if( reason ){
-			*reason = NA_IIO_PROVIDER_STATUS_WRITABLE;
-		}
-
-		if( writable ){
-			if( na_object_is_readonly( item )){
-				writable = FALSE;
-				if( reason ){
-					*reason = NA_IIO_PROVIDER_STATUS_ITEM_READONLY;
-				}
-			}
-		}
-
-		if( writable ){
-			provider = na_object_get_provider( item );
-			if( provider ){
-				if( !na_io_provider_is_willing_to_write( provider )){
-					writable = FALSE;
-					if( reason ){
-						*reason = NA_IIO_PROVIDER_STATUS_PROVIDER_NOT_WILLING_TO;
-					}
-				} else if( na_io_provider_is_locked_by_admin( provider, NA_IPREFS( updater ))){
-					writable = FALSE;
-					if( reason ){
-						*reason = NA_IIO_PROVIDER_STATUS_PROVIDER_LOCKED_BY_ADMIN;
-					}
-				} else if( !na_io_provider_is_conf_writable( provider, NA_IPREFS( updater ))){
-					writable = FALSE;
-					if( reason ){
-						*reason = NA_IIO_PROVIDER_STATUS_PROVIDER_LOCKED_BY_USER;
-					}
-				} else if( na_pivot_is_configuration_locked_by_admin( NA_PIVOT( updater ))){
-					writable = FALSE;
-					if( reason ){
-						*reason = NA_IIO_PROVIDER_STATUS_CONFIGURATION_LOCKED_BY_ADMIN;
-					}
-				} else if( !na_io_provider_has_write_api( provider )){
-					writable = FALSE;
-					if( reason ){
-						*reason = NA_IIO_PROVIDER_STATUS_NO_API;
-					}
-				}
-
-			/* the get_writable_provider() api already takes above checks
-			 */
-			} else {
-				provider = na_io_provider_find_writable_io_provider( NA_PIVOT( updater ));
-				if( !provider ){
-					writable = FALSE;
-					if( reason ){
-						*reason = NA_IIO_PROVIDER_STATUS_NO_PROVIDER_FOUND;
-					}
-				}
-			}
-		}
-	}
-
-	return( writable );
-}
-#endif
-
 /**
  * nact_window_save_item:
  * @window: this #NactWindow instance.
diff --git a/src/nact/nact-window.h b/src/nact/nact-window.h
index 769a87d..fe71fea 100644
--- a/src/nact/nact-window.h
+++ b/src/nact/nact-window.h
@@ -32,12 +32,14 @@
 #define __NACT_WINDOW_H__
 
 /**
- * SECTION: nact_window
- * @short_description: #NactWindow class definition.
- * @include: nact/nact-window.h
+ * SECTION: nact-window
+ * @title: NactWindow
+ * @short_description: The NactWindow base class definition.
+ * @include: nact-window.h
  *
  * This class is derived from BaseWindow class.
- * It is a common base class for all Nautilus-Actions window documents.
+ * It is a common base class for all Nautilus-Actions window documents
+ * (aka main frame windows).
  */
 
 #include <api/na-object-item.h>
@@ -75,10 +77,6 @@ GType      nact_window_get_type( void );
 
 gboolean   nact_window_has_writable_providers( NactWindow *window );
 
-#if 0
-gboolean   nact_window_is_item_writable( const NactWindow *window, const NAObjectItem *item, guint *reason );
-#endif
-
 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]