[nautilus-actions] na_pivot_set_loadable_population
- From: Pierre Wieser <pwieser src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [nautilus-actions] na_pivot_set_loadable_population
- Date: Sat, 30 Jan 2010 17:39:25 +0000 (UTC)
commit d40f6e924fef296afbfc57e2cc049abbeec9dfca
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Jan 25 21:19:29 2010 +0100
na_pivot_set_loadable_population
Renamed from na_pivot_set_population() for a better readability.
ChangeLog | 9 +++++++
nautilus-actions/plugin/nautilus-actions.c | 2 +-
nautilus-actions/runtime/na-pivot.c | 31 +++++++++++++-----------
nautilus-actions/runtime/na-pivot.h | 13 ++++++++--
nautilus-actions/utils/nautilus-actions-run.c | 1 +
5 files changed, 38 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2d12351..f7b8ea5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2009-01-25 Pierre Wieser <pwieser trychlos org>
+ * nautilus-actions/runtime/na-pivot.c:
+ * nautilus-actions/runtime/na-pivot.h (na_pivot_set_population):
+ Function is renamed to na_pivot_set_loadable_population().
+ The enum is named NAPivotLoadable.
+
+ * nautilus-actions/plugin/nautilus-actions.c (instance_init):
+ * nautilus-actions/utils/nautilus-actions-run.c (get_action):
+ Adjusted accordingly.
+
* nautilus-actions/runtime/na-module.c: Source slight adjustment.
2009-01-23 Pierre Wieser <pwieser trychlos org>
diff --git a/nautilus-actions/plugin/nautilus-actions.c b/nautilus-actions/plugin/nautilus-actions.c
index c4bea03..1305552 100644
--- a/nautilus-actions/plugin/nautilus-actions.c
+++ b/nautilus-actions/plugin/nautilus-actions.c
@@ -220,7 +220,7 @@ instance_init( GTypeInstance *instance, gpointer klass )
self->private->pivot = na_pivot_new();
na_pivot_register_consumer( self->private->pivot, NA_IPIVOT_CONSUMER( self ));
na_pivot_set_automatic_reload( self->private->pivot, TRUE );
- na_pivot_set_population( self->private->pivot, !PIVOT_LOAD_DISABLED & !PIVOT_LOAD_INVALID );
+ na_pivot_set_loadable_population( self->private->pivot, !PIVOT_LOAD_DISABLED & !PIVOT_LOAD_INVALID );
na_pivot_load_items( self->private->pivot );
}
diff --git a/nautilus-actions/runtime/na-pivot.c b/nautilus-actions/runtime/na-pivot.c
index 49b7851..51a34ac 100644
--- a/nautilus-actions/runtime/na-pivot.c
+++ b/nautilus-actions/runtime/na-pivot.c
@@ -52,38 +52,38 @@ struct NAPivotClassPrivate {
/* private instance data
*/
struct NAPivotPrivate {
- gboolean dispose_has_run;
+ gboolean dispose_has_run;
/* dynamically loaded modules (extension plugins)
*/
- GList *modules;
+ GList *modules;
/* list of instances to be notified of repository updates
* these are called 'consumers' of NAPivot
*/
- GList *consumers;
+ GList *consumers;
/* configuration tree
*/
- GList *tree;
+ 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
* defaults to FALSE
*/
- gboolean automatic_reload;
- GTimeVal last_event;
- guint event_source_id;
- gulong action_changed_handler;
+ gboolean automatic_reload;
+ GTimeVal last_event;
+ guint event_source_id;
+ gulong action_changed_handler;
/* whether to load all items, or only a part
*/
- gint population;
+ NAPivotLoadable loadable_population;
/* list of monitoring objects on runtime preferences
*/
- GList *monitors;
+ GList *monitors;
};
enum {
@@ -218,13 +218,15 @@ instance_init( GTypeInstance *instance, gpointer klass )
self->private = g_new0( NAPivotPrivate, 1 );
+ /* these defaults are suitable for the NACT management user interface
+ */
self->private->dispose_has_run = FALSE;
self->private->modules = NULL;
self->private->consumers = NULL;
self->private->tree = NULL;
self->private->automatic_reload = FALSE;
self->private->event_source_id = 0;
- self->private->population = PIVOT_LOAD_ALL;
+ self->private->loadable_population = PIVOT_LOAD_ALL;
}
static void
@@ -673,7 +675,7 @@ na_pivot_set_automatic_reload( NAPivot *pivot, gboolean reload )
}
/**
- * na_pivot_set_population:
+ * na_pivot_set_loadable_population:
* @pivot: this #NAPivot instance.
* @population: an indicator of the population to be loaded.
*
@@ -682,12 +684,13 @@ na_pivot_set_automatic_reload( NAPivot *pivot, gboolean reload )
* which mean 'loads all'.
*/
void
-na_pivot_set_population( NAPivot *pivot, gint population )
+na_pivot_set_loadable_population( NAPivot *pivot, NAPivotLoadable population )
{
g_return_if_fail( NA_IS_PIVOT( pivot ));
if( !pivot->private->dispose_has_run ){
- pivot->private->population = population;
+
+ pivot->private->loadable_population = population;
}
}
diff --git a/nautilus-actions/runtime/na-pivot.h b/nautilus-actions/runtime/na-pivot.h
index 9d9aa27..d43ede0 100644
--- a/nautilus-actions/runtime/na-pivot.h
+++ b/nautilus-actions/runtime/na-pivot.h
@@ -109,11 +109,16 @@ typedef struct {
GType na_pivot_get_type( void );
-enum {
+/* Loadable population
+ * NACT management user interface defaults to PIVOT_LOAD_ALL
+ * N-A plugin set the loadable population to !PIVOT_LOAD_DISABLED & !PIVOT_LOAD_INVALID
+ */
+typedef enum {
PIVOT_LOAD_DISABLED = 1 << 0,
PIVOT_LOAD_INVALID = 1 << 1,
PIVOT_LOAD_ALL = 0xff,
-};
+}
+ NAPivotLoadable;
NAPivot *na_pivot_new( void );
@@ -136,10 +141,12 @@ guint na_pivot_write_item( const NAPivot *pivot, NAObjectItem *item, GSL
void na_pivot_register_consumer( NAPivot *pivot, const NAIPivotConsumer *consumer );
+/* NAPivot properties and configuration
+ */
gboolean na_pivot_get_automatic_reload( const NAPivot *pivot );
void na_pivot_set_automatic_reload( NAPivot *pivot, gboolean reload );
-void na_pivot_set_population( NAPivot *pivot, gint population );
+void na_pivot_set_loadable_population( NAPivot *pivot, NAPivotLoadable loadable );
gboolean na_pivot_is_disable_loadable( const NAPivot *pivot );
gboolean na_pivot_is_invalid_loadable( const NAPivot *pivot );
diff --git a/nautilus-actions/utils/nautilus-actions-run.c b/nautilus-actions/utils/nautilus-actions-run.c
index 2d2a26b..b7e6394 100644
--- a/nautilus-actions/utils/nautilus-actions-run.c
+++ b/nautilus-actions/utils/nautilus-actions-run.c
@@ -214,6 +214,7 @@ get_action( const gchar *id )
action = NULL;
pivot = na_pivot_new();
+ na_pivot_set_loadable_population( pivot, !PIVOT_LOAD_DISABLED & !PIVOT_LOAD_INVALID );
na_pivot_load_items( pivot );
action = ( NAObjectAction * ) na_pivot_get_item( pivot, id );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]