[nautilus-actions] NadpDesktopProvider class is renamed to FMADesktopProvider



commit 22fd50b231cc6b41c91f6bf96b1b91d31f4c05f1
Author: Pierre Wieser <pwieser trychlos org>
Date:   Tue Sep 8 14:43:59 2015 +0200

    NadpDesktopProvider class is renamed to FMADesktopProvider

 src/api/fma-extension.h                            |   10 +-
 src/io-desktop/Makefile.am                         |    8 +-
 src/io-desktop/fma-desktop-file.c                  |    2 +-
 src/io-desktop/fma-desktop-file.h                  |    2 +-
 ...p-desktop-provider.c => fma-desktop-provider.c} |   88 +++++++++---------
 src/io-desktop/fma-desktop-provider.h              |   99 ++++++++++++++++++++
 src/io-desktop/nadp-desktop-provider.h             |   97 -------------------
 src/io-desktop/nadp-module.c                       |    6 +-
 src/io-desktop/nadp-monitor.c                      |   10 +-
 src/io-desktop/nadp-monitor.h                      |    4 +-
 src/io-desktop/nadp-reader.c                       |   52 +++++-----
 src/io-desktop/nadp-utils.c                        |    2 +-
 src/io-desktop/nadp-writer.c                       |   30 +++---
 13 files changed, 206 insertions(+), 204 deletions(-)
---
diff --git a/src/api/fma-extension.h b/src/api/fma-extension.h
index 34be2d8..196d7cb 100644
--- a/src/api/fma-extension.h
+++ b/src/api/fma-extension.h
@@ -171,13 +171,13 @@ G_BEGIN_DECLS
  *     fma_extension_startup( GTypeModule *plugin )
  *     {
  *         static GTypeInfo info = {
- *             sizeof( NadpDesktopProviderClass ),
+ *             sizeof( FMADesktopProviderClass ),
  *             NULL,
  *             NULL,
  *             ( GClassInitFunc ) class_init,
  *             NULL,
  *             NULL,
- *             sizeof( NadpDesktopProvider ),
+ *             sizeof( FMADesktopProvider ),
  *             0,
  *             ( GInstanceInitFunc ) instance_init
  *         };
@@ -188,7 +188,7 @@ G_BEGIN_DECLS
  *             NULL
  *         };
  *
- *         st_module_type = g_type_module_register_type( plugin, G_TYPE_OBJECT, "NadpDesktopProvider", 
&amp;info, 0 );
+ *         st_module_type = g_type_module_register_type( plugin, G_TYPE_OBJECT, "FMADesktopProvider", 
&amp;info, 0 );
  *
  *         g_type_module_add_interface( plugin, st_module_type, FMA_TYPE_IIO_PROVIDER, 
&amp;iio_provider_iface_info );
  *
@@ -252,10 +252,10 @@ guint    fma_extension_get_version( void );
  *     {
  *          static GType types_list [1+NADP_TYPES_COUNT];
  *
- *          &lcomment; NADP_TYPE_DESKTOP_PROVIDER has been previously
+ *          &lcomment; FMA_TYPE_DESKTOP_PROVIDER has been previously
  *           * registered in fma_extension_startup function
  *           &rcomment;
- *          types_list[0] = NADP_TYPE_DESKTOP_PROVIDER;
+ *          types_list[0] = FMA_TYPE_DESKTOP_PROVIDER;
  *
  *          types_list[NADP_TYPES_COUNT] = 0;
  *          *types = types_list;
diff --git a/src/io-desktop/Makefile.am b/src/io-desktop/Makefile.am
index 610e876..aa17072 100644
--- a/src/io-desktop/Makefile.am
+++ b/src/io-desktop/Makefile.am
@@ -41,10 +41,10 @@ AM_CPPFLAGS += \
        $(NULL)
 
 libna_io_desktop_la_SOURCES = \
-       nadp-desktop-file.c                                                                     \
-       nadp-desktop-file.h                                                                     \
-       nadp-desktop-provider.c                                                         \
-       nadp-desktop-provider.h                                                         \
+       fma-desktop-file.c                                                                      \
+       fma-desktop-file.h                                                                      \
+       fma-desktop-provider.c                                                          \
+       fma-desktop-provider.h                                                          \
        nadp-formats.c                                                                          \
        nadp-formats.h                                                                          \
        nadp-keys.c                                                                                     \
diff --git a/src/io-desktop/fma-desktop-file.c b/src/io-desktop/fma-desktop-file.c
index 349affd..31971f5 100644
--- a/src/io-desktop/fma-desktop-file.c
+++ b/src/io-desktop/fma-desktop-file.c
@@ -37,7 +37,7 @@
 
 #include <api/fma-core-utils.h>
 
-#include "nadp-desktop-file.h"
+#include "fma-desktop-file.h"
 #include "nadp-keys.h"
 
 /* private class data
diff --git a/src/io-desktop/fma-desktop-file.h b/src/io-desktop/fma-desktop-file.h
index 7b6e39f..0c37fc5 100644
--- a/src/io-desktop/fma-desktop-file.h
+++ b/src/io-desktop/fma-desktop-file.h
@@ -33,7 +33,7 @@
 /**
  * SECTION: fma_desktop_file
  * @short_description: #FMADesktopFile class definition.
- * @include: nadp-desktop-file.h
+ * @include: fma-desktop-file.h
  *
  * This class encapŝulates the EggDesktopFile structure, adding some
  * private properties. An instance of this class is associated with
diff --git a/src/io-desktop/nadp-desktop-provider.c b/src/io-desktop/fma-desktop-provider.c
similarity index 80%
rename from src/io-desktop/nadp-desktop-provider.c
rename to src/io-desktop/fma-desktop-provider.c
index 03ca3a7..2f51e20 100644
--- a/src/io-desktop/nadp-desktop-provider.c
+++ b/src/io-desktop/fma-desktop-provider.c
@@ -37,7 +37,7 @@
 #include <api/fma-core-utils.h>
 #include <api/fma-ifactory-provider.h>
 
-#include "nadp-desktop-provider.h"
+#include "fma-desktop-provider.h"
 #include "nadp-formats.h"
 #include "nadp-keys.h"
 #include "nadp-monitor.h"
@@ -46,7 +46,7 @@
 
 /* private class data
  */
-struct _NadpDesktopProviderClassPrivate {
+struct _FMADesktopProviderClassPrivate {
        void *empty;                                            /* so that gcc -pedantic is happy */
 };
 
@@ -54,7 +54,7 @@ static GType         st_module_type = 0;
 static GObjectClass *st_parent_class = NULL;
 static guint         st_burst_timeout = 100;           /* burst timeout in msec */
 
-static void   class_init( NadpDesktopProviderClass *klass );
+static void   class_init( FMADesktopProviderClass *klass );
 static void   instance_init( GTypeInstance *instance, gpointer klass );
 static void   instance_dispose( GObject *object );
 static void   instance_finalize( GObject *object );
@@ -76,27 +76,27 @@ static gchar *iexporter_get_name( const FMAIExporter *exporter );
 static void  *iexporter_get_formats( const FMAIExporter *exporter );
 static void   iexporter_free_formats( const FMAIExporter *exporter, GList *format_list );
 
-static void   on_monitor_timeout( NadpDesktopProvider *provider );
+static void   on_monitor_timeout( FMADesktopProvider *provider );
 
 GType
-nadp_desktop_provider_get_type( void )
+fma_desktop_provider_get_type( void )
 {
        return( st_module_type );
 }
 
 void
-nadp_desktop_provider_register_type( GTypeModule *module )
+fma_desktop_provider_register_type( GTypeModule *module )
 {
-       static const gchar *thisfn = "nadp_desktop_provider_register_type";
+       static const gchar *thisfn = "fma_desktop_provider_register_type";
 
        static GTypeInfo info = {
-               sizeof( NadpDesktopProviderClass ),
+               sizeof( FMADesktopProviderClass ),
                NULL,
                NULL,
                ( GClassInitFunc ) class_init,
                NULL,
                NULL,
-               sizeof( NadpDesktopProvider ),
+               sizeof( FMADesktopProvider ),
                0,
                ( GInstanceInitFunc ) instance_init
        };
@@ -127,7 +127,7 @@ nadp_desktop_provider_register_type( GTypeModule *module )
 
        g_debug( "%s", thisfn );
 
-       st_module_type = g_type_module_register_type( module, G_TYPE_OBJECT, "NadpDesktopProvider", &info, 0 
);
+       st_module_type = g_type_module_register_type( module, G_TYPE_OBJECT, "FMADesktopProvider", &info, 0 );
 
        g_type_module_add_interface( module, st_module_type, FMA_TYPE_IIO_PROVIDER, &iio_provider_iface_info 
);
 
@@ -139,9 +139,9 @@ nadp_desktop_provider_register_type( GTypeModule *module )
 }
 
 static void
-class_init( NadpDesktopProviderClass *klass )
+class_init( FMADesktopProviderClass *klass )
 {
-       static const gchar *thisfn = "nadp_desktop_provider_class_init";
+       static const gchar *thisfn = "fma_desktop_provider_class_init";
        GObjectClass *object_class;
 
        g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -152,23 +152,23 @@ class_init( NadpDesktopProviderClass *klass )
        object_class->dispose = instance_dispose;
        object_class->finalize = instance_finalize;
 
-       klass->private = g_new0( NadpDesktopProviderClassPrivate, 1 );
+       klass->private = g_new0( FMADesktopProviderClassPrivate, 1 );
 }
 
 static void
 instance_init( GTypeInstance *instance, gpointer klass )
 {
-       static const gchar *thisfn = "nadp_desktop_provider_instance_init";
-       NadpDesktopProvider *self;
+       static const gchar *thisfn = "fma_desktop_provider_instance_init";
+       FMADesktopProvider *self;
 
-       g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( instance ));
+       g_return_if_fail( FMA_IS_DESKTOP_PROVIDER( instance ));
 
        g_debug( "%s: instance=%p (%s), klass=%p",
                        thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass );
 
-       self = NADP_DESKTOP_PROVIDER( instance );
+       self = FMA_DESKTOP_PROVIDER( instance );
 
-       self->private = g_new0( NadpDesktopProviderPrivate, 1 );
+       self->private = g_new0( FMADesktopProviderPrivate, 1 );
 
        self->private->dispose_has_run = FALSE;
        self->private->monitors = NULL;
@@ -181,12 +181,12 @@ instance_init( GTypeInstance *instance, gpointer klass )
 static void
 instance_dispose( GObject *object )
 {
-       static const gchar *thisfn = "nadp_desktop_provider_instance_dispose";
-       NadpDesktopProvider *self;
+       static const gchar *thisfn = "fma_desktop_provider_instance_dispose";
+       FMADesktopProvider *self;
 
-       g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( object ));
+       g_return_if_fail( FMA_IS_DESKTOP_PROVIDER( object ));
 
-       self = NADP_DESKTOP_PROVIDER( object );
+       self = FMA_DESKTOP_PROVIDER( object );
 
        if( !self->private->dispose_has_run ){
 
@@ -194,7 +194,7 @@ instance_dispose( GObject *object )
 
                self->private->dispose_has_run = TRUE;
 
-               nadp_desktop_provider_release_monitors( self );
+               fma_desktop_provider_release_monitors( self );
 
                /* chain up to the parent class */
                if( G_OBJECT_CLASS( st_parent_class )->dispose ){
@@ -206,14 +206,14 @@ instance_dispose( GObject *object )
 static void
 instance_finalize( GObject *object )
 {
-       static const gchar *thisfn = "nadp_desktop_provider_instance_finalize";
-       NadpDesktopProvider *self;
+       static const gchar *thisfn = "fma_desktop_provider_instance_finalize";
+       FMADesktopProvider *self;
 
-       g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( object ));
+       g_return_if_fail( FMA_IS_DESKTOP_PROVIDER( object ));
 
        g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ));
 
-       self = NADP_DESKTOP_PROVIDER( object );
+       self = FMA_DESKTOP_PROVIDER( object );
 
        g_free( self->private );
 
@@ -226,7 +226,7 @@ instance_finalize( GObject *object )
 static void
 iio_provider_iface_init( FMAIIOProviderInterface *iface )
 {
-       static const gchar *thisfn = "nadp_desktop_provider_iio_provider_iface_init";
+       static const gchar *thisfn = "fma_desktop_provider_iio_provider_iface_init";
 
        g_debug( "%s: iface=%p", thisfn, ( void * ) iface );
 
@@ -262,7 +262,7 @@ iio_provider_get_name( const FMAIIOProvider *provider )
 static void
 ifactory_provider_iface_init( FMAIFactoryProviderInterface *iface )
 {
-       static const gchar *thisfn = "nadp_desktop_provider_ifactory_provider_iface_init";
+       static const gchar *thisfn = "fma_desktop_provider_ifactory_provider_iface_init";
 
        g_debug( "%s: iface=%p", thisfn, ( void * ) iface );
 
@@ -284,7 +284,7 @@ ifactory_provider_get_version( const FMAIFactoryProvider *reader )
 static void
 iimporter_iface_init( FMAIImporterInterface *iface )
 {
-       static const gchar *thisfn = "nadp_desktop_provider_iimporter_iface_init";
+       static const gchar *thisfn = "fma_desktop_provider_iimporter_iface_init";
 
        g_debug( "%s: iface=%p", thisfn, ( void * ) iface );
 
@@ -338,18 +338,18 @@ iexporter_free_formats( const FMAIExporter *exporter, GList *format_list )
 }
 
 /**
- * nadp_desktop_provider_add_monitor:
- * @provider: this #NadpDesktopProvider object.
+ * fma_desktop_provider_add_monitor:
+ * @provider: this #FMADesktopProvider object.
  * @dir: the path to the directory to be monitored. May not exist.
  *
  * Installs a GIO monitor on the given directory.
  */
 void
-nadp_desktop_provider_add_monitor( NadpDesktopProvider *provider, const gchar *dir )
+fma_desktop_provider_add_monitor( FMADesktopProvider *provider, const gchar *dir )
 {
        NadpMonitor *monitor;
 
-       g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ));
+       g_return_if_fail( FMA_IS_DESKTOP_PROVIDER( provider ));
 
        if( !provider->private->dispose_has_run ){
 
@@ -359,15 +359,15 @@ nadp_desktop_provider_add_monitor( NadpDesktopProvider *provider, const gchar *d
 }
 
 /**
- * nadp_desktop_provider_on_monitor_event:
- * @provider: this #NadpDesktopProvider object.
+ * fma_desktop_provider_on_monitor_event:
+ * @provider: this #FMADesktopProvider object.
  *
  * Factorize events received from GIO when monitoring desktop directories.
  */
 void
-nadp_desktop_provider_on_monitor_event( NadpDesktopProvider *provider )
+fma_desktop_provider_on_monitor_event( FMADesktopProvider *provider )
 {
-       g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ));
+       g_return_if_fail( FMA_IS_DESKTOP_PROVIDER( provider ));
 
        if( !provider->private->dispose_has_run ){
 
@@ -376,15 +376,15 @@ nadp_desktop_provider_on_monitor_event( NadpDesktopProvider *provider )
 }
 
 /**
- * nadp_desktop_provider_release_monitors:
- * @provider: this #NadpDesktopProvider object.
+ * fma_desktop_provider_release_monitors:
+ * @provider: this #FMADesktopProvider object.
  *
  * Release previously set desktop monitors.
  */
 void
-nadp_desktop_provider_release_monitors( NadpDesktopProvider *provider )
+fma_desktop_provider_release_monitors( FMADesktopProvider *provider )
 {
-       g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ));
+       g_return_if_fail( FMA_IS_DESKTOP_PROVIDER( provider ));
 
        if( provider->private->monitors ){
 
@@ -395,9 +395,9 @@ nadp_desktop_provider_release_monitors( NadpDesktopProvider *provider )
 }
 
 static void
-on_monitor_timeout( NadpDesktopProvider *provider )
+on_monitor_timeout( FMADesktopProvider *provider )
 {
-       static const gchar *thisfn = "nadp_desktop_provider_on_monitor_timeout";
+       static const gchar *thisfn = "fma_desktop_provider_on_monitor_timeout";
 
        /* last individual notification is older that the st_burst_timeout
         * so triggers the FMAIIOProvider interface and destroys this timeout
diff --git a/src/io-desktop/fma-desktop-provider.h b/src/io-desktop/fma-desktop-provider.h
new file mode 100644
index 0000000..d4cf9fb
--- /dev/null
+++ b/src/io-desktop/fma-desktop-provider.h
@@ -0,0 +1,99 @@
+/*
+ * FileManager-Actions
+ * A file-manager extension which offers configurable context menu actions.
+ *
+ * Copyright (C) 2005 The GNOME Foundation
+ * Copyright (C) 2006-2008 Frederic Ruaudel and others (see AUTHORS)
+ * Copyright (C) 2009-2015 Pierre Wieser and others (see AUTHORS)
+ *
+ * FileManager-Actions is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * FileManager-Actions is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with FileManager-Actions; see the file COPYING. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ *   Frederic Ruaudel <grumz grumz net>
+ *   Rodrigo Moya <rodrigo gnome-db org>
+ *   Pierre Wieser <pwieser trychlos org>
+ *   ... and many others (see AUTHORS)
+ */
+
+#ifndef __IO_DESKTOP_FMA_DESKTOP_PROVIDER_H__
+#define __IO_DESKTOP_FMA_DESKTOP_PROVIDER_H__
+
+/**
+ * SECTION: fma_desktop_provider
+ * @short_description: #FMADesktopProvider class definition.
+ * @include: fma-desktop-provider.h
+ *
+ * This class manages .desktop files I/O storage subsystem, or, in
+ * other words, .desktop files as FMAIIOProvider providers. As this, it
+ * should only be used through the FMAIIOProvider interface.
+ */
+
+#include <glib-object.h>
+
+#include <api/fma-object-item.h>
+#include <api/fma-timeout.h>
+
+#include "fma-desktop-file.h"
+
+G_BEGIN_DECLS
+
+#define FMA_TYPE_DESKTOP_PROVIDER                ( fma_desktop_provider_get_type())
+#define FMA_DESKTOP_PROVIDER( object )           ( G_TYPE_CHECK_INSTANCE_CAST( object, 
FMA_TYPE_DESKTOP_PROVIDER, FMADesktopProvider ))
+#define FMA_DESKTOP_PROVIDER_CLASS( klass )      ( G_TYPE_CHECK_CLASS_CAST( klass, 
FMA_TYPE_DESKTOP_PROVIDER, FMADesktopProviderClass ))
+#define FMA_IS_DESKTOP_PROVIDER( object )        ( G_TYPE_CHECK_INSTANCE_TYPE( object, 
FMA_TYPE_DESKTOP_PROVIDER ))
+#define FMA_IS_DESKTOP_PROVIDER_CLASS( klass )   ( G_TYPE_CHECK_CLASS_TYPE(( klass ), 
FMA_TYPE_DESKTOP_PROVIDER ))
+#define FMA_DESKTOP_PROVIDER_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ), 
FMA_TYPE_DESKTOP_PROVIDER, FMADesktopProviderClass ))
+
+/* private instance data
+ */
+typedef struct _FMADesktopProviderPrivate {
+       /*< private >*/
+       gboolean   dispose_has_run;
+       GList     *monitors;
+       FMATimeout timeout;
+}
+       FMADesktopProviderPrivate;
+
+typedef struct {
+       /*< private >*/
+       GObject                    parent;
+       FMADesktopProviderPrivate *private;
+}
+       FMADesktopProvider;
+
+typedef struct _FMADesktopProviderClassPrivate   FMADesktopProviderClassPrivate;
+
+typedef struct {
+       /*< private >*/
+       GObjectClass                    parent;
+       FMADesktopProviderClassPrivate *private;
+}
+       FMADesktopProviderClass;
+
+/* this is a ':'-separated list of XDG_DATA_DIRS/subdirs searched for
+ * menus or actions .desktop files.
+ */
+#define FMA_DESKTOP_PROVIDER_SUBDIRS   "file-manager/actions"
+
+GType fma_desktop_provider_get_type        ( void );
+void  fma_desktop_provider_register_type   ( GTypeModule *module );
+
+void  fma_desktop_provider_add_monitor     ( FMADesktopProvider *provider, const gchar *dir );
+void  fma_desktop_provider_on_monitor_event( FMADesktopProvider *provider );
+void  fma_desktop_provider_release_monitors( FMADesktopProvider *provider );
+
+G_END_DECLS
+
+#endif /* __IO_DESKTOP_FMA_DESKTOP_PROVIDER_H__ */
diff --git a/src/io-desktop/nadp-module.c b/src/io-desktop/nadp-module.c
index 43ee985..58f46a8 100644
--- a/src/io-desktop/nadp-module.c
+++ b/src/io-desktop/nadp-module.c
@@ -33,7 +33,7 @@
 
 #include <api/fma-extension.h>
 
-#include "nadp-desktop-provider.h"
+#include "fma-desktop-provider.h"
 
 /* the count of GType types provided by this extension
  * each new GType type must
@@ -54,7 +54,7 @@ fma_extension_startup( GTypeModule *module )
 
        g_debug( "%s: module=%p", thisfn, ( void * ) module );
 
-       nadp_desktop_provider_register_type( module );
+       fma_desktop_provider_register_type( module );
 
        return( TRUE );
 }
@@ -90,7 +90,7 @@ fma_extension_list_types( const GType **types )
 
        g_debug( "%s: types=%p", thisfn, ( void * ) types );
 
-       types_list[0] = NADP_TYPE_DESKTOP_PROVIDER;
+       types_list[0] = FMA_TYPE_DESKTOP_PROVIDER;
 
        types_list[NADP_TYPES_COUNT] = 0;
        *types = types_list;
diff --git a/src/io-desktop/nadp-monitor.c b/src/io-desktop/nadp-monitor.c
index 41e5b5d..48acd01 100644
--- a/src/io-desktop/nadp-monitor.c
+++ b/src/io-desktop/nadp-monitor.c
@@ -45,7 +45,7 @@ struct _NadpMonitorClassPrivate {
  */
 struct _NadpMonitorPrivate {
        gboolean             dispose_has_run;
-       NadpDesktopProvider *provider;
+       FMADesktopProvider *provider;
        gchar               *name;
        GFile               *file;
        GFileMonitor        *monitor;
@@ -193,7 +193,7 @@ instance_finalize( GObject *object )
 
 /**
  * nadp_monitor_new:
- * @provider: the #NadpDesktopProvider instance.
+ * @provider: the #FMADesktopProvider instance.
  * @path: the path of a directory to be monitored.
  *
  * Installs a new monitor on the given directory.
@@ -201,7 +201,7 @@ instance_finalize( GObject *object )
  * Returns: a new #NadpMonitor instance.
  */
 NadpMonitor *
-nadp_monitor_new( const NadpDesktopProvider *provider, const gchar *path )
+nadp_monitor_new( const FMADesktopProvider *provider, const gchar *path )
 {
        static const gchar *thisfn = "nadp_monitor_new";
        NadpMonitor *monitor;
@@ -210,7 +210,7 @@ nadp_monitor_new( const NadpDesktopProvider *provider, const gchar *path )
 
        monitor = g_object_new( NADP_TYPE_MONITOR, NULL );
 
-       monitor->private->provider = NADP_DESKTOP_PROVIDER( provider );
+       monitor->private->provider = FMA_DESKTOP_PROVIDER( provider );
        monitor->private->name = g_strdup( path );
        monitor->private->file = g_file_new_for_path( path );
 
@@ -246,5 +246,5 @@ nadp_monitor_new( const NadpDesktopProvider *provider, const gchar *path )
 static void
 on_monitor_changed( GFileMonitor *monitor, GFile *file, GFile *other_file, GFileMonitorEvent event_type, 
NadpMonitor *my_monitor )
 {
-       nadp_desktop_provider_on_monitor_event( my_monitor->private->provider );
+       fma_desktop_provider_on_monitor_event( my_monitor->private->provider );
 }
diff --git a/src/io-desktop/nadp-monitor.h b/src/io-desktop/nadp-monitor.h
index 67cabc2..d1f3921 100644
--- a/src/io-desktop/nadp-monitor.h
+++ b/src/io-desktop/nadp-monitor.h
@@ -46,7 +46,7 @@
  * we try to factorize all monitor events before advertizing FMAPivot.
  */
 
-#include "nadp-desktop-provider.h"
+#include "fma-desktop-provider.h"
 
 G_BEGIN_DECLS
 
@@ -77,7 +77,7 @@ typedef struct {
 
 GType        nadp_monitor_get_type( void );
 
-NadpMonitor *nadp_monitor_new( const NadpDesktopProvider *provider, const gchar *path );
+NadpMonitor *nadp_monitor_new( const FMADesktopProvider *provider, const gchar *path );
 
 G_END_DECLS
 
diff --git a/src/io-desktop/nadp-reader.c b/src/io-desktop/nadp-reader.c
index 9e69179..3879050 100644
--- a/src/io-desktop/nadp-reader.c
+++ b/src/io-desktop/nadp-reader.c
@@ -41,7 +41,7 @@
 #include <api/fma-ifactory-provider.h>
 #include <api/fma-object-api.h>
 
-#include "nadp-desktop-provider.h"
+#include "fma-desktop-provider.h"
 #include "nadp-keys.h"
 #include "nadp-reader.h"
 #include "nadp-utils.h"
@@ -63,12 +63,12 @@ typedef struct {
 
 #define ERR_NOT_DESKTOP                _( "The Desktop I/O Provider is not able to handle the URI" )
 
-static GList            *get_list_of_desktop_paths( NadpDesktopProvider *provider, GSList **mesages );
-static void              get_list_of_desktop_files( const NadpDesktopProvider *provider, GList **files, 
const gchar *dir, GSList **messages );
-static gboolean          is_already_loaded( const NadpDesktopProvider *provider, GList *files, const gchar 
*desktop_id );
-static GList            *desktop_path_from_id( const NadpDesktopProvider *provider, GList *files, const 
gchar *dir, const gchar *id );
-static FMAIFactoryObject *item_from_desktop_path( const NadpDesktopProvider *provider, DesktopPath *dps, 
GSList **messages );
-static FMAIFactoryObject *item_from_desktop_file( const NadpDesktopProvider *provider, FMADesktopFile *ndf, 
GSList **messages );
+static GList            *get_list_of_desktop_paths( FMADesktopProvider *provider, GSList **mesages );
+static void              get_list_of_desktop_files( const FMADesktopProvider *provider, GList **files, const 
gchar *dir, GSList **messages );
+static gboolean          is_already_loaded( const FMADesktopProvider *provider, GList *files, const gchar 
*desktop_id );
+static GList            *desktop_path_from_id( const FMADesktopProvider *provider, GList *files, const gchar 
*dir, const gchar *id );
+static FMAIFactoryObject *item_from_desktop_path( const FMADesktopProvider *provider, DesktopPath *dps, 
GSList **messages );
+static FMAIFactoryObject *item_from_desktop_file( const FMADesktopProvider *provider, FMADesktopFile *ndf, 
GSList **messages );
 static void              desktop_weak_notify( FMADesktopFile *ndf, GObject *item );
 static void              free_desktop_paths( GList *paths );
 
@@ -98,12 +98,12 @@ nadp_iio_provider_read_items( const FMAIIOProvider *provider, GSList **messages
        g_return_val_if_fail( FMA_IS_IIO_PROVIDER( provider ), NULL );
 
        items = NULL;
-       nadp_desktop_provider_release_monitors( NADP_DESKTOP_PROVIDER( provider ));
+       fma_desktop_provider_release_monitors( FMA_DESKTOP_PROVIDER( provider ));
 
-       desktop_paths = get_list_of_desktop_paths( NADP_DESKTOP_PROVIDER( provider ), messages );
+       desktop_paths = get_list_of_desktop_paths( FMA_DESKTOP_PROVIDER( provider ), messages );
        for( ip = desktop_paths ; ip ; ip = ip->next ){
 
-               item = item_from_desktop_path( NADP_DESKTOP_PROVIDER( provider ), ( DesktopPath * ) ip->data, 
messages );
+               item = item_from_desktop_path( FMA_DESKTOP_PROVIDER( provider ), ( DesktopPath * ) ip->data, 
messages );
 
                if( item ){
                        items = g_list_prepend( items, item );
@@ -128,7 +128,7 @@ nadp_iio_provider_read_items( const FMAIIOProvider *provider, GSList **messages
  * the ordered of preference (most preferred first)
  */
 static GList *
-get_list_of_desktop_paths( NadpDesktopProvider *provider, GSList **messages )
+get_list_of_desktop_paths( FMADesktopProvider *provider, GSList **messages )
 {
        GList *files;
        GSList *xdg_dirs, *idir;
@@ -137,7 +137,7 @@ get_list_of_desktop_paths( NadpDesktopProvider *provider, GSList **messages )
 
        files = NULL;
        xdg_dirs = nadp_xdg_dirs_get_data_dirs();
-       subdirs = fma_core_utils_slist_from_split( NADP_DESKTOP_PROVIDER_SUBDIRS, G_SEARCHPATH_SEPARATOR_S );
+       subdirs = fma_core_utils_slist_from_split( FMA_DESKTOP_PROVIDER_SUBDIRS, G_SEARCHPATH_SEPARATOR_S );
 
        /* explore each directory from XDG_DATA_DIRS
         */
@@ -148,7 +148,7 @@ get_list_of_desktop_paths( NadpDesktopProvider *provider, GSList **messages )
                for( isub = subdirs ; isub ; isub = isub->next ){
 
                        dir = g_build_filename(( gchar * ) idir->data, ( gchar * ) isub->data, NULL );
-                       nadp_desktop_provider_add_monitor( provider, dir );
+                       fma_desktop_provider_add_monitor( provider, dir );
                        get_list_of_desktop_files( provider, &files, dir, messages );
                        g_free( dir );
                }
@@ -165,7 +165,7 @@ get_list_of_desktop_paths( NadpDesktopProvider *provider, GSList **messages )
  * only adds to the list those which have not been yet loaded
  */
 static void
-get_list_of_desktop_files( const NadpDesktopProvider *provider, GList **files, const gchar *dir, GSList 
**messages )
+get_list_of_desktop_files( const FMADesktopProvider *provider, GList **files, const gchar *dir, GSList 
**messages )
 {
        static const gchar *thisfn = "nadp_reader_get_list_of_desktop_files";
        GDir *dir_handle;
@@ -211,7 +211,7 @@ close_dir_handle:
 }
 
 static gboolean
-is_already_loaded( const NadpDesktopProvider *provider, GList *files, const gchar *desktop_id )
+is_already_loaded( const FMADesktopProvider *provider, GList *files, const gchar *desktop_id )
 {
        gboolean found;
        GList *ip;
@@ -229,7 +229,7 @@ is_already_loaded( const NadpDesktopProvider *provider, GList *files, const gcha
 }
 
 static GList *
-desktop_path_from_id( const NadpDesktopProvider *provider, GList *files, const gchar *dir, const gchar *id )
+desktop_path_from_id( const FMADesktopProvider *provider, GList *files, const gchar *dir, const gchar *id )
 {
        DesktopPath *dps;
        gchar *bname;
@@ -253,7 +253,7 @@ desktop_path_from_id( const NadpDesktopProvider *provider, GList *files, const g
  * from the .desktop file pointed to by DesktopPath struct
  */
 static FMAIFactoryObject *
-item_from_desktop_path( const NadpDesktopProvider *provider, DesktopPath *dps, GSList **messages )
+item_from_desktop_path( const FMADesktopProvider *provider, DesktopPath *dps, GSList **messages )
 {
        FMADesktopFile *ndf;
 
@@ -270,7 +270,7 @@ item_from_desktop_path( const NadpDesktopProvider *provider, DesktopPath *dps, G
  * from the .desktop file
  */
 static FMAIFactoryObject *
-item_from_desktop_file( const NadpDesktopProvider *provider, FMADesktopFile *ndf, GSList **messages )
+item_from_desktop_file( const FMADesktopProvider *provider, FMADesktopFile *ndf, GSList **messages )
 {
        /*static const gchar *thisfn = "nadp_reader_item_from_desktop_file";*/
        FMAIFactoryObject *item;
@@ -371,7 +371,7 @@ nadp_reader_iimporter_import_from_uri( const FMAIImporter *instance, void *parms
        g_debug( "%s: instance=%p, parms=%p", thisfn, ( void * ) instance, parms_ptr );
 
        g_return_val_if_fail( FMA_IS_IIMPORTER( instance ), IMPORTER_CODE_PROGRAM_ERROR );
-       g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( instance ), IMPORTER_CODE_PROGRAM_ERROR );
+       g_return_val_if_fail( FMA_IS_DESKTOP_PROVIDER( instance ), IMPORTER_CODE_PROGRAM_ERROR );
 
        parms = ( FMAIImporterImportFromUriParmsv2 * ) parms_ptr;
 
@@ -385,7 +385,7 @@ nadp_reader_iimporter_import_from_uri( const FMAIImporter *instance, void *parms
        ndf = fma_desktop_file_new_from_uri( parms->uri );
        if( ndf ){
                parms->imported = ( FMAObjectItem * ) item_from_desktop_file(
-                               ( const NadpDesktopProvider * ) NADP_DESKTOP_PROVIDER( instance ),
+                               ( const FMADesktopProvider * ) FMA_DESKTOP_PROVIDER( instance ),
                                ndf, &parms->messages );
 
                if( parms->imported ){
@@ -424,10 +424,10 @@ nadp_reader_ifactory_provider_read_start( const FMAIFactoryProvider *reader, voi
        static const gchar *thisfn = "nadp_reader_ifactory_provider_read_start";
 
        g_return_if_fail( FMA_IS_IFACTORY_PROVIDER( reader ));
-       g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( reader ));
+       g_return_if_fail( FMA_IS_DESKTOP_PROVIDER( reader ));
        g_return_if_fail( FMA_IS_IFACTORY_OBJECT( serializable ));
 
-       if( !NADP_DESKTOP_PROVIDER( reader )->private->dispose_has_run ){
+       if( !FMA_DESKTOP_PROVIDER( reader )->private->dispose_has_run ){
 
                g_debug( "%s: reader=%p (%s), reader_data=%p, serializable=%p (%s), messages=%p",
                                thisfn,
@@ -497,12 +497,12 @@ nadp_reader_ifactory_provider_read_data( const FMAIFactoryProvider *reader, void
        guint uint_value;
 
        g_return_val_if_fail( FMA_IS_IFACTORY_PROVIDER( reader ), NULL );
-       g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( reader ), NULL );
+       g_return_val_if_fail( FMA_IS_DESKTOP_PROVIDER( reader ), NULL );
        g_return_val_if_fail( FMA_IS_IFACTORY_OBJECT( object ), NULL );
 
        boxed = NULL;
 
-       if( !NADP_DESKTOP_PROVIDER( reader )->private->dispose_has_run ){
+       if( !FMA_DESKTOP_PROVIDER( reader )->private->dispose_has_run ){
 
                nrd = ( NadpReaderData * ) reader_data;
                g_return_val_if_fail( FMA_IS_DESKTOP_FILE( nrd->ndf ), NULL );
@@ -587,10 +587,10 @@ nadp_reader_ifactory_provider_read_done( const FMAIFactoryProvider *reader, void
        gboolean writable;
 
        g_return_if_fail( FMA_IS_IFACTORY_PROVIDER( reader ));
-       g_return_if_fail( NADP_IS_DESKTOP_PROVIDER( reader ));
+       g_return_if_fail( FMA_IS_DESKTOP_PROVIDER( reader ));
        g_return_if_fail( FMA_IS_IFACTORY_OBJECT( serializable ));
 
-       if( !NADP_DESKTOP_PROVIDER( reader )->private->dispose_has_run ){
+       if( !FMA_DESKTOP_PROVIDER( reader )->private->dispose_has_run ){
 
                g_debug( "%s: reader=%p (%s), reader_data=%p, serializable=%p (%s), messages=%p",
                                thisfn,
diff --git a/src/io-desktop/nadp-utils.c b/src/io-desktop/nadp-utils.c
index 5d6c90a..3d74abd 100644
--- a/src/io-desktop/nadp-utils.c
+++ b/src/io-desktop/nadp-utils.c
@@ -38,7 +38,7 @@
 
 #include <api/fma-core-utils.h>
 
-#include "nadp-desktop-provider.h"
+#include "fma-desktop-provider.h"
 #include "nadp-utils.h"
 
 /**
diff --git a/src/io-desktop/nadp-writer.c b/src/io-desktop/nadp-writer.c
index 9f8b1c9..9367578 100644
--- a/src/io-desktop/nadp-writer.c
+++ b/src/io-desktop/nadp-writer.c
@@ -39,8 +39,8 @@
 #include <api/fma-object-api.h>
 #include <api/fma-ifactory-provider.h>
 
-#include "nadp-desktop-file.h"
-#include "nadp-desktop-provider.h"
+#include "fma-desktop-file.h"
+#include "fma-desktop-provider.h"
 #include "nadp-formats.h"
 #include "nadp-keys.h"
 #include "nadp-utils.h"
@@ -86,7 +86,7 @@ nadp_iio_provider_is_willing_to_write( const FMAIIOProvider *provider )
 }
 
 /*
- * NadpDesktopProvider is able to write if user data dir exists (or
+ * FMADesktopProvider is able to write if user data dir exists (or
  * can be created) and is writable
  *
  * This is implementation of FMAIIOProvider::is_able_to_write method
@@ -98,7 +98,7 @@ nadp_iio_provider_is_able_to_write( const FMAIIOProvider *provider )
        gboolean able_to;
        gchar *userdir;
 
-       g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), FALSE );
+       g_return_val_if_fail( FMA_IS_DESKTOP_PROVIDER( provider ), FALSE );
 
        able_to = FALSE;
 
@@ -139,7 +139,7 @@ nadp_iio_provider_write_item( const FMAIIOProvider *provider, const FMAObjectIte
 
        ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
 
-       g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret );
+       g_return_val_if_fail( FMA_IS_DESKTOP_PROVIDER( provider ), ret );
        g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), ret );
 
        if( fma_object_is_readonly( item )){
@@ -155,7 +155,7 @@ nadp_iio_provider_write_item( const FMAIIOProvider *provider, const FMAObjectIte
 
        } else {
                userdir = nadp_xdg_dirs_get_user_data_dir();
-               subdirs = fma_core_utils_slist_from_split( NADP_DESKTOP_PROVIDER_SUBDIRS, 
G_SEARCHPATH_SEPARATOR_S );
+               subdirs = fma_core_utils_slist_from_split( FMA_DESKTOP_PROVIDER_SUBDIRS, 
G_SEARCHPATH_SEPARATOR_S );
                fulldir = g_build_filename( userdir, ( gchar * ) subdirs->data, NULL );
                dir_ok = TRUE;
 
@@ -209,7 +209,7 @@ write_item( const FMAIIOProvider *provider, const FMAObjectItem *item, FMADeskto
 {
        static const gchar *thisfn = "nadp_iio_provider_write_item";
        guint ret;
-       NadpDesktopProvider *self;
+       FMADesktopProvider *self;
 
        g_debug( "%s: provider=%p (%s), item=%p (%s), ndf=%p, messages=%p",
                        thisfn,
@@ -221,7 +221,7 @@ write_item( const FMAIIOProvider *provider, const FMAObjectItem *item, FMADeskto
        ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
 
        g_return_val_if_fail( FMA_IS_IIO_PROVIDER( provider ), ret );
-       g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret );
+       g_return_val_if_fail( FMA_IS_DESKTOP_PROVIDER( provider ), ret );
        g_return_val_if_fail( FMA_IS_IFACTORY_PROVIDER( provider ), ret );
 
        g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), ret );
@@ -229,7 +229,7 @@ write_item( const FMAIIOProvider *provider, const FMAObjectItem *item, FMADeskto
 
        g_return_val_if_fail( FMA_IS_DESKTOP_FILE( ndf ), ret );
 
-       self = NADP_DESKTOP_PROVIDER( provider );
+       self = FMA_DESKTOP_PROVIDER( provider );
 
        if( self->private->dispose_has_run ){
                return( IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN );
@@ -251,7 +251,7 @@ nadp_iio_provider_delete_item( const FMAIIOProvider *provider, const FMAObjectIt
 {
        static const gchar *thisfn = "nadp_iio_provider_delete_item";
        guint ret;
-       NadpDesktopProvider *self;
+       FMADesktopProvider *self;
        FMADesktopFile *ndf;
        gchar *uri;
 
@@ -264,10 +264,10 @@ nadp_iio_provider_delete_item( const FMAIIOProvider *provider, const FMAObjectIt
        ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
 
        g_return_val_if_fail( FMA_IS_IIO_PROVIDER( provider ), ret );
-       g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret );
+       g_return_val_if_fail( FMA_IS_DESKTOP_PROVIDER( provider ), ret );
        g_return_val_if_fail( FMA_IS_OBJECT_ITEM( item ), ret );
 
-       self = NADP_DESKTOP_PROVIDER( provider );
+       self = FMA_DESKTOP_PROVIDER( provider );
 
        if( self->private->dispose_has_run ){
                return( IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN );
@@ -313,7 +313,7 @@ nadp_iio_provider_duplicate_data( const FMAIIOProvider *provider, FMAObjectItem
 {
        static const gchar *thisfn = "nadp_iio_provider_duplicate_data";
        guint ret;
-       NadpDesktopProvider *self;
+       FMADesktopProvider *self;
        FMADesktopFile *ndf;
 
        g_debug( "%s: provider=%p (%s), dest=%p (%s), source=%p (%s), messages=%p",
@@ -326,11 +326,11 @@ nadp_iio_provider_duplicate_data( const FMAIIOProvider *provider, FMAObjectItem
        ret = IIO_PROVIDER_CODE_PROGRAM_ERROR;
 
        g_return_val_if_fail( FMA_IS_IIO_PROVIDER( provider ), ret );
-       g_return_val_if_fail( NADP_IS_DESKTOP_PROVIDER( provider ), ret );
+       g_return_val_if_fail( FMA_IS_DESKTOP_PROVIDER( provider ), ret );
        g_return_val_if_fail( FMA_IS_OBJECT_ITEM( dest ), ret );
        g_return_val_if_fail( FMA_IS_OBJECT_ITEM( source ), ret );
 
-       self = NADP_DESKTOP_PROVIDER( provider );
+       self = FMA_DESKTOP_PROVIDER( provider );
 
        if( self->private->dispose_has_run ){
                return( IIO_PROVIDER_CODE_NOT_WILLING_TO_RUN );


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]