Commit ea23fae8 authored by Pierre Wieser's avatar Pierre Wieser

Remove NactIIOClient interface

parent 8838b74f
2009-06-06 Pierre Wieser <pwieser@trychlos.org>
Remove NactIIOClient interface.
* src/common/nact-iio-client.c:
* src/common/nact-iio-client.h:
* src/common/nact-io-client.c:
* src/common/nact-io-client.c:
Remove files.
* src/common/Makefile.am:
* src/common/nact-action-profile.c:
* src/common/nact-action-profile.h:
* src/common/nact-action.c:
* src/common/nact-action.h:
* src/common/nact-gconf.c:
* src/common/nact-gconf.h:
* src/common/nact-iio-provider.c:
* src/common/nact-iio-provider.h:
* src/common/nact-pivot.c:
* src/common/nact-pivot.h:
Updated accordingly.
2009-06-05 Pierre Wieser <pwieser@trychlos.org>
Create pivot data structure NactPivotValue
......
......@@ -42,12 +42,8 @@ libnact_la_SOURCES = \
nact-gconf.c \
nact-gconf.h \
nact-gconf-keys.h \
nact-iio-client.c \
nact-iio-client.h \
nact-iio-provider.c \
nact-iio-provider.h \
nact-io-client.c \
nact-io-client.h \
nact-object.c \
nact-object.h \
nact-pivot.c \
......
......@@ -36,9 +36,8 @@
#include <libnautilus-extension/nautilus-file-info.h>
#include "nact-action.h"
#include "nact-action-profile.h"
#include "nact-iio-client.h"
#include "nact-iio-provider.h"
#include "uti-lists.h"
struct NactActionProfilePrivate {
......@@ -50,7 +49,7 @@ struct NactActionProfilePrivate {
/* profile properties
*/
gchar *name; /* GConf key = id */
gchar *name;
gchar *label;
gchar *path;
gchar *parameters;
......@@ -81,6 +80,22 @@ enum {
PROP_SCHEMES
};
/* please note that property names must have the same spelling as the
* NactIIOProvider parameters
*/
#define PROP_ACTION_STR "action"
#define PROP_PROFILE_NAME_STR "name"
#define PROP_LABEL_STR "desc-name"
#define PROP_PATH_STR "path"
#define PROP_PARAMETERS_STR "parameters"
#define PROP_ACCEPT_MULTIPLE_STR "accept-multiple-files"
#define PROP_BASENAMES_STR "basenames"
#define PROP_ISDIR_STR "isdir"
#define PROP_ISFILE_STR "isfile"
#define PROP_MATCHCASE_STR "matchcase"
#define PROP_MIMETYPES_STR "mimetypes"
#define PROP_SCHEMES_STR "schemes"
static NactObjectClass *st_parent_class = NULL;
static GType register_type( void );
......@@ -95,6 +110,20 @@ static void do_dump( const NactObject *profile );
static void do_dump_list( const gchar *thisfn, const gchar *label, GSList *list );
static int validate_schemes( GSList* schemes2test, NautilusFileInfo* file );
NactActionProfile *
nact_action_profile_new( const NactObject *action, const gchar *name )
{
g_assert( NACT_IS_ACTION( action ));
g_assert( name && strlen( name ));
NactActionProfile *profile =
g_object_new(
NACT_ACTION_PROFILE_TYPE,
PROP_ACTION_STR, action, PROP_PROFILE_NAME_STR, name, NULL );
return( profile );
}
GType
nact_action_profile_get_type( void )
{
......@@ -141,86 +170,86 @@ class_init( NactActionProfileClass *klass )
GParamSpec *spec;
spec = g_param_spec_pointer(
"action",
"action",
PROP_ACTION_STR,
PROP_ACTION_STR,
"The NactAction object",
G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_ACTION, spec );
/* the id of the object is marked as G_PARAM_CONSTRUCT_ONLY */
spec = g_param_spec_string(
"name",
"name",
PROP_PROFILE_NAME_STR,
PROP_PROFILE_NAME_STR,
"Internal profile's name", "",
G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_PROFILE_NAME, spec );
spec = g_param_spec_string(
"desc-name",
"desc-name",
PROP_LABEL_STR,
PROP_LABEL_STR,
"Displayable profile's name", "",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_LABEL, spec );
spec = g_param_spec_string(
"path",
"path",
PROP_PATH_STR,
PROP_PATH_STR,
"Command path", "",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_PATH, spec );
spec = g_param_spec_string(
"parameters",
"parameters",
PROP_PARAMETERS_STR,
PROP_PARAMETERS_STR,
"Command parameters", "",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_PARAMETERS, spec );
spec = g_param_spec_boolean(
"accept-multiple-files",
"accept-multiple-files",
PROP_ACCEPT_MULTIPLE_STR,
PROP_ACCEPT_MULTIPLE_STR,
"Whether apply when multiple files may be selected", TRUE,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_ACCEPT_MULTIPLE, spec );
spec = g_param_spec_pointer(
"basenames",
"basenames",
PROP_BASENAMES_STR,
PROP_BASENAMES_STR,
"Filenames mask",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_BASENAMES, spec );
spec = g_param_spec_boolean(
"isdir",
"isdir",
PROP_ISDIR_STR,
PROP_ISDIR_STR,
"Whether apply when a dir is selected", FALSE,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_ISDIR, spec );
spec = g_param_spec_boolean(
"isfile",
"isfile",
PROP_ISFILE_STR,
PROP_ISFILE_STR,
"Whether apply when a file is selected", TRUE,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_ISFILE, spec );
spec = g_param_spec_boolean(
"matchcase",
"matchcase",
PROP_MATCHCASE_STR,
PROP_MATCHCASE_STR,
"Whether the filenames are case sensitive", TRUE,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_MATCHCASE, spec );
spec = g_param_spec_pointer(
"mimetypes",
"mimetypes",
PROP_MIMETYPES_STR,
PROP_MIMETYPES_STR,
"List of selectable mimetypes",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_MIMETYPES, spec );
spec = g_param_spec_pointer(
"schemes",
"schemes",
PROP_SCHEMES_STR,
PROP_SCHEMES_STR,
"list of selectable schemes",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_SCHEMES, spec );
......@@ -408,6 +437,9 @@ instance_finalize( GObject *object )
g_free( self->private->label );
g_free( self->private->path );
g_free( self->private->parameters );
nactuti_free_string_list( self->private->basenames );
nactuti_free_string_list( self->private->mimetypes );
nactuti_free_string_list( self->private->schemes );
/* chain call to parent class */
if((( GObjectClass * ) st_parent_class )->finalize ){
......@@ -415,32 +447,6 @@ instance_finalize( GObject *object )
}
}
NactActionProfile *
nact_action_profile_new( const NactObject *action, const gchar *name )
{
g_assert( NACT_IS_OBJECT( action ));
g_assert( name && strlen( name ));
NactActionProfile *profile =
g_object_new( NACT_ACTION_PROFILE_TYPE, "action", action, "name", name, NULL );
return( profile );
}
/**
* Load an action.
*
* @action: a NactAction previously allocated via nact_action_new.
*/
void
nact_action_profile_load( NactObject *object )
{
g_assert( NACT_IS_ACTION_PROFILE( object ));
/*NactActionProfile *profile = NACT_ACTION_PROFILE( object );*/
nact_iio_provider_load_profile_properties( object );
}
static void
do_dump( const NactObject *object )
{
......@@ -492,7 +498,7 @@ nact_action_profile_get_action( const NactActionProfile *profile )
g_assert( NACT_IS_ACTION_PROFILE( profile ));
gpointer action;
g_object_get( G_OBJECT( profile ), "action", &action, NULL );
g_object_get( G_OBJECT( profile ), PROP_ACTION_STR, &action, NULL );
return( NACT_OBJECT( action ));
}
......@@ -505,14 +511,14 @@ nact_action_profile_get_action( const NactActionProfile *profile )
* The profile name is also the GConf-key of the profile.
*/
gchar *
nact_action_profile_get_id( const NactActionProfile *profile )
nact_action_profile_get_name( const NactActionProfile *profile )
{
g_assert( NACT_IS_ACTION_PROFILE( profile ));
gchar *id;
g_object_get( G_OBJECT( profile ), "name", &id, NULL );
gchar *name;
g_object_get( G_OBJECT( profile ), PROP_PROFILE_NAME_STR, &name, NULL );
return( id );
return( name );
}
/**
......@@ -526,7 +532,7 @@ nact_action_profile_get_path( const NactActionProfile *profile )
g_assert( NACT_IS_ACTION_PROFILE( profile ));
gchar *path;
g_object_get( G_OBJECT( profile ), "path", &path, NULL );
g_object_get( G_OBJECT( profile ), PROP_PATH_STR, &path, NULL );
return( path );
}
......@@ -542,7 +548,7 @@ nact_action_profile_get_parameters( const NactActionProfile *profile )
g_assert( NACT_IS_ACTION_PROFILE( profile ));
gchar *parameters;
g_object_get( G_OBJECT( profile ), "parameters", &parameters, NULL );
g_object_get( G_OBJECT( profile ), PROP_PARAMETERS_STR, &parameters, NULL );
return( parameters );
}
......
......@@ -75,7 +75,7 @@ NactActionProfile *nact_action_profile_new( const NactObject *action, const gcha
void nact_action_profile_load( NactObject *profile );
NactObject *nact_action_profile_get_action( const NactActionProfile *profile );
gchar *nact_action_profile_get_id( const NactActionProfile *profile );
gchar *nact_action_profile_get_name( const NactActionProfile *profile );
gchar *nact_action_profile_get_path( const NactActionProfile *profile );
gchar *nact_action_profile_get_parameters( const NactActionProfile *profile );
......
......@@ -36,20 +36,14 @@
#include "nact-action.h"
#include "nact-action-profile.h"
#include "nact-iio-client.h"
#include "nact-iio-provider.h"
#include "nact-io-client.h"
#include "uti-lists.h"
struct NactActionPrivate {
gboolean dispose_has_run;
/* io client
*/
NactIOClient *io;
/* action properties
*/
gchar *uuid;
gchar *version;
gchar *label;
gchar *tooltip;
......@@ -65,17 +59,26 @@ struct NactActionClassPrivate {
};
enum {
PROP_VERSION = 1,
PROP_UUID = 1,
PROP_VERSION,
PROP_LABEL,
PROP_TOOLTIP,
PROP_ICON
};
/* please note that property names must have the same spelling as the
* NactIIOProvider parameters
*/
#define PROP_UUID_STR "uuid"
#define PROP_VERSION_STR "version"
#define PROP_LABEL_STR "label"
#define PROP_TOOLTIP_STR "tooltip"
#define PROP_ICON_STR "icon"
static NactObjectClass *st_parent_class = NULL;
static GType register_type( void );
static void class_init( NactActionClass *klass );
static void iio_client_iface_init( NactIIOClientInterface *iface );
static void instance_init( GTypeInstance *instance, gpointer klass );
static void instance_dispose( GObject *object );
static void instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec );
......@@ -84,7 +87,6 @@ static void instance_finalize( GObject *object );
static void free_profiles( NactAction *action );
static GObject *do_get_io_client( const NactIIOClient *client );
static void do_dump( const NactObject *action );
/**
......@@ -99,10 +101,9 @@ static void do_dump( const NactObject *action );
* basis.
*/
NactAction *
nact_action_new( gpointer provider, gpointer data )
nact_action_new( const gchar *uuid )
{
NactAction *action = g_object_new( NACT_ACTION_TYPE, NULL );
action->private->io = nact_io_client_new( provider, data );
NactAction *action = g_object_new( NACT_ACTION_TYPE, PROP_UUID_STR, uuid, NULL );
return( action );
}
......@@ -133,17 +134,7 @@ register_type( void )
( GInstanceInitFunc ) instance_init
};
GType type = g_type_register_static( NACT_OBJECT_TYPE, "NactAction", &info, 0 );
static const GInterfaceInfo iio_client_iface_info = {
( GInterfaceInitFunc ) iio_client_iface_init,
NULL,
NULL
};
g_type_add_interface_static( type, NACT_IIO_CLIENT_TYPE, &iio_client_iface_info );
return( type );
return( g_type_register_static( NACT_OBJECT_TYPE, "NactAction", &info, 0 ));
}
static void
......@@ -164,29 +155,36 @@ class_init( NactActionClass *klass )
/* the id of the object is marked as G_PARAM_CONSTRUCT_ONLY */
spec = g_param_spec_string(
"version",
"version",
PROP_UUID_STR,
PROP_UUID_STR,
"Globally unique identifier (UUID) of the action", "",
G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_UUID, spec );
spec = g_param_spec_string(
PROP_VERSION_STR,
PROP_VERSION_STR,
"Version of the schema", "",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_VERSION, spec );
spec = g_param_spec_string(
"label",
"label",
PROP_LABEL_STR,
PROP_LABEL_STR,
"Context menu displayable label", "",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_LABEL, spec );
spec = g_param_spec_string(
"tooltip",
"tooltip",
PROP_TOOLTIP_STR,
PROP_TOOLTIP_STR,
"Context menu tooltip", "",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_TOOLTIP, spec );
spec = g_param_spec_string(
"icon",
"icon",
PROP_ICON_STR,
PROP_ICON_STR,
"Context menu displayable icon", "",
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_ICON, spec );
......@@ -196,15 +194,6 @@ class_init( NactActionClass *klass )
NACT_OBJECT_CLASS( klass )->dump = do_dump;
}
static void
iio_client_iface_init( NactIIOClientInterface *iface )
{
static const gchar *thisfn = "nact_action_iio_client_iface_init";
g_debug( "%s: iface=%p", thisfn, iface );
iface->get_io_client = do_get_io_client;
}
static void
instance_init( GTypeInstance *instance, gpointer klass )
{
......@@ -225,6 +214,10 @@ instance_get_property( GObject *object, guint property_id, GValue *value, GParam
NactAction *self = NACT_ACTION( object );
switch( property_id ){
case PROP_UUID:
g_value_set_string( value, self->private->uuid );
break;
case PROP_VERSION:
g_value_set_string( value, self->private->version );
break;
......@@ -254,6 +247,11 @@ instance_set_property( GObject *object, guint property_id, const GValue *value,
NactAction *self = NACT_ACTION( object );
switch( property_id ){
case PROP_UUID:
g_free( self->private->uuid );
self->private->uuid = g_value_dup_string( value );
break;
case PROP_VERSION:
g_free( self->private->version );
self->private->version = g_value_dup_string( value );
......@@ -293,15 +291,9 @@ instance_dispose( GObject *object )
self->private->dispose_has_run = TRUE;
/* release the io_client object */
g_object_unref( self->private->io );
/* release the profiles */
free_profiles( self );
/* release the provider data */
nact_iio_provider_release_data( NACT_IIO_CLIENT( self ));
/* chain up to the parent class */
G_OBJECT_CLASS( st_parent_class )->dispose( object );
}
......@@ -316,6 +308,7 @@ instance_finalize( GObject *object )
g_assert( NACT_IS_ACTION( object ));
NactAction *self = ( NactAction * ) object;
g_free( self->private->uuid );
g_free( self->private->version );
g_free( self->private->label );
g_free( self->private->tooltip );
......@@ -340,31 +333,30 @@ free_profiles( NactAction *action )
action->private->profiles = NULL;
}
static GObject *
do_get_io_client( const NactIIOClient *client )
/**
* Create a new NactAction object, with the given parm and value.
*
* Note that the parm may actually be a profile's parm.
*/
NactAction *
nact_action_create( const gchar *key, const gchar *parm, const NactPivotValue *value )
{
g_assert( NACT_IS_IIO_CLIENT( client ));
g_assert( NACT_IS_ACTION( client ));
NactAction *action = NACT_ACTION( client );
return( G_OBJECT( action->private->io ));
static const gchar *thisfn = "nact_action_create";
g_debug( "%s: key='%s', parm='%s', value=%p", thisfn, key, parm, value );
NactAction *action = g_object_new( NACT_ACTION_TYPE, NULL );
nact_action_update( action, parm, value );
return( action );
}
/**
* Load an action.
*
* @action: a NactAction previously allocated via nact_action_new.
* Update the given parameter of an action.
*/
void
nact_action_load( NactAction *action )
nact_action_update( NactAction *action, const gchar *parm, const NactPivotValue *value )
{
g_assert( NACT_IS_ACTION( action ));
g_assert( NACT_IS_IIO_CLIENT( action ));
nact_iio_provider_load_action_properties( NACT_IIO_CLIENT( action ));
action->private->profiles = nact_iio_provider_load_profiles( NACT_IIO_CLIENT( action ));
nact_object_dump( NACT_OBJECT( action ));
static const gchar *thisfn = "nact_action_update";
g_debug( "%s: action=%p, parm='%s', value=%p", thisfn, action, parm, value );
}
static void
......@@ -379,6 +371,7 @@ do_dump( const NactObject *action )
st_parent_class->dump( action );
}
g_debug( "%s: uuid='%s'", thisfn, self->private->uuid );
g_debug( "%s: version='%s'", thisfn, self->private->version );
g_debug( "%s: label='%s'", thisfn, self->private->label );
g_debug( "%s: tooltip='%s'", thisfn, self->private->tooltip );
......@@ -405,7 +398,7 @@ nact_action_get_uuid( const NactAction *action )
g_assert( NACT_IS_ACTION( action ));
gchar *uuid;
g_object_get( G_OBJECT( action ), "uuid", &uuid, NULL );
g_object_get( G_OBJECT( action ), PROP_UUID_STR, &uuid, NULL );
return( uuid );
}
......@@ -423,7 +416,7 @@ nact_action_get_label( const NactAction *action )
g_assert( NACT_IS_ACTION( action ));
gchar *label;
g_object_get( G_OBJECT( action ), "label", &label, NULL );
g_object_get( G_OBJECT( action ), PROP_LABEL_STR, &label, NULL );
return( label );
}
......@@ -441,7 +434,7 @@ nact_action_get_tooltip( const NactAction *action )
g_assert( NACT_IS_ACTION( action ));
gchar *tooltip;
g_object_get( G_OBJECT( action ), "tooltip", &tooltip, NULL );
g_object_get( G_OBJECT( action ), PROP_TOOLTIP_STR, &tooltip, NULL );
return( tooltip );
}
......@@ -460,7 +453,7 @@ nact_action_get_verified_icon_name( const NactAction *action )
g_assert( NACT_IS_ACTION( action ));
gchar *icon_name;
g_object_get( G_OBJECT( action ), "icon", &icon_name, NULL );
g_object_get( G_OBJECT( action ), PROP_ICON_STR, &icon_name, NULL );
if( icon_name[0] == '/' ){
if( !g_file_test( icon_name, G_FILE_TEST_IS_REGULAR )){
......
......@@ -40,6 +40,7 @@
*/
#include "nact-object.h"
#include "nact-pivot.h"
G_BEGIN_DECLS
......@@ -68,9 +69,12 @@ typedef struct {
GType nact_action_get_type( void );
NactAction *nact_action_new( gpointer provider, gpointer data );
NactAction *nact_action_new( const gchar *uuid );
void nact_action_load( NactAction *action );
NactAction *nact_action_create( const gchar *key, const gchar *parm, const NactPivotValue *value );
void nact_action_update( NactAction *action, const gchar *parm, const NactPivotValue *value );
gboolean nact_action_is_empty( const NactAction *action );
gchar *nact_action_get_uuid( const NactAction *action );
gchar *nact_action_get_label( const NactAction *action );
......
......@@ -41,14 +41,12 @@
#include "nact-action-profile.h"
#include "nact-gconf.h"
#include "nact-gconf-keys.h"
#include "nact-iio-client.h"
#include "nact-iio-provider.h"
#include "nact-pivot.h"
#include "uti-lists.h"
struct NactGConfPrivate {
gboolean dispose_has_run;
NactPivot *pivot;
GObject *notification_handler;
GConfClient *gconf;
guint notify_id;
};
......@@ -56,16 +54,12 @@ struct NactGConfPrivate {
struct NactGConfClassPrivate {
};
typedef struct {
gchar *key;
gchar *path;
}
NactGConfIO;
enum {
PROP_PIVOT = 1
PROP_NOTIFICATION_HANDLER = 1
};
#define PROP_NOTIFICATION_HANDLER_STR "notification-handler"
static GObjectClass *st_parent_class = NULL;
static GType register_type( void );
......@@ -79,27 +73,25 @@ static void instance_finalize( GObject *object );
static guint install_gconf_watch( NactGConf *gconf );
static void remove_gconf_watch( NactGConf *gconf );
static void actions_changed_cb( GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data );
static void action_changed_cb( GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data );
static void free_keys_values( GSList *keys );
static GSList *load_keys_values( const NactGConf *gconf, const gchar *path );
static GSList *load_subdirs( const NactGConf *gconf, const gchar *path );
static gchar *path_to_key( const gchar *path );
static NactGConfIO *path_to_struct( const gchar *path );
/*static NactGConfIO *path_to_struct( const gchar *path );*/
static void set_item_properties( NactObject *object, GSList *properties );
static NactPivotValue *value_to_pivot( const GConfValue *value );
static void load_action_properties( NactGConf *gconf, NactAction *action );
static GSList *load_profiles( NactGConf *gconf, NactAction *action );
static void load_profile_properties( NactGConf *gconf, NactActionProfile *profile );
static GSList *do_load_actions( NactIIOProvider *provider );
static void do_load_action_properties( NactIIOClient *client );
static GSList *do_load_profiles( NactIIOClient *client );
static void do_load_profile_properties( NactObject *profile );
static void do_release_data( NactIIOClient *client );
NactGConf *
nact_gconf_new( const GObject *pivot )
nact_gconf_new( const GObject *handler )
{
g_assert( NACT_IS_PIVOT( pivot ));
return( g_object_new( NACT_GCONF_TYPE, "pivot", pivot, NULL ));
return( g_object_new( NACT_GCONF_TYPE, PROP_NOTIFICATION_HANDLER_STR, handler, NULL ));
}
GType
......@@ -158,11 +150,11 @@ class_init( NactGConfClass *klass )
GParamSpec *spec;
spec = g_param_spec_pointer(
"pivot",
"pivot",
"A pointer to NactPivot object",
PROP_NOTIFICATION_HANDLER_STR,
PROP_NOTIFICATION_HANDLER_STR,
"A pointer to a GObject which will receive action_changed notifications",
G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE );
g_object_class_install_property( object_class, PROP_PIVOT, spec );
g_object_class_install_property( object_class, PROP_NOTIFICATION_HANDLER, spec );
klass->private = g_new0( NactGConfClassPrivate, 1 );
}
......@@ -174,10 +166,6 @@ iio_provider_iface_init( NactIIOProviderInterface *iface )
g_debug( "%s: iface=%p", thisfn, iface );
iface->load_actions = do_load_actions;
iface->load_action_properties = do_load_action_properties;
iface->load_profiles = do_load_profiles;
iface->load_profile_properties = do_load_profile_properties;
iface->release_data = do_release_data;
}
static void
......@@ -203,8 +191,8 @@ instance_get_property( GObject *object, guint property_id, GValue *value, GParam
NactGConf *self = NACT_GCONF( object );
switch( property_id ){
case PROP_PIVOT:
g_value_set_pointer( value, self->private->pivot );
case PROP_NOTIFICATION_HANDLER:
g_value_set_pointer( value, self->private->notification_handler );
break;
default:
......@@ -220,8 +208,8 @@ instance_set_property( GObject *object, guint property_id, const GValue *value,
NactGConf *self = NACT_GCONF( object );
switch( property_id ){
case PROP_PIVOT:
self->private->pivot = g_value_get_pointer( value );
case PROP_NOTIFICATION_HANDLER:
self->private->notification_handler = g_value_get_pointer( value );
break;
default:
......@@ -261,6 +249,13 @@ instance_finalize( GObject *object )
}
}
/*
* note that we need the NactPivot object in action_changed_cb handler
* but it is initialized as a construction property, and this watch is
* installed from instance_init, i.e. before properties are set..
*
* we so pass NactGConf pointer which is already valid at this time.
*/
static guint
install_gconf_watch( NactGConf *gconf )