Commit 651f0ffe authored by Pierre Wieser's avatar Pierre Wieser

Slight adjustments in na-pivot.{c,h} sources

parent c9430e1b
2009-01-25 Pierre Wieser <pwieser@trychlos.org>
* nautilus-actions/runtime/na-pivot.c:
* nautilus-actions/runtime/na-pivot.h: Source reorganization.
* nautilus-actions/runtime/na-pivot.c:
* nautilus-actions/runtime/na-pivot.h (na_pivot_get_automatic_reload):
Remove unused function.
......
......@@ -68,8 +68,8 @@ struct NAPivotPrivate {
GList *tree;
/* whether to automatically reload the whole configuration tree
* when a modification has been detected in one of the underlying
* I/O storage subsystems
* when a modification is detected in one of the underlying I/O
* storage subsystems
* defaults to FALSE
*/
gboolean automatic_reload;
......@@ -84,6 +84,14 @@ struct NAPivotPrivate {
/* list of monitoring objects on runtime preferences
*/
GList *monitors;
/* list of I/O providers
* note that the N-A plugin is only interested about providers which are
* present at runtime and should be read at startup, while the NACT user
* interface wants all i/o providers, those available at runtime as well
* as those described in preferences
*/
GList *io_providers;
};
enum {
......@@ -343,36 +351,6 @@ na_pivot_dump( const NAPivot *pivot )
}
}
/*
* this handler is trigerred by IIOProviders when an action is changed
* in the underlying storage subsystems
* we don't care of updating our internal list with each and every
* atomic modification
* instead we wait for the end of notifications serie, and then reload
* the whole list of actions
*/
void
na_pivot_item_changed_handler( NAIIOProvider *provider, const gchar *id, NAPivot *pivot )
{
static const gchar *thisfn = "na_pivot_item_changed_handler";
g_debug( "%s: provider=%p, id=%s, pivot=%p", thisfn, ( void * ) provider, id, ( void * ) pivot );
g_return_if_fail( NA_IS_IIO_PROVIDER( provider ));
g_return_if_fail( NA_IS_PIVOT( pivot ));
if( !pivot->private->dispose_has_run ){
/* set a timeout to notify clients at the end of the serie */
g_get_current_time( &pivot->private->last_event );
if( !pivot->private->event_source_id ){
pivot->private->event_source_id =
g_timeout_add( st_timeout_msec, ( GSourceFunc ) on_item_changed_timeout, pivot );
}
}
}
/**
* na_pivot_get_providers:
* @pivot: this #NAPivot instance.
......@@ -420,6 +398,36 @@ na_pivot_free_providers( GList *providers )
na_module_free_extensions_list( providers );
}
/*
* this handler is trigerred by IIOProviders when an action is changed
* in the underlying storage subsystems
* we don't care of updating our internal list with each and every
* atomic modification
* instead we wait for the end of notifications serie, and then reload
* the whole list of actions
*/
void
na_pivot_item_changed_handler( NAIIOProvider *provider, const gchar *id, NAPivot *pivot )
{
static const gchar *thisfn = "na_pivot_item_changed_handler";
g_debug( "%s: provider=%p, id=%s, pivot=%p", thisfn, ( void * ) provider, id, ( void * ) pivot );
g_return_if_fail( NA_IS_IIO_PROVIDER( provider ));
g_return_if_fail( NA_IS_PIVOT( pivot ));
if( !pivot->private->dispose_has_run ){
/* set a timeout to notify clients at the end of the serie */
g_get_current_time( &pivot->private->last_event );
if( !pivot->private->event_source_id ){
pivot->private->event_source_id =
g_timeout_add( st_timeout_msec, ( GSourceFunc ) on_item_changed_timeout, pivot );
}
}
}
/**
* na_pivot_get_items:
* @pivot: this #NAPivot instance.
......
......@@ -124,11 +124,15 @@ typedef enum {
NAPivot *na_pivot_new( void );
void na_pivot_dump( const NAPivot *pivot );
void na_pivot_item_changed_handler( NAIIOProvider *provider, const gchar *id, NAPivot *pivot );
/* providers management of any NAIxxxxProvider interface
*/
GList *na_pivot_get_providers( const NAPivot *pivot, GType type );
void na_pivot_free_providers( GList *providers );
/* menus/actions items management
*/
void na_pivot_item_changed_handler( NAIIOProvider *provider, const gchar *id, NAPivot *pivot );
GList *na_pivot_get_items( const NAPivot *pivot );
void na_pivot_load_items( NAPivot *pivot );
......@@ -139,6 +143,8 @@ void na_pivot_remove_item( NAPivot *pivot, NAObject *item );
guint na_pivot_delete_item( const NAPivot *pivot, const NAObjectItem *item, GSList **messages );
guint na_pivot_write_item( const NAPivot *pivot, NAObjectItem *item, GSList **messages );
/* NAIPivotConsumer interface management
*/
void na_pivot_register_consumer( NAPivot *pivot, const NAIPivotConsumer *consumer );
/* NAPivot properties and configuration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment