[nautilus-actions] Cleanup the code
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Cleanup the code
- Date: Wed, 3 Mar 2010 21:53:54 +0000 (UTC)
commit 119580bae4367161f4e48a43e37771a61d1f6a67
Author: Pierre Wieser <pwieser trychlos org>
Date: Wed Mar 3 22:47:06 2010 +0100
Cleanup the code
ChangeLog | 11 +
src/api/na-ifactory-object.h | 9 -
src/core/na-ifactory-object.c | 116 +------
src/core/na-iio-provider.c | 8 -
src/io-desktop/nadp-desktop-file.c | 667 --------------------------------
src/io-desktop/nadp-desktop-file.h | 32 --
src/io-xml/naxml-writer.c | 752 ------------------------------------
src/io-xml/naxml-writer.h | 7 -
src/nact/nact-iadvanced-tab.c | 46 ---
src/nact/nact-main-menubar.c | 64 ---
src/utils/nautilus-actions-new.c | 4 -
11 files changed, 13 insertions(+), 1703 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 28439eb..981ebbb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2009-03-03 Pierre Wieser <pwieser trychlos org>
+ * src/api/na-ifactory-object.h:
+ * src/core/na-ifactory-object.c:
+ * src/core/na-iio-provider.c:
+ * src/io-desktop/nadp-desktop-file.c:
+ * src/io-desktop/nadp-desktop-file.h:
+ * src/io-xml/naxml-writer.c:
+ * src/io-xml/naxml-writer.h:
+ * src/nact/nact-iadvanced-tab.c:
+ * src/nact/nact-main-menubar.c:
+ * src/utils/nautilus-actions-new.c: Cleanup the code.
+
* src/nact/nact-assistant-export.c (assist_prepare_confirm):
Optimize the build of the displayed text.
diff --git a/src/api/na-ifactory-object.h b/src/api/na-ifactory-object.h
index 7f9a7d0..8afadbf 100644
--- a/src/api/na-ifactory-object.h
+++ b/src/api/na-ifactory-object.h
@@ -181,15 +181,6 @@ void *na_ifactory_object_get_as_void ( const NAIFactoryObject *object,
void na_ifactory_object_set_from_void ( NAIFactoryObject *object, const gchar *name, const void *data );
-#if 0
-void na_ifactory_object_set_from_string( NAIFactoryObject *object, guint data_id, const gchar *data );
-#endif
-
-#if 0
-NADataDef *na_ifactory_object_get_data_def_from_name ( const NAIFactoryObject *object, const gchar *name );
-NADataDef *na_ifactory_object_get_data_def_from_gconf_key( const NAIFactoryObject *object, const gchar *entry );
-#endif
-
G_END_DECLS
#endif /* __NAUTILUS_ACTIONS_API_NA_IFACTORY_OBJECT_H__ */
diff --git a/src/core/na-ifactory-object.c b/src/core/na-ifactory-object.c
index 9345065..8cbf1b4 100644
--- a/src/core/na-ifactory-object.c
+++ b/src/core/na-ifactory-object.c
@@ -44,11 +44,8 @@ struct NAIFactoryObjectInterfacePrivate {
void *empty; /* so that gcc -pedantic is happy */
};
-gboolean ifactory_object_initialized = FALSE;
-gboolean ifactory_object_finalized = FALSE;
-#if 0
-NAIFactoryObjectInterface *ifactory_object_klass = NULL;
-#endif
+gboolean ifactory_object_initialized = FALSE;
+gboolean ifactory_object_finalized = FALSE;
static GType register_type( void );
static void interface_base_init( NAIFactoryObjectInterface *klass );
@@ -119,10 +116,6 @@ interface_base_init( NAIFactoryObjectInterface *klass )
klass->write_start = NULL;
klass->write_done = NULL;
-#if 0
- ifactory_object_klass = klass;
-#endif
-
ifactory_object_initialized = TRUE;
}
}
@@ -131,9 +124,6 @@ static void
interface_base_finalize( NAIFactoryObjectInterface *klass )
{
static const gchar *thisfn = "na_ifactory_object_interface_base_finalize";
-#if 0
- GList *ip;
-#endif
if( ifactory_object_initialized && !ifactory_object_finalized ){
@@ -141,14 +131,6 @@ interface_base_finalize( NAIFactoryObjectInterface *klass )
ifactory_object_finalized = TRUE;
-#if 0
- for( ip = klass->private->registered ; ip ; ip = ip->next ){
- NADataImplement *known = ( NADataImplement * ) ip->data;
- g_free( known );
- }
- g_list_free( klass->private->registered );
-#endif
-
g_free( klass->private );
}
}
@@ -159,82 +141,6 @@ ifactory_object_get_version( const NAIFactoryObject *instance )
return( 1 );
}
-#if 0
-/**
- * na_ifactory_object_get_data_def_from_name:
- * @object: a #NAIFactoryObject object.
- * @name: the name of the elementary we are searching for.
- *
- * Returns: The #NADataDef structure which defines this @name for this @object,
- * or %NULL.
- */
-NADataDef *
-na_ifactory_object_get_data_def_from_name( const NAIFactoryObject *object, const gchar *name )
-{
- g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL );
-
- if( ifactory_object_initialized && !ifactory_object_finalized ){
-
- NADataGroup *groups = na_factory_object_get_data_groups( object );
- while( groups->group ){
-
- NADataDef *def = groups->def;
- if( def ){
- while( def->name ){
-
- if( !strcmp( def->name, name )){
- return( def );
- }
-
- def++;
- }
- }
-
- groups++;
- }
- }
-
- return( NULL );
-}
-
-/**
- * na_ifactory_object_get_data_def_from_gconf_key:
- * @object: a #NAIFactoryObject object.
- * @entry: the name of the GConf entry we are searching for.
- *
- * Returns: the #NADataDef structure which defines this GConf @entry,
- * or %NULL if not found.
- */
-NADataDef *
-na_ifactory_object_get_data_def_from_gconf_key( const NAIFactoryObject *object, const gchar *entry )
-{
- g_return_val_if_fail( NA_IS_IFACTORY_OBJECT( object ), NULL );
-
- if( ifactory_object_initialized && !ifactory_object_finalized ){
-
- NADataGroup *groups = na_factory_object_get_data_groups( object );
- while( groups->group ){
-
- NADataDef *def = groups->def;
- if( def ){
- while( def->name ){
-
- if( def->gconf_entry && !strcmp( def->gconf_entry, entry )){
- return( def );
- }
-
- def++;
- }
- }
-
- groups++;
- }
- }
-
- return( NULL );
-}
-#endif
-
/**
* na_ifactory_object_get_data_boxed:
* @object: a #NAIFactoryObject object.
@@ -291,24 +197,6 @@ na_ifactory_object_get_as_void( const NAIFactoryObject *object, const gchar *nam
return( na_factory_object_get_as_void( object, name ));
}
-#if 0
-/**
- * na_ifactory_object_set_from_string:
- * @object: this #NAIFactoryObject instance.
- * @data_id: the elementary data whose value is to be set.
- * @data: the value to set.
- *
- * Set the elementary data with the given value.
- */
-void
-na_ifactory_object_set_from_string( NAIFactoryObject *object, guint data_id, const gchar *data )
-{
- g_return_if_fail( NA_IS_IFACTORY_OBJECT( object ));
-
- na_factory_object_set_from_string( object, data_id, data );
-}
-#endif
-
/**
* na_ifactory_object_set_from_void:
* @object: this #NAIFactoryObject instance.
diff --git a/src/core/na-iio-provider.c b/src/core/na-iio-provider.c
index 4dfc502..63f7771 100644
--- a/src/core/na-iio-provider.c
+++ b/src/core/na-iio-provider.c
@@ -112,14 +112,6 @@ interface_base_init( NAIIOProviderInterface *klass )
{
static const gchar *thisfn = "na_iio_provider_interface_base_init";
-#if 0
- g_debug( "%s: st_initialized=%s, st_finalized=%s, klass%p (%s)",
- thisfn,
- st_initialized ? "True":"False",
- st_finalized ? "True":"False",
- ( void * ) klass, G_OBJECT_CLASS_NAME( klass ));
-#endif
-
if( !st_initialized ){
g_debug( "%s: klass%p (%s)", thisfn, ( void * ) klass, G_OBJECT_CLASS_NAME( klass ));
diff --git a/src/io-desktop/nadp-desktop-file.c b/src/io-desktop/nadp-desktop-file.c
index 0d5c0be..98fd492 100644
--- a/src/io-desktop/nadp-desktop-file.c
+++ b/src/io-desktop/nadp-desktop-file.c
@@ -67,13 +67,6 @@ static void instance_finalize( GObject *object );
static NadpDesktopFile *ndf_new( const gchar *path );
static gchar *path2id( const gchar *path );
static gboolean check_key_file( NadpDesktopFile *ndf );
-#if 0
-static gboolean ndf_has_entry( const NadpDesktopFile *ndf, const gchar *group, const gchar *entry );
-static gboolean ndf_read_bool( const NadpDesktopFile *ndf, const gchar *group, const gchar *entry, gboolean default_value );
-static gchar *ndf_read_profile_string( const NadpDesktopFile *ndf, const gchar *profile_id, const gchar *entry );
-static GSList *ndf_read_profile_string_list( const NadpDesktopFile *ndf, const gchar *profile_id, const gchar *entry );
-static gchar *group_name_to_profile_id( const gchar *group_name );
-#endif
GType
nadp_desktop_file_get_type( void )
@@ -642,666 +635,6 @@ nadp_desktop_file_get_uint( const NadpDesktopFile *ndf, const gchar *group, cons
return( value );
}
-#if 0
-/**
- * nadp_desktop_file_get_name:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: the label of the action, as a newly allocated string which
- * should be g_free() by the caller.
- */
-gchar *
-nadp_desktop_file_get_name( const NadpDesktopFile *ndf )
-{
- gchar *label;
-
- label = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), label );
-
- if( !ndf->private->dispose_has_run ){
- label = g_key_file_get_locale_string(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NAME, NULL, NULL );
-
- if( !label ){
- label = g_strdup( "" );
- }
- }
-
- return( label );
-}
-
-/**
- * nadp_desktop_file_get_tooltip:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: the tooltip of the action, as a newly allocated string which
- * should be g_free() by the caller.
- */
-gchar *
-nadp_desktop_file_get_tooltip( const NadpDesktopFile *ndf )
-{
- gchar *tooltip;
-
- tooltip = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), tooltip );
-
- if( !ndf->private->dispose_has_run ){
- tooltip = g_key_file_get_locale_string(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, NADP_KEY_TOOLTIP, NULL, NULL );
-
- if( !tooltip ){
- tooltip = g_strdup( "" );
- }
- }
-
- return( tooltip );
-}
-
-/**
- * nadp_desktop_file_get_icon:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: the icon of the action, as a newly allocated string which
- * should be g_free() by the caller.
- */
-gchar *
-nadp_desktop_file_get_icon( const NadpDesktopFile *ndf )
-{
- gchar *icon;
-
- icon = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), icon );
-
- if( !ndf->private->dispose_has_run ){
- icon = g_key_file_get_locale_string(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, NULL, NULL );
-
- if( !icon ){
- icon = g_strdup( "" );
- }
- }
-
- return( icon );
-}
-
-/**
- * nadp_desktop_file_get_enabled:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: %TRUE if the action is enabled, %FALSE else.
- *
- * Defaults to TRUE if the key is not specified.
- */
-gboolean
-nadp_desktop_file_get_enabled( const NadpDesktopFile *ndf )
-{
- gboolean enabled;
-
- enabled = TRUE;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), enabled );
-
- if( !ndf->private->dispose_has_run ){
-
- enabled = !ndf_read_bool( ndf, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, FALSE );
- }
-
- return( enabled );
-}
-
-/**
- * nadp_desktop_file_get_items_list:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: The string list value associated to the ItemsList entry.
- * Returns: %NULL if the entry is not found or empty.
- */
-GSList *
-nadp_desktop_file_get_items_list( const NadpDesktopFile *ndf )
-{
- GSList *list;
- gchar **string_list;
- gsize count;
-
- list = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL );
-
- if( !ndf->private->dispose_has_run ){
-
- string_list = g_key_file_get_string_list(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, NADP_KEY_ITEMS_LIST, &count, NULL );
-
- if( string_list ){
- list = nadp_utils_to_slist(( const gchar ** ) string_list );
- g_strfreev( string_list );
- }
- }
-
- return( list );
-}
-
-/**
- * nadp_desktop_file_get_target_context:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: %TRUE if the action targets the context menu, %FALSE else.
- *
- * Defaults to TRUE if the key is not specified.
- */
-gboolean
-nadp_desktop_file_get_target_context( const NadpDesktopFile *ndf )
-{
- gboolean target_context;
-
- target_context = TRUE;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), target_context );
-
- if( !ndf->private->dispose_has_run ){
-
- target_context = ndf_read_bool( ndf, G_KEY_FILE_DESKTOP_GROUP, NADP_KEY_TARGET_CONTEXT, TRUE );
- }
-
- return( target_context );
-}
-
-/**
- * nadp_desktop_file_get_target_toolbar:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: %TRUE if the action is target_toolbar, %FALSE else.
- *
- * Defaults to TRUE if the key is not specified.
- */
-gboolean
-nadp_desktop_file_get_target_toolbar( const NadpDesktopFile *ndf )
-{
- gboolean target_toolbar;
-
- target_toolbar = TRUE;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), target_toolbar );
-
- if( !ndf->private->dispose_has_run ){
-
- target_toolbar = ndf_read_bool( ndf, G_KEY_FILE_DESKTOP_GROUP, NADP_KEY_TARGET_TOOLBAR, FALSE );
- }
-
- return( target_toolbar );
-}
-
-/**
- * nadp_desktop_file_get_toolbar_label:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: the label of the action in the toolbar, as a newly allocated
- * string which should be g_free() by the caller.
- */
-gchar *
-nadp_desktop_file_get_toolbar_label( const NadpDesktopFile *ndf )
-{
- gchar *label;
-
- label = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), label );
-
- if( !ndf->private->dispose_has_run ){
-
- label = g_key_file_get_locale_string(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, NADP_KEY_TOOLBAR_LABEL, NULL, NULL );
- }
-
- return( label );
-}
-
-/**
- * nadp_desktop_file_get_profiles_list:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: The string list value associated to the Profiles entry.
- * Returns: %NULL if the entry is not found or empty.
- */
-GSList *
-nadp_desktop_file_get_profiles_list( const NadpDesktopFile *ndf )
-{
- GSList *list;
- gchar **string_list;
- gsize count;
-
- list = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL );
-
- if( !ndf->private->dispose_has_run ){
-
- string_list = g_key_file_get_string_list(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, NADP_KEY_PROFILES, &count, NULL );
-
- if( string_list ){
- list = nadp_utils_to_slist(( const gchar ** ) string_list );
- g_strfreev( string_list );
- }
- }
-
- return( list );
-}
-
-/**
- * nadp_desktop_file_get_profile_group_list:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: The list of profile names extracted from the list of groups.
- * A profile group is identified by its name beggining with X-Action-Profile.
- */
-GSList *
-nadp_desktop_file_get_profile_group_list( const NadpDesktopFile *ndf )
-{
- GSList *groups, *strlist, *is;
- gchar **string_list;
- gchar *profile_id;
-
- groups = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL );
-
- if( !ndf->private->dispose_has_run ){
-
- string_list = g_key_file_get_groups( ndf->private->key_file, NULL );
- if( string_list ){
-
- strlist = nadp_utils_to_slist(( const gchar ** ) string_list );
- g_strfreev( string_list );
-
- for( is = strlist ; is ; is = is->next ){
-
- profile_id = group_name_to_profile_id(( const gchar * ) is->data );
- if( profile_id && strlen( profile_id )){
-
- groups = g_slist_prepend( groups, g_strdup( profile_id ));
- }
-
- g_free( profile_id );
- }
-
- groups = g_slist_reverse( groups );
- nadp_utils_gslist_free( strlist );
- }
- }
-
- return( groups );
-}
-
-/**
- * nadp_desktop_file_get_profile_name:
- * @ndf: the #NadpDesktopFile instance.
- * @profile_id: the id of the profile to be read.
- *
- * Returns: The name of the profile, as a newly allocated string which
- * should be g_free() by the caller.
- */
-gchar *
-nadp_desktop_file_get_profile_name( const NadpDesktopFile *ndf, const gchar *profile_id )
-{
- gchar *name;
-
- name = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL );
-
- if( !ndf->private->dispose_has_run ){
-
- name = ndf_read_profile_string( ndf, profile_id, G_KEY_FILE_DESKTOP_KEY_NAME );
- if( !name ){
- name = g_strdup( "" );
- }
- }
-
- return( name );
-}
-
-/**
- * nadp_desktop_file_get_profile_exec:
- * @ndf: the #NadpDesktopFile instance.
- * @profile_id: the id of the profile to be read.
- *
- * Returns: The command to be executed, as a newly allocated string which
- * should be g_free() by the caller.
- */
-gchar *
-nadp_desktop_file_get_profile_exec( const NadpDesktopFile *ndf, const gchar *profile_id )
-{
- gchar *command;
-
- command = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL );
-
- if( !ndf->private->dispose_has_run ){
-
- command = ndf_read_profile_string( ndf, profile_id, G_KEY_FILE_DESKTOP_KEY_EXEC );
- if( !command ){
-
- command = g_strdup( "" );
- }
- }
-
- return( command );
-}
-
-/**
- * nadp_desktop_file_get_basenames:
- * @ndf: the #NadpDesktopFile instance.
- * @profile_id: the id of the profile to be read.
- *
- * Returns: The list of basenames.
- */
-GSList *
-nadp_desktop_file_get_basenames( const NadpDesktopFile *ndf, const gchar *profile_id )
-{
- GSList *strlist;
-
- strlist = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL );
-
- if( !ndf->private->dispose_has_run ){
-
- strlist = ndf_read_profile_string_list( ndf, profile_id, NADP_KEY_BASENAMES );
- if( !strlist ){
- strlist = g_slist_append( NULL, g_strdup( "*" ));
- }
- }
-
- return( strlist );
-}
-
-/**
- * nadp_desktop_file_get_matchcase:
- * @ndf: the #NadpDesktopFile instance.
- *
- * Returns: %TRUE if the basenames are case sensitive, %FALSE else.
- *
- * Defaults to TRUE if the key is not specified.
- */
-gboolean
-nadp_desktop_file_get_matchcase( const NadpDesktopFile *ndf, const gchar *profile_id )
-{
- gboolean matchcase;
-
- matchcase = TRUE;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), matchcase );
-
- if( !ndf->private->dispose_has_run ){
-
- matchcase = ndf_read_bool( ndf, G_KEY_FILE_DESKTOP_GROUP, NADP_KEY_TARGET_TOOLBAR, TRUE );
- }
-
- return( matchcase );
-}
-
-/**
- * nadp_desktop_file_get_mimetypes:
- * @ndf: the #NadpDesktopFile instance.
- * @profile_id: the id of the profile to be read.
- *
- * Returns: The list of mimetypes.
- */
-GSList *
-nadp_desktop_file_get_mimetypes( const NadpDesktopFile *ndf, const gchar *profile_id )
-{
- GSList *strlist;
-
- strlist = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL );
-
- if( !ndf->private->dispose_has_run ){
-
- strlist = ndf_read_profile_string_list( ndf, profile_id, NADP_KEY_MIMETYPES );
- if( !strlist ){
- strlist = g_slist_append( NULL, g_strdup( "*" ));
- }
- }
-
- return( strlist );
-}
-
-/**
- * nadp_desktop_file_get_schemes:
- * @ndf: the #NadpDesktopFile instance.
- * @profile_id: the id of the profile to be read.
- *
- * Returns: The list of schemes.
- */
-GSList *
-nadp_desktop_file_get_schemes( const NadpDesktopFile *ndf, const gchar *profile_id )
-{
- GSList *strlist;
-
- strlist = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL );
-
- if( !ndf->private->dispose_has_run ){
-
- strlist = ndf_read_profile_string_list( ndf, profile_id, NADP_KEY_SCHEMES );
- if( !strlist ){
- strlist = g_slist_append( NULL, g_strdup( "*" ));
- }
- }
-
- return( strlist );
-}
-
-/**
- * nadp_desktop_file_get_folders:
- * @ndf: the #NadpDesktopFile instance.
- * @profile_id: the id of the profile to be read.
- *
- * Returns: The list of folders.
- */
-GSList *
-nadp_desktop_file_get_folders( const NadpDesktopFile *ndf, const gchar *profile_id )
-{
- GSList *strlist;
-
- strlist = NULL;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), NULL );
-
- if( !ndf->private->dispose_has_run ){
-
- strlist = ndf_read_profile_string_list( ndf, profile_id, NADP_KEY_FOLDERS );
- if( !strlist ){
- strlist = g_slist_append( NULL, g_strdup( "/" ));
- }
- }
-
- return( strlist );
-}
-
-#if 0
-static gboolean
-ndf_has_entry( const NadpDesktopFile *ndf, const gchar *group, const gchar *entry )
-{
- gboolean has_entry;
-
- has_entry = FALSE;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), FALSE );
-
- if( !ndf->private->dispose_has_run ){
-
- has_entry = g_key_file_has_key( ndf->private->key_file, group, entry, NULL );
- }
-
- return( has_entry );
-}
-#endif
-
-static gboolean
-ndf_read_bool( const NadpDesktopFile *ndf, const gchar *group, const gchar *entry, gboolean default_value )
-{
- gboolean value;
- gboolean has_entry;
-
- value = default_value;
- g_return_val_if_fail( NADP_IS_DESKTOP_FILE( ndf ), value );
-
- if( !ndf->private->dispose_has_run ){
-
- has_entry = g_key_file_has_key( ndf->private->key_file, group, entry, NULL );
- if( has_entry ){
- value = g_key_file_get_boolean(
- ndf->private->key_file, group, entry, NULL );
- }
- }
-
- return( value );
-}
-
-static gchar *
-ndf_read_profile_string( const NadpDesktopFile *ndf, const gchar *profile_id, const gchar *entry )
-{
- gchar *string;
- gchar *group_name;
-
- group_name = g_strdup_printf( "%s %s", NADP_GROUP_PROFILE, profile_id );
-
- string = g_key_file_get_locale_string( ndf->private->key_file, group_name, entry, NULL, NULL );
-
- g_free( group_name );
-
- return( string );
-}
-
-static GSList *
-ndf_read_profile_string_list( const NadpDesktopFile *ndf, const gchar *profile_id, const gchar *entry )
-{
- GSList *strlist;
- gchar **string_list;
- gchar *group_name;
-
- strlist = NULL;
- group_name = g_strdup_printf( "%s %s", NADP_GROUP_PROFILE, profile_id );
-
- string_list = g_key_file_get_string_list( ndf->private->key_file, group_name, entry, NULL, NULL );
- if( string_list ){
- strlist = nadp_utils_to_slist(( const gchar ** ) string_list );
- g_strfreev( string_list );
- }
-
- g_free( group_name );
-
- return( strlist );
-}
-
-static gchar *
-group_name_to_profile_id( const gchar *group_name )
-{
- gchar *profile_id;
-
- profile_id = NULL;
-
- if( g_str_has_prefix( group_name, NADP_GROUP_PROFILE )){
-
- gchar **tokens, **iter;
- gchar *tmp;
- gchar *source = g_strdup( group_name );
-
- tmp = g_strstrip( source );
- if( tmp && g_utf8_strlen( tmp, -1 )){
-
- tokens = g_strsplit_set( tmp, " ", -1 );
- iter = tokens;
- ++iter;
- profile_id = g_strdup( g_strstrip( *iter ));
- g_strfreev( tokens );
- }
-
- g_free( source );
- }
-
- return( profile_id );
-}
-
-/**
- * nadp_desktop_file_set_label:
- * @ndf: the #NadpDesktopFile instance.
- * @label: the label to be set.
- *
- * Sets the label.
- */
-void
-nadp_desktop_file_set_label( NadpDesktopFile *ndf, const gchar *label )
-{
- char **locales;
-
- g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf ));
-
- if( !ndf->private->dispose_has_run ){
-
- locales = ( char ** ) g_get_language_names();
- g_key_file_set_locale_string(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NAME, locales[0], label );
- }
-}
-
-/**
- * nadp_desktop_file_set_tooltip:
- * @ndf: the #NadpDesktopFile instance.
- * @tooltip: the tooltip to be set.
- *
- * Sets the tooltip.
- */
-void
-nadp_desktop_file_set_tooltip( NadpDesktopFile *ndf, const gchar *tooltip )
-{
- char **locales;
-
- g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf ));
-
- if( !ndf->private->dispose_has_run ){
-
- locales = ( char ** ) g_get_language_names();
- g_key_file_set_locale_string(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, NADP_KEY_TOOLTIP, locales[0], tooltip );
- }
-}
-
-/**
- * nadp_desktop_file_set_icon:
- * @ndf: the #NadpDesktopFile instance.
- * @icon: the icon name or path to be set.
- *
- * Sets the icon.
- */
-void
-nadp_desktop_file_set_icon( NadpDesktopFile *ndf, const gchar *icon )
-{
- char **locales;
-
- g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf ));
-
- if( !ndf->private->dispose_has_run ){
-
- locales = ( char ** ) g_get_language_names();
- g_key_file_set_locale_string(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_ICON, locales[0], icon );
- }
-}
-
-/**
- * nadp_desktop_file_set_enabled:
- * @ndf: the #NadpDesktopFile instance.
- * @enabled: whether the action is enabled.
- *
- * Sets the enabled status of the item.
- *
- * Note that the NoDisplay key has an inversed logic regards to enabled
- * status.
- */
-void
-nadp_desktop_file_set_enabled( NadpDesktopFile *ndf, gboolean enabled )
-{
- g_return_if_fail( NADP_IS_DESKTOP_FILE( ndf ));
-
- if( !ndf->private->dispose_has_run ){
-
- g_key_file_set_boolean(
- ndf->private->key_file, G_KEY_FILE_DESKTOP_GROUP, G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, !enabled );
- }
-}
-#endif
-
/**
* nadp_desktop_file_write:
* @ndf: the #NadpDesktopFile instance.
diff --git a/src/io-desktop/nadp-desktop-file.h b/src/io-desktop/nadp-desktop-file.h
index e024eae..04b08e5 100644
--- a/src/io-desktop/nadp-desktop-file.h
+++ b/src/io-desktop/nadp-desktop-file.h
@@ -89,38 +89,6 @@ gchar *nadp_desktop_file_get_string ( const NadpDesktopFile *ndf
GSList *nadp_desktop_file_get_string_list ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, gboolean *key_found, const gchar *default_value );
guint nadp_desktop_file_get_uint ( const NadpDesktopFile *ndf, const gchar *group, const gchar *key, gboolean *key_found, guint default_value );
-/* ... */
-
-#if 0
-
-/*gchar *nadp_desktop_file_get_file_type ( const NadpDesktopFile *ndf );*/
-gchar *nadp_desktop_file_get_id2 ( const NadpDesktopFile *ndf );
-gchar *nadp_desktop_file_get_name ( const NadpDesktopFile *ndf );
-gchar *nadp_desktop_file_get_tooltip ( const NadpDesktopFile *ndf );
-gchar *nadp_desktop_file_get_icon ( const NadpDesktopFile *ndf );
-gboolean nadp_desktop_file_get_enabled ( const NadpDesktopFile *ndf );
-GSList *nadp_desktop_file_get_items_list ( const NadpDesktopFile *ndf );
-gboolean nadp_desktop_file_get_target_context ( const NadpDesktopFile *ndf );
-gboolean nadp_desktop_file_get_target_toolbar ( const NadpDesktopFile *ndf );
-gchar *nadp_desktop_file_get_toolbar_label ( const NadpDesktopFile *ndf );
-GSList *nadp_desktop_file_get_profiles_list ( const NadpDesktopFile *ndf );
-GSList *nadp_desktop_file_get_profile_group_list( const NadpDesktopFile *ndf );
-
-gchar *nadp_desktop_file_get_profile_name ( const NadpDesktopFile *ndf, const gchar *profile_id );
-gchar *nadp_desktop_file_get_profile_exec ( const NadpDesktopFile *ndf, const gchar *profile_id );
-GSList *nadp_desktop_file_get_basenames ( const NadpDesktopFile *ndf, const gchar *profile_id );
-gboolean nadp_desktop_file_get_matchcase ( const NadpDesktopFile *ndf, const gchar *profile_id );
-GSList *nadp_desktop_file_get_mimetypes ( const NadpDesktopFile *ndf, const gchar *profile_id );
-GSList *nadp_desktop_file_get_schemes ( const NadpDesktopFile *ndf, const gchar *profile_id );
-GSList *nadp_desktop_file_get_folders ( const NadpDesktopFile *ndf, const gchar *profile_id );
-
-void nadp_desktop_file_set_label( NadpDesktopFile *ndf, const gchar *label );
-void nadp_desktop_file_set_tooltip( NadpDesktopFile *ndf, const gchar *tooltip );
-void nadp_desktop_file_set_icon( NadpDesktopFile *ndf, const gchar *icon );
-void nadp_desktop_file_set_enabled( NadpDesktopFile *ndf, gboolean enabled );
-
-#endif
-
G_END_DECLS
#endif /* __NADP_DESKTOP_FILE_H__ */
diff --git a/src/io-xml/naxml-writer.c b/src/io-xml/naxml-writer.c
index 52d5e21..2b73db2 100644
--- a/src/io-xml/naxml-writer.c
+++ b/src/io-xml/naxml-writer.c
@@ -782,755 +782,3 @@ writer_to_buffer( NAXMLWriter *writer )
return( code );
}
-
-#if 0
-static NAXMLWriter *xml_writer_new( const gchar *uuid );
-static xmlDocPtr create_xml_schema( NAXMLWriter *writer, gint format, const NAObjectAction *action );
-static void create_schema_entry(
- NAXMLWriter *writer,
- gint format,
- const gchar *profile_name,
- const gchar *key,
- const gchar *value,
- xmlDocPtr doc,
- xmlNodePtr list_node,
- const gchar *type,
- gboolean is_l10n_value,
- const gchar *short_desc,
- const gchar *long_desc );
-static xmlDocPtr create_xml_dump( NAXMLWriter *writer, gint format, const NAObjectAction *action );
-static void create_dump_entry(
- NAXMLWriter *writer,
- gint format,
- const gchar *profile_name,
- const gchar *key,
- const gchar *value,
- xmlDocPtr doc,
- xmlNodePtr list_node,
- const gchar *type );
-static xmlDocPtr create_gconf_schema( NAXMLWriter *writer );
-static void create_gconf_schema_entry(
- NAXMLWriter *writer,
- const gchar *entry,
- xmlDocPtr doc,
- xmlNodePtr list_node,
- const gchar *type,
- const gchar *short_desc,
- const gchar *long_desc,
- const gchar *default_value,
- gboolean is_i18n );
-
-static void
-instance_get_property( GObject *object, guint property_id, GValue *value, GParamSpec *spec )
-{
- NAXMLWriter *self;
-
- g_return_if_fail( NA_IS_XML_WRITER( object ));
- self = NA_XML_WRITER( object );
-
- if( !self->private->dispose_has_run ){
-
- switch( property_id ){
- case XML_WRITER_PROP_UUID_ID:
- g_value_set_string( value, self->private->uuid );
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec );
- break;
- }
- }
-}
-
-static void
-instance_set_property( GObject *object, guint property_id, const GValue *value, GParamSpec *spec )
-{
- NAXMLWriter *self;
-
- g_return_if_fail( NA_IS_XML_WRITER( object ));
- self = NA_XML_WRITER( object );
-
- if( !self->private->dispose_has_run ){
-
- switch( property_id ){
- case XML_WRITER_PROP_UUID_ID:
- g_free( self->private->uuid );
- self->private->uuid = g_value_dup_string( value );
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID( object, property_id, spec );
- break;
- }
- }
-}
-
-static NAXMLWriter *
-writer_new( const gchar *uuid )
-{
- return( g_object_new( NAXML_WRITER_TYPE, NULL ));
-}
-
-/**
- * na_xml_writer_export:
- * @action: the #NAObjectAction to be exported.
- * Can be NULL when exporting schemas ; in this case, format must be
- * FORMAT_GCONF_SCHEMA.
- * @folder: the directoy where to write the output XML file.
- * If NULL, the output will be directed to stdout.
- * If not NULL, must be specified as an URI (e.g. file:///tmp)
- * @format: the export format.
- * @msg: pointer to a #GSList which will receive error messages.
- * The #GSList should be initialized to an empty list (NULL) before
- * calling the function.
- *
- * Export the specified action as an XML file.
- *
- * Returns: the written filename, or NULL if written to stdout or errors.
- */
-gchar *
-na_xml_writer_export( const NAObjectAction *action, const gchar *folder, gint format, GSList **msg )
-{
- static const gchar *thisfn = "na_xml_writer_export";
- gchar *filename = NULL;
- gchar *xml_buffer;
-
- g_debug( "%s: action=%p, format=%u", thisfn, ( void * ) action, format );
- g_return_val_if_fail( action || format == IPREFS_EXPORT_FORMAT_GCONF_SCHEMA, NULL );
-
- switch( format ){
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V1:
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V2:
- filename = na_xml_writer_get_output_fname( action, folder, format );
- break;
-
- /* this is the format used by nautilus-actions-new utility,
- * and that's why this option takes care of a NULL folder
- */
- case IPREFS_EXPORT_FORMAT_GCONF_ENTRY:
- if( folder ){
- filename = na_xml_writer_get_output_fname( action, folder, format );
- }
- break;
-
- /* this is the format used by nautilus-actions-schemas
- * utility, and that's why this option takes care of a NULL
- * folder, or an output filename
- */
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA:
- if( folder ){
- filename = g_strdup( folder );
- }
- break;
-
- default:
- g_return_val_if_reached( NULL );
- }
-
- g_assert( filename || folder == NULL );
-
- xml_buffer = na_xml_writer_get_xml_buffer( action, format );
-
- if( folder ){
- na_xml_writer_output_xml( xml_buffer, filename, msg );
- } else {
- g_print( "%s", xml_buffer );
- }
-
- if( *msg ){
- g_free( filename );
- filename = NULL;
- }
-
- g_free( xml_buffer );
-
- return( filename );
-}
-
-/**
- * na_xml_writer_get_xml_buffer:
- * @action: the #NAObjectAction to be exported.
- * @format: the export format.
- *
- * Returns: a buffer which contains the XML output.
- *
- * The returned string should be g_free() by the caller.
- */
-gchar *
-na_xml_writer_get_xml_buffer( const NAObjectAction *action, gint format )
-{
- gchar *uuid;
- NAXMLWriter *writer;
- xmlDocPtr doc = NULL;
- xmlChar *text;
- int textlen;
- gchar *buffer;
-
- g_return_val_if_fail( action || format == IPREFS_EXPORT_FORMAT_GCONF_SCHEMA, NULL );
-
- uuid = action ? na_object_get_id( action ) : NULL;
- writer = xml_writer_new( uuid );
- g_free( uuid );
-
- switch( format ){
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V1:
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V2:
- doc = create_xml_schema( writer, format, action );
- break;
-
- case IPREFS_EXPORT_FORMAT_GCONF_ENTRY:
- doc = create_xml_dump( writer, format, action );
- break;
-
- case IPREFS_EXPORT_FORMAT_GCONF_SCHEMA:
- doc = create_gconf_schema( writer );
- break;
- }
-
- g_assert( doc );
-
- xmlDocDumpFormatMemoryEnc( doc, &text, &textlen, "UTF-8", 1 );
- buffer = g_strdup(( const gchar * ) text );
-
- xmlFree( text );
- xmlFreeDoc (doc);
- xmlCleanupParser();
- g_object_unref( writer );
-
- return( buffer );
-}
-
-static xmlDocPtr
-create_xml_schema( NAXMLWriter *writer, gint format, const NAObjectAction *action )
-{
- xmlDocPtr doc;
- xmlNodePtr root_node, list_node;
- gchar *version, *label, *tooltip, *icon, *text;
- gboolean enabled;
- GList *profiles, *ip;
- NAObjectProfile *profile;
- gchar *profile_dir, *profile_label, *path, *parameters;
- GSList *basenames, *mimetypes, *schemes;
- gboolean match, isfile, isdir, multiple;
- gchar *type;
- GSList *items;
- gboolean target_selection, target_background, target_toolbar;
- gchar *toolbar_label;
- GSList *folders;
-
- doc = xmlNewDoc( BAD_CAST( "1.0" ));
- root_node = xmlNewNode( NULL, BAD_CAST( NACT_GCONF_SCHEMA_ROOT ));
- xmlDocSetRootElement( doc, root_node );
- list_node = xmlNewChild( root_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_LIST ), NULL );
-
- /* version */
- version = na_object_action_get_version( action );
- create_schema_entry( writer, format, NULL, ACTION_VERSION_ENTRY, version, doc, list_node, "string", FALSE, ACTION_VERSION_DESC_SHORT, ACTION_VERSION_DESC_LONG );
- g_free( version );
-
- /* label */
- label = na_object_get_label( action );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_LABEL_ENTRY, label, doc, list_node, "string", TRUE, ACTION_LABEL_DESC_SHORT, ACTION_LABEL_DESC_LONG );
- g_free( label );
-
- /* tooltip */
- tooltip = na_object_get_tooltip( action );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_TOOLTIP_ENTRY, tooltip, doc, list_node, "string", TRUE, ACTION_TOOLTIP_DESC_SHORT, ACTION_TOOLTIP_DESC_LONG );
- g_free( tooltip );
-
- /* icon name */
- icon = na_object_get_icon( action );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_ICON_ENTRY, icon, doc, list_node, "string", FALSE, ACTION_ICON_DESC_SHORT, ACTION_ICON_DESC_LONG );
- g_free( icon );
-
- /* enabled */
- enabled = na_object_is_enabled( NA_OBJECT_ITEM( action ));
- text = na_utils_boolean_to_schema( enabled );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_ENABLED_ENTRY, text, doc, list_node, "bool", FALSE, ACTION_ENABLED_DESC_SHORT, ACTION_ENABLED_DESC_LONG );
- g_free( text );
-
- /* items */
- items = na_object_item_rebuild_items_list( NA_OBJECT_ITEM( action ));
- text = na_utils_gslist_to_schema( items );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_LIST_ENTRY, text, doc, list_node, "list", FALSE, ACTION_ITEMS_DESC_SHORT, ACTION_ITEMS_DESC_LONG );
- g_free( text );
- na_utils_free_string_list( items );
-
- /* type */
- type = NA_IS_OBJECT_ACTION( action ) ? g_strdup( "Action" ) : g_strdup( "Menu" );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_TYPE_ENTRY, type, doc, list_node, "string", FALSE, ACTION_TYPE_DESC_SHORT, ACTION_TYPE_DESC_LONG );
- g_free( type );
-
- /* target selection */
- target_selection = na_object_action_is_target_selection( action );
- text = na_utils_boolean_to_schema( target_selection );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_TARGET_SELECTION_ENTRY, text, doc, list_node, "bool", FALSE, ACTION_TARGET_SELECTION_DESC_SHORT, ACTION_TARGET_SELECTION_DESC_LONG );
- g_free( text );
-
- /* target background */
- target_background = na_object_action_is_target_background( action );
- text = na_utils_boolean_to_schema( target_background );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_TARGET_BACKGROUND_ENTRY, text, doc, list_node, "bool", FALSE, ACTION_TARGET_BACKGROUND_DESC_SHORT, ACTION_TARGET_BACKGROUND_DESC_LONG );
- g_free( text );
-
- /* target toolbar */
- target_toolbar = na_object_action_is_target_toolbar( action );
- text = na_utils_boolean_to_schema( target_toolbar );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_TARGET_TOOLBAR_ENTRY, text, doc, list_node, "bool", FALSE, ACTION_TARGET_TOOLBAR_DESC_SHORT, ACTION_TARGET_TOOLBAR_DESC_LONG );
- g_free( text );
-
- /* toolbar same label
- * only used between 2.29.1 and 2.29.4 - removed starting with 2.29.5
- */
- /*toolbar_same_label = na_object_action_toolbar_use_same_label( action );
- text = na_utils_boolean_to_schema( toolbar_same_label );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_TOOLBAR_SAME_LABEL_ENTRY, text, doc, list_node, "bool", FALSE, ACTION_TOOLBAR_SAME_LABEL_DESC_SHORT, ACTION_TOOLBAR_SAME_LABEL_DESC_LONG );
- g_free( text );*/
-
- /* toolbar label
- * starting with 2.29.5: we always export the toolbar label
- */
- toolbar_label = na_object_action_toolbar_get_label( action );
- create_schema_entry( writer, format, NULL, OBJECT_ITEM_TOOLBAR_LABEL_ENTRY, toolbar_label, doc, list_node, "string", TRUE, ACTION_TOOLBAR_LABEL_DESC_SHORT, ACTION_TOOLBAR_LABEL_DESC_LONG );
- g_free( toolbar_label );
-
- profiles = na_object_get_items_list( action );
-
- for( ip = profiles ; ip ; ip = ip->next ){
-
- profile = NA_OBJECT_PROFILE( ip->data );
- profile_dir = na_object_get_id( profile );
-
- /* profile label */
- profile_label = na_object_get_label( profile );
- create_schema_entry( writer, format, profile_dir, ACTION_PROFILE_LABEL_ENTRY, profile_label, doc, list_node, "string", TRUE, ACTION_PROFILE_NAME_DESC_SHORT, ACTION_PROFILE_NAME_DESC_LONG );
- g_free( profile_label );
-
- /* path */
- path = na_object_profile_get_path( profile );
- create_schema_entry( writer, format, profile_dir, ACTION_PATH_ENTRY, path, doc, list_node, "string", FALSE, ACTION_PATH_DESC_SHORT, ACTION_PATH_DESC_LONG );
- g_free( path );
-
- /* parameters */
- parameters = na_object_profile_get_parameters( profile );
- create_schema_entry( writer, format, profile_dir, ACTION_PARAMETERS_ENTRY, parameters, doc, list_node, "string", FALSE, ACTION_PARAMETERS_DESC_SHORT, ACTION_PARAMETERS_DESC_LONG );
- g_free( parameters );
-
- /* basenames */
- basenames = na_object_profile_get_basenames( profile );
- text = na_utils_gslist_to_schema( basenames );
- create_schema_entry( writer, format, profile_dir, ACTION_BASENAMES_ENTRY, text, doc, list_node, "list", FALSE, ACTION_BASENAMES_DESC_SHORT, ACTION_BASENAMES_DESC_LONG );
- g_free( text );
- na_utils_free_string_list( basenames );
-
- /* match_case */
- match = na_object_profile_get_matchcase( profile );
- text = na_utils_boolean_to_schema( match );
- create_schema_entry( writer, format, profile_dir, ACTION_MATCHCASE_ENTRY, text, doc, list_node, "bool", FALSE, ACTION_MATCHCASE_DESC_SHORT, ACTION_MATCHCASE_DESC_LONG );
- g_free( text );
-
- /* mimetypes */
- mimetypes = na_object_profile_get_mimetypes( profile );
- text = na_utils_gslist_to_schema( mimetypes );
- create_schema_entry( writer, format, profile_dir, ACTION_MIMETYPES_ENTRY, text, doc, list_node, "list", FALSE, ACTION_MIMETYPES_DESC_SHORT, ACTION_MIMETYPES_DESC_LONG );
- g_free( text );
- na_utils_free_string_list( mimetypes );
-
- /* is_file */
- isfile = na_object_profile_get_is_file( profile );
- text = na_utils_boolean_to_schema( isfile );
- create_schema_entry( writer, format, profile_dir, ACTION_ISFILE_ENTRY, text, doc, list_node, "bool", FALSE, ACTION_ISFILE_DESC_SHORT, ACTION_ISFILE_DESC_LONG );
- g_free( text );
-
- /* is_dir */
- isdir = na_object_profile_get_is_dir( profile );
- text = na_utils_boolean_to_schema( isdir );
- create_schema_entry( writer, format, profile_dir, ACTION_ISDIR_ENTRY, text, doc, list_node, "bool", FALSE, ACTION_ISDIR_DESC_SHORT, ACTION_ISDIR_DESC_LONG );
- g_free( text );
-
- /* accept-multiple-files */
- multiple = na_object_profile_get_multiple( profile );
- text = na_utils_boolean_to_schema( multiple );
- create_schema_entry( writer, format, profile_dir, ACTION_MULTIPLE_ENTRY, text, doc, list_node, "bool", FALSE, ACTION_MULTIPLE_DESC_SHORT, ACTION_MULTIPLE_DESC_LONG );
- g_free( text );
-
- /* schemes */
- schemes = na_object_profile_get_schemes( profile );
- text = na_utils_gslist_to_schema( schemes );
- create_schema_entry( writer, format, profile_dir, ACTION_SCHEMES_ENTRY, text, doc, list_node, "list", FALSE, ACTION_SCHEMES_DESC_SHORT, ACTION_SCHEMES_DESC_LONG );
- g_free( text );
- na_utils_free_string_list( schemes );
-
- /* folders */
- folders = na_object_profile_get_folders( profile );
- text = na_utils_gslist_to_schema( folders );
- create_schema_entry( writer, format, profile_dir, ACTION_FOLDERS_ENTRY, text, doc, list_node, "list", FALSE, ACTION_FOLDERS_DESC_SHORT, ACTION_FOLDERS_DESC_LONG );
- g_free( text );
- na_utils_free_string_list( folders );
-
- g_free( profile_dir );
- }
-
- return( doc );
-}
-
-static void
-create_schema_entry( NAXMLWriter *writer,
- gint format,
- const gchar *profile_name, const gchar *key, const gchar *value,
- xmlDocPtr doc, xmlNodePtr list_node, const gchar *type, gboolean is_l10n_value,
- const gchar *short_desc, const gchar *long_desc )
-{
- gchar *path = NULL;
- xmlNodePtr schema_node;
- xmlChar *content, *encoded_content;
- xmlNodePtr value_root_node, locale_node;
-
- if( profile_name ){
- path = g_build_path( "/", NA_GCONF_CONFIG_PATH, writer->private->uuid, profile_name, key, NULL );
- } else {
- path = g_build_path( "/", NA_GCONF_CONFIG_PATH, writer->private->uuid, key, NULL );
- }
-
- schema_node = xmlNewChild( list_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_ENTRY ), NULL );
-
- content = BAD_CAST( g_build_path( "/", NAUTILUS_ACTIONS_GCONF_SCHEMASDIR, path, NULL ));
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_KEY ), content );
- xmlFree( content );
-
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_APPLYTO ), BAD_CAST( path ));
-
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_TYPE ), BAD_CAST( type ));
- if( !g_ascii_strcasecmp( type, "list" )){
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_LIST_TYPE ), BAD_CAST( "string" ));
- }
-
- /* always creates a 'locale' node,
- * maybe with the default value if this later is localized
- */
- value_root_node = schema_node;
- locale_node = xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_LOCALE ), NULL );
- xmlNewProp( locale_node, BAD_CAST( "name" ), BAD_CAST( "C" ));
- if( is_l10n_value ){
- value_root_node = locale_node;
- }
-
- /* encode special chars <, >, &, ...
- */
- encoded_content = xmlEncodeSpecialChars( doc, BAD_CAST( value ));
- xmlNewChild( value_root_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_DEFAULT ), encoded_content );
- xmlFree( encoded_content );
-
- /* fill up the historical format if asked for
- * add owner and short and long descriptions
- */
- if( format == IPREFS_EXPORT_FORMAT_GCONF_SCHEMA_V1 ){
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_OWNER ), BAD_CAST( PACKAGE_TARNAME ));
-
- xmlNewChild( locale_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_SHORT ), BAD_CAST( short_desc ));
-
- xmlNewChild( locale_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_LONG ), BAD_CAST( long_desc ));
- }
-
- g_free( path );
-}
-
-static xmlDocPtr
-create_xml_dump( NAXMLWriter *writer, gint format, const NAObjectAction *action )
-{
- xmlDocPtr doc;
- xmlNodePtr root_node, list_node;
- gchar *path;
- gchar *version, *label, *tooltip, *icon, *text;
- gboolean enabled;
- GList *profiles, *ip;
- NAObjectProfile *profile;
- gchar *profile_dir;
- gchar *profile_label, *parameters;
- GSList *basenames, *mimetypes, *schemes;
- gboolean match, isfile, isdir, multiple;
- gchar *type;
- GSList *items;
- gboolean target_selection, target_background, target_toolbar;
- gchar *toolbar_label;
- GSList *folders;
-
- doc = xmlNewDoc( BAD_CAST( "1.0" ));
- root_node = xmlNewNode( NULL, BAD_CAST( NACT_GCONF_DUMP_ROOT ));
- xmlDocSetRootElement( doc, root_node );
-
- path = g_build_path( "/", NA_GCONF_CONFIG_PATH, writer->private->uuid, NULL );
- list_node = xmlNewChild( root_node, NULL, BAD_CAST( NACT_GCONF_DUMP_ENTRYLIST ), NULL );
- xmlNewProp( list_node, BAD_CAST( NACT_GCONF_DUMP_ENTRYLIST_BASE ), BAD_CAST( path ));
- g_free( path );
-
- /* version */
- version = na_object_action_get_version( action );
- create_dump_entry( writer, format, NULL, ACTION_VERSION_ENTRY, version, doc, list_node, "string" );
- g_free( version );
-
- /* label */
- label = na_object_get_label( action );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_LABEL_ENTRY, label, doc, list_node, "string" );
- g_free( label );
-
- /* tooltip */
- tooltip = na_object_get_tooltip( action );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_TOOLTIP_ENTRY, tooltip, doc, list_node, "string" );
- g_free( tooltip );
-
- /* icon name */
- icon = na_object_get_icon( action );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_ICON_ENTRY, icon, doc, list_node, "string" );
- g_free( icon );
-
- /* enabled */
- enabled = na_object_is_enabled( NA_OBJECT_ITEM( action ));
- text = na_utils_boolean_to_schema( enabled );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_ENABLED_ENTRY, text, doc, list_node, "bool" );
- g_free( text );
-
- /* items */
- items = na_object_item_rebuild_items_list( NA_OBJECT_ITEM( action ));
- text = na_utils_gslist_to_schema( items );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_LIST_ENTRY, text, doc, list_node, "list" );
- g_free( text );
- na_utils_free_string_list( items );
-
- /* type */
- type = NA_IS_OBJECT_ACTION( action ) ? g_strdup( "Action" ) : g_strdup( "Menu" );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_TYPE_ENTRY, type, doc, list_node, "string" );
- g_free( type );
-
- /* target selection */
- target_selection = na_object_action_is_target_selection( action );
- text = na_utils_boolean_to_schema( target_selection );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_TARGET_SELECTION_ENTRY, text, doc, list_node, "bool" );
- g_free( text );
-
- /* target background */
- target_background = na_object_action_is_target_background( action );
- text = na_utils_boolean_to_schema( target_background );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_TARGET_BACKGROUND_ENTRY, text, doc, list_node, "bool" );
- g_free( text );
-
- /* target toolbar */
- target_toolbar = na_object_action_is_target_toolbar( action );
- text = na_utils_boolean_to_schema( target_toolbar );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_TARGET_TOOLBAR_ENTRY, text, doc, list_node, "bool" );
- g_free( text );
-
- /* toolbar same label
- * only used between 2.29.1 and 2.29.4 - removed starting with 2.29.5
- */
- /*toolbar_same_label = na_object_action_toolbar_use_same_label( action );
- text = na_utils_boolean_to_schema( toolbar_same_label );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_TOOLBAR_SAME_LABEL_ENTRY, text, doc, list_node, "bool" );
- g_free( text );*/
-
- /* toolbar label
- * starting with 2.29.5: we always export the toolbar label
- */
- toolbar_label = na_object_action_toolbar_get_label( action );
- create_dump_entry( writer, format, NULL, OBJECT_ITEM_TOOLBAR_LABEL_ENTRY, toolbar_label, doc, list_node, "string" );
- g_free( toolbar_label );
-
- profiles = na_object_get_items_list( action );
-
- for( ip = profiles ; ip ; ip = ip->next ){
-
- profile = NA_OBJECT_PROFILE( ip->data );
- profile_dir = na_object_get_id( profile );
-
- /* profile label */
- profile_label = na_object_get_label( profile );
- create_dump_entry( writer, format, profile_dir, ACTION_PROFILE_LABEL_ENTRY, profile_label, doc, list_node, "string" );
- g_free( profile_label );
-
- /* path */
- path = na_object_profile_get_path( profile );
- create_dump_entry( writer, format, profile_dir, ACTION_PATH_ENTRY, path, doc, list_node, "string" );
- g_free( path );
-
- /* parameters */
- parameters = na_object_profile_get_parameters( profile );
- create_dump_entry( writer, format, profile_dir, ACTION_PARAMETERS_ENTRY, parameters, doc, list_node, "string" );
- g_free( parameters );
-
- /* basenames */
- basenames = na_object_profile_get_basenames( profile );
- text = na_utils_gslist_to_schema( basenames );
- create_dump_entry( writer, format, profile_dir, ACTION_BASENAMES_ENTRY, text, doc, list_node, "list" );
- g_free( text );
- na_utils_free_string_list( basenames );
-
- /* match_case */
- match = na_object_profile_get_matchcase( profile );
- text = na_utils_boolean_to_schema( match );
- create_dump_entry( writer, format, profile_dir, ACTION_MATCHCASE_ENTRY, text, doc, list_node, "bool" );
- g_free( text );
-
- /* mimetypes */
- mimetypes = na_object_profile_get_mimetypes( profile );
- text = na_utils_gslist_to_schema( mimetypes );
- create_dump_entry( writer, format, profile_dir, ACTION_MIMETYPES_ENTRY, text, doc, list_node, "list" );
- g_free( text );
- na_utils_free_string_list( mimetypes );
-
- /* is_file */
- isfile = na_object_profile_get_is_file( profile );
- text = na_utils_boolean_to_schema( isfile );
- create_dump_entry( writer, format, profile_dir, ACTION_ISFILE_ENTRY, text, doc, list_node, "bool" );
- g_free( text );
-
- /* is_dir */
- isdir = na_object_profile_get_is_dir( profile );
- text = na_utils_boolean_to_schema( isdir );
- create_dump_entry( writer, format, profile_dir, ACTION_ISDIR_ENTRY, text, doc, list_node, "bool" );
- g_free( text );
-
- /* accept-multiple-files */
- multiple = na_object_profile_get_multiple( profile );
- text = na_utils_boolean_to_schema( multiple );
- create_dump_entry( writer, format, profile_dir, ACTION_MULTIPLE_ENTRY, text, doc, list_node, "bool" );
- g_free( text );
-
- /* schemes */
- schemes = na_object_profile_get_schemes( profile );
- text = na_utils_gslist_to_schema( schemes );
- create_dump_entry( writer, format, profile_dir, ACTION_SCHEMES_ENTRY, text, doc, list_node, "list" );
- g_free( text );
- na_utils_free_string_list( schemes );
-
- /* folders */
- folders = na_object_profile_get_folders( profile );
- text = na_utils_gslist_to_schema( folders );
- create_dump_entry( writer, format, profile_dir, ACTION_FOLDERS_ENTRY, text, doc, list_node, "list" );
- g_free( text );
- na_utils_free_string_list( folders );
-
- g_free( profile_dir );
- }
-
- return( doc );
-}
-
-static void
-create_dump_entry( NAXMLWriter *writer,
- gint format,
- const gchar *profile_name, const gchar *key, const gchar *value,
- xmlDocPtr doc, xmlNodePtr list_node, const gchar *type )
-{
- xmlNodePtr entry_node;
- xmlNodePtr value_node;
- xmlNodePtr value_list_node, value_list_value_node;
- gchar *entry = NULL;
- GSList *list, *is;
- xmlChar *encoded_content;
-
- entry_node = xmlNewChild( list_node, NULL, BAD_CAST( NACT_GCONF_DUMP_ENTRY ), NULL );
-
- if( profile_name ){
- entry = g_strdup_printf( "%s/%s", profile_name, key );
- } else {
- entry = g_strdup( key );
- }
- xmlNewChild( entry_node, NULL, BAD_CAST( NACT_GCONF_DUMP_KEY ), BAD_CAST( entry ));
- g_free( entry );
-
- value_node = xmlNewChild( entry_node, NULL, BAD_CAST( NACT_GCONF_DUMP_VALUE ), NULL );
-
- if( !g_ascii_strcasecmp( type, "list" )){
- value_list_node = xmlNewChild( value_node, NULL, BAD_CAST( NACT_GCONF_DUMP_LIST ), NULL );
- xmlNewProp( value_list_node, BAD_CAST( NACT_GCONF_DUMP_LIST_TYPE ), BAD_CAST( NACT_GCONF_DUMP_STRING ));
- value_list_value_node = xmlNewChild( value_list_node, NULL, BAD_CAST( NACT_GCONF_DUMP_VALUE ), NULL );
- list = na_utils_schema_to_gslist( value );
- for( is = list ; is ; is = is->next ){
- encoded_content = xmlEncodeSpecialChars( doc, BAD_CAST(( gchar * ) is->data ));
- xmlNewChild( value_list_value_node, NULL, BAD_CAST( NACT_GCONF_DUMP_STRING ), encoded_content );
- xmlFree( encoded_content );
- }
- } else {
- encoded_content = xmlEncodeSpecialChars( doc, BAD_CAST( value ));
- xmlNewChild( value_node, NULL, BAD_CAST( NACT_GCONF_DUMP_STRING ), encoded_content );
- xmlFree( encoded_content );
- }
-}
-
-static xmlDocPtr
-create_gconf_schema( NAXMLWriter *writer )
-{
- xmlDocPtr doc;
- xmlNodePtr root_node, list_node;
-
- doc = xmlNewDoc( BAD_CAST( "1.0" ));
- root_node = xmlNewNode( NULL, BAD_CAST( NACT_GCONF_SCHEMA_ROOT ));
- xmlDocSetRootElement( doc, root_node );
- list_node = xmlNewChild( root_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_LIST ), NULL );
-
- create_gconf_schema_entry( writer, ACTION_VERSION_ENTRY , doc, list_node, "string", ACTION_VERSION_DESC_SHORT , ACTION_VERSION_DESC_LONG , NAUTILUS_ACTIONS_CONFIG_VERSION, FALSE );
- create_gconf_schema_entry( writer, OBJECT_ITEM_LABEL_ENTRY , doc, list_node, "string", ACTION_LABEL_DESC_SHORT , ACTION_LABEL_DESC_LONG , "", TRUE );
- create_gconf_schema_entry( writer, OBJECT_ITEM_TOOLTIP_ENTRY , doc, list_node, "string", ACTION_TOOLTIP_DESC_SHORT , ACTION_TOOLTIP_DESC_LONG , "", TRUE );
- create_gconf_schema_entry( writer, OBJECT_ITEM_ICON_ENTRY , doc, list_node, "string", ACTION_ICON_DESC_SHORT , ACTION_ICON_DESC_LONG , "", FALSE );
- create_gconf_schema_entry( writer, OBJECT_ITEM_ENABLED_ENTRY , doc, list_node, "bool" , ACTION_ENABLED_DESC_SHORT , ACTION_ENABLED_DESC_LONG , "true", FALSE );
- create_gconf_schema_entry( writer, OBJECT_ITEM_LIST_ENTRY , doc, list_node, "list" , ACTION_ITEMS_DESC_SHORT , ACTION_ITEMS_DESC_LONG , "[]", FALSE );
- create_gconf_schema_entry( writer, OBJECT_ITEM_TYPE_ENTRY , doc, list_node, "string", ACTION_TYPE_DESC_SHORT , ACTION_TYPE_DESC_LONG , "Action", FALSE );
- create_gconf_schema_entry( writer, OBJECT_ITEM_TARGET_SELECTION_ENTRY , doc, list_node, "bool", ACTION_TARGET_SELECTION_DESC_SHORT , ACTION_TARGET_SELECTION_DESC_LONG , "true", FALSE );
- create_gconf_schema_entry( writer, OBJECT_ITEM_TARGET_BACKGROUND_ENTRY , doc, list_node, "bool", ACTION_TARGET_BACKGROUND_DESC_SHORT , ACTION_TARGET_BACKGROUND_DESC_LONG , "false", FALSE );
- create_gconf_schema_entry( writer, OBJECT_ITEM_TARGET_TOOLBAR_ENTRY , doc, list_node, "bool", ACTION_TARGET_TOOLBAR_DESC_SHORT , ACTION_TARGET_TOOLBAR_DESC_LONG , "false", FALSE );
- /*create_gconf_schema_entry( writer, OBJECT_ITEM_TOOLBAR_SAME_LABEL_ENTRY, doc, list_node, "bool", ACTION_TOOLBAR_SAME_LABEL_DESC_SHORT, ACTION_TOOLBAR_SAME_LABEL_DESC_LONG, "true", FALSE );*/
- create_gconf_schema_entry( writer, OBJECT_ITEM_TOOLBAR_LABEL_ENTRY , doc, list_node, "string", ACTION_TOOLBAR_LABEL_DESC_SHORT , ACTION_TOOLBAR_LABEL_DESC_LONG , "", TRUE );
- create_gconf_schema_entry( writer, ACTION_PROFILE_LABEL_ENTRY , doc, list_node, "string", ACTION_PROFILE_NAME_DESC_SHORT, ACTION_PROFILE_NAME_DESC_LONG, NA_OBJECT_PROFILE_DEFAULT_LABEL, TRUE );
- create_gconf_schema_entry( writer, ACTION_PATH_ENTRY , doc, list_node, "string", ACTION_PATH_DESC_SHORT , ACTION_PATH_DESC_LONG , "", FALSE );
- create_gconf_schema_entry( writer, ACTION_PARAMETERS_ENTRY , doc, list_node, "string", ACTION_PARAMETERS_DESC_SHORT , ACTION_PARAMETERS_DESC_LONG , "", FALSE );
- create_gconf_schema_entry( writer, ACTION_BASENAMES_ENTRY , doc, list_node, "list" , ACTION_BASENAMES_DESC_SHORT , ACTION_BASENAMES_DESC_LONG , "[*]", FALSE );
- create_gconf_schema_entry( writer, ACTION_MATCHCASE_ENTRY , doc, list_node, "bool" , ACTION_MATCHCASE_DESC_SHORT , ACTION_MATCHCASE_DESC_LONG , "true", FALSE );
- create_gconf_schema_entry( writer, ACTION_MIMETYPES_ENTRY , doc, list_node, "list" , ACTION_MIMETYPES_DESC_SHORT , ACTION_MIMETYPES_DESC_LONG , "[*/*]", FALSE );
- create_gconf_schema_entry( writer, ACTION_ISFILE_ENTRY , doc, list_node, "bool" , ACTION_ISFILE_DESC_SHORT , ACTION_ISFILE_DESC_LONG , "true", FALSE );
- create_gconf_schema_entry( writer, ACTION_ISDIR_ENTRY , doc, list_node, "bool" , ACTION_ISDIR_DESC_SHORT , ACTION_ISDIR_DESC_LONG , "false", FALSE );
- create_gconf_schema_entry( writer, ACTION_MULTIPLE_ENTRY , doc, list_node, "bool" , ACTION_MULTIPLE_DESC_SHORT , ACTION_MULTIPLE_DESC_LONG , "false", FALSE );
- create_gconf_schema_entry( writer, ACTION_SCHEMES_ENTRY , doc, list_node, "list" , ACTION_SCHEMES_DESC_SHORT , ACTION_SCHEMES_DESC_LONG , "[file]", FALSE );
- create_gconf_schema_entry( writer, ACTION_FOLDERS_ENTRY , doc, list_node, "list" , ACTION_FOLDERS_DESC_SHORT , ACTION_FOLDERS_DESC_LONG , "[]", FALSE );
-
- return( doc );
-}
-
-static void
-create_gconf_schema_entry( NAXMLWriter *writer,
- const gchar *entry,
- xmlDocPtr doc, xmlNodePtr list_node, const gchar *type,
- const gchar *short_desc, const gchar *long_desc,
- const gchar *default_value, gboolean is_i18n )
-{
- xmlNodePtr schema_node;
- xmlChar *content;
- xmlNodePtr locale_node;
-
- schema_node = xmlNewChild( list_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_ENTRY ), NULL );
-
- content = BAD_CAST( g_build_path( "/", NAUTILUS_ACTIONS_GCONF_SCHEMASDIR, NA_GCONF_CONFIG_PATH, entry, NULL ));
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_KEY ), content );
- xmlFree( content );
-
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_OWNER ), BAD_CAST( PACKAGE_TARNAME ));
-
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_TYPE ), BAD_CAST( type ));
- if( !g_ascii_strcasecmp( type, "list" )){
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_LIST_TYPE ), BAD_CAST( "string" ));
- }
-
- locale_node = xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_LOCALE ), NULL );
- xmlNewProp( locale_node, BAD_CAST( "name" ), BAD_CAST( "C" ));
-
- content = xmlEncodeSpecialChars( doc, BAD_CAST( default_value ));
- xmlNewChild( schema_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_DEFAULT ), content );
- if( is_i18n ){
- xmlNewChild( locale_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_DEFAULT ), content );
- }
- xmlFree( content );
-
- xmlNewChild( locale_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_SHORT ), BAD_CAST( short_desc ));
-
- xmlNewChild( locale_node, NULL, BAD_CAST( NACT_GCONF_SCHEMA_LONG ), BAD_CAST( long_desc ));
-}
-#endif
diff --git a/src/io-xml/naxml-writer.h b/src/io-xml/naxml-writer.h
index 33fa190..c157c0b 100644
--- a/src/io-xml/naxml-writer.h
+++ b/src/io-xml/naxml-writer.h
@@ -76,13 +76,6 @@ guint naxml_writer_write_start( const NAIFactoryProvider *writer, void *writer_
guint naxml_writer_write_data ( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, const NADataBoxed *boxed, GSList **messages );
guint naxml_writer_write_done ( const NAIFactoryProvider *writer, void *writer_data, const NAIFactoryObject *object, GSList **messages );
-#if 0
-gchar *na_xml_writer_export( const NAObjectAction *action, const gchar *folder, gint format, GSList **msg );
-gchar *na_xml_writer_get_output_fname( const NAObjectAction *action, const gchar *folder, gint format );
-gchar *na_xml_writer_get_xml_buffer( const NAObjectAction *action, gint format );
-void na_xml_writer_output_xml( const gchar *xml, const gchar *filename, GSList **msg );
-#endif
-
G_END_DECLS
#endif /* __NAXML_WRITER_H__ */
diff --git a/src/nact/nact-iadvanced-tab.c b/src/nact/nact-iadvanced-tab.c
index c18ffa5..afe1f96 100644
--- a/src/nact/nact-iadvanced-tab.c
+++ b/src/nact/nact-iadvanced-tab.c
@@ -168,52 +168,6 @@ runtime_init_connect_signals( NactIAdvancedTab *instance, GtkTreeView *listview
g_debug( "%s: instance=%p, listview=%p", thisfn, ( void * ) instance, ( void * ) listview );
g_return_if_fail( NACT_IS_IADVANCED_TAB( instance ));
-#if 0
- column = gtk_tree_view_get_column( listview, SCHEMES_CHECKBOX_COLUMN );
- renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column ));
- base_window_signal_connect(
- BASE_WINDOW( instance ),
- G_OBJECT( renderers->data ),
- "toggled",
- G_CALLBACK( on_scheme_selection_toggled ));
-
- column = gtk_tree_view_get_column( listview, SCHEMES_KEYWORD_COLUMN );
- renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column ));
- base_window_signal_connect(
- BASE_WINDOW( instance ),
- G_OBJECT( renderers->data ),
- "edited",
- G_CALLBACK( on_scheme_keyword_edited ));
-
- column = gtk_tree_view_get_column( listview, SCHEMES_DESC_COLUMN );
- renderers = gtk_cell_layout_get_cells( GTK_CELL_LAYOUT( column ));
- base_window_signal_connect(
- BASE_WINDOW( instance ),
- G_OBJECT( renderers->data ),
- "edited",
- G_CALLBACK( on_scheme_desc_edited ));
-
- add_button = get_add_button( instance );
- base_window_signal_connect(
- BASE_WINDOW( instance ),
- G_OBJECT( add_button ),
- "clicked",
- G_CALLBACK( on_add_scheme_clicked ));
-
- remove_button = get_remove_button( instance );
- base_window_signal_connect(
- BASE_WINDOW( instance ),
- G_OBJECT( remove_button ),
- "clicked",
- G_CALLBACK( on_remove_scheme_clicked ));
-
- base_window_signal_connect(
- BASE_WINDOW( instance ),
- G_OBJECT( gtk_tree_view_get_selection( listview )),
- "changed",
- G_CALLBACK( on_scheme_list_selection_changed ));
-#endif
-
base_window_signal_connect(
BASE_WINDOW( instance ),
G_OBJECT( instance ),
diff --git a/src/nact/nact-main-menubar.c b/src/nact/nact-main-menubar.c
index 7be9ddb..bfc05a8 100644
--- a/src/nact/nact-main-menubar.c
+++ b/src/nact/nact-main-menubar.c
@@ -973,42 +973,6 @@ save_item( NactMainWindow *window, NAUpdater *updater, NAObjectItem *item )
origin = ( NAObjectItem * ) na_object_get_origin( item );
g_debug( "%s: origin=%p", thisfn, ( void * ) origin );
-#if 0
- /* if the item already existed,
- * then copy the treeview item to the pivot one
- */
- if( origin ){
- subitems = NULL;
- if( NA_IS_OBJECT_ACTION( item )){
- subitems = na_object_get_items( origin );
- na_object_set_items( origin, NULL );
- }
- na_object_copy( origin, item, NA_IS_OBJECT_ACTION( item ));
- na_object_reset_origin( item, origin );
- if( subitems ){
- na_object_unref_items( subitems );
- }
-
- /* this is a new item
- * get the actual parent and position from the treeview
- * and insert accordingly in the pivot tree
- */
- } else {
- dup_pivot = NA_OBJECT_ITEM( na_object_duplicate( item ));
- na_object_reset_origin( item, dup_pivot );
-
- pos = -1;
- parent_id = NULL;
- parent = na_object_get_parent( item );
- if( parent ){
- parent_id = na_object_get_id( parent );
- pos = na_object_get_position( parent, item );
- }
-
- na_updater_insert_item( updater, dup_pivot, parent_id, pos );
- }
-#endif
-
parent = NULL;
pos = -1;
@@ -1033,34 +997,6 @@ save_item( NactMainWindow *window, NAUpdater *updater, NAObjectItem *item )
na_updater_append_item( updater, dup_pivot );
}
-#if 0
- parent = NULL;
- pos = -1;
-
- if( origin ){
- parent = na_object_get_parent( origin );
- if( parent ){
- pos = na_object_get_position( parent, origin );
- na_object_remove_item( parent, origin );
- } else {
- na_updater_remove_item( updater, NA_OBJECT( origin ));
- }
- }
-
- dup_pivot = NA_OBJECT_ITEM( na_object_duplicate( item ));
- na_object_reset_origin( item, dup_pivot );
- na_object_set_parent( dup_pivot, parent );
- if( parent ){
- if( pos == -1 ){
- na_object_append_item( parent, dup_pivot );
- } else {
- na_object_insert_at( parent, dup_pivot, pos );
- }
- } else {
- na_updater_add_item( updater, dup_pivot );
- }
-#endif
-
nact_iactions_list_bis_remove_modified( NACT_IACTIONS_LIST( window ), item );
provider_after = na_object_get_provider( item );
diff --git a/src/utils/nautilus-actions-new.c b/src/utils/nautilus-actions-new.c
index 2f7d584..932078f 100644
--- a/src/utils/nautilus-actions-new.c
+++ b/src/utils/nautilus-actions-new.c
@@ -44,10 +44,6 @@
#include <core/na-io-provider.h>
#include <core/na-updater.h>
-#if 0
-#include <core/na-xml-names.h>
-#include <core/na-xml-writer.h>
-#endif
#include "console-utils.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]