[nautilus-actions/file-manager-actions] NASelectedInfo class is renamed to FMASelectedInfo
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions/file-manager-actions] NASelectedInfo class is renamed to FMASelectedInfo
- Date: Tue, 8 Sep 2015 10:28:30 +0000 (UTC)
commit 23cc1f10ef7cfe41fdf6e40f57b3d7af501b340f
Author: Pierre Wieser <pwieser trychlos org>
Date: Tue Sep 8 12:03:02 2015 +0200
NASelectedInfo class is renamed to FMASelectedInfo
src/core/Makefile.am | 4 +-
src/core/fma-icontext.c | 26 +-
src/core/fma-object-profile.c | 2 +-
.../{na-selected-info.c => fma-selected-info.c} | 254 ++++++++++----------
src/core/fma-selected-info.h | 103 ++++++++
src/core/na-selected-info.h | 103 --------
src/core/na-tokens.c | 22 +-
src/plugin-menu/nautilus-actions.c | 20 +-
src/utils/nautilus-actions-run.c | 16 +-
9 files changed, 275 insertions(+), 275 deletions(-)
---
diff --git a/src/core/Makefile.am b/src/core/Makefile.am
index a3d21a6..9bd9e48 100644
--- a/src/core/Makefile.am
+++ b/src/core/Makefile.am
@@ -113,8 +113,8 @@ libna_core_la_SOURCES = \
fma-object-menu-factory.c \
fma-pivot.c \
fma-pivot.h \
- na-selected-info.c \
- na-selected-info.h \
+ fma-selected-info.c \
+ fma-selected-info.h \
na-settings.c \
na-settings.h \
fma-timeout.c \
diff --git a/src/core/fma-icontext.c b/src/core/fma-icontext.c
index cfd5e5d..07f1b87 100644
--- a/src/core/fma-icontext.c
+++ b/src/core/fma-icontext.c
@@ -52,7 +52,7 @@
#include "fma-desktop-environment.h"
#include "fma-gnome-vfs-uri.h"
-#include "na-selected-info.h"
+#include "fma-selected-info.h"
#include "na-settings.h"
/* private interface data
@@ -201,7 +201,7 @@ fma_icontext_are_equal( const FMAIContext *a, const FMAIContext *b )
* fma_icontext_is_candidate:
* @context: a #FMAIContext to be checked.
* @target: the current target.
- * @selection: the currently selected items, as a #GList of NASelectedInfo items.
+ * @selection: the currently selected items, as a #GList of FMASelectedInfo items.
*
* Determines if the given object may be candidate to be displayed in
* the Nautilus context menu, depending of the list of currently selected
@@ -739,8 +739,8 @@ is_candidate_for_mimetypes( const FMAIContext *object, guint target, GList *file
gboolean regular, match, positive;
match = FALSE;
- ftype = na_selected_info_get_mime_type( NA_SELECTED_INFO( it->data ));
- regular = na_selected_info_is_regular( NA_SELECTED_INFO( it->data ));
+ ftype = fma_selected_info_get_mime_type( FMA_SELECTED_INFO( it->data ));
+ regular = fma_selected_info_is_regular( FMA_SELECTED_INFO( it->data ));
if( ftype ){
for( im = mimetypes ; im && ok ; im = im->next ){
@@ -768,7 +768,7 @@ is_candidate_for_mimetypes( const FMAIContext *object, guint target, GList *file
}
} else {
- gchar *uri = na_selected_info_get_uri( NA_SELECTED_INFO( it->data ));
+ gchar *uri = fma_selected_info_get_uri( FMA_SELECTED_INFO( it->data ));
g_warning( "%s: null mimetype found for %s", thisfn, uri );
g_free( uri );
ok = FALSE;
@@ -863,7 +863,7 @@ is_candidate_for_basenames( const FMAIContext *object, guint target, GList *file
gboolean match, positive;
gchar *pattern_utf8;
- bname = na_selected_info_get_basename( NA_SELECTED_INFO( it->data ));
+ bname = fma_selected_info_get_basename( FMA_SELECTED_INFO( it->data ));
bname_utf8 = g_filename_to_utf8( bname, -1, NULL, NULL, NULL );
if( !matchcase ){
tmp = g_utf8_strdown( bname_utf8, -1 );
@@ -974,7 +974,7 @@ is_candidate_for_schemes( const FMAIContext *object, guint target, GList *files
GList *it;
for( it = files ; it && ok ; it = it->next ){
- gchar *scheme = na_selected_info_get_uri_scheme( NA_SELECTED_INFO( it->data
));
+ gchar *scheme = fma_selected_info_get_uri_scheme( FMA_SELECTED_INFO( it->data
));
if( fma_core_utils_slist_count( distincts, scheme ) == 0 ){
GSList *is;
@@ -1057,7 +1057,7 @@ is_candidate_for_folders( const FMAIContext *object, guint target, GList *files
GList *it;
for( it = files ; it && ok ; it = it->next ){
- gchar *dirname = na_selected_info_get_dirname( NA_SELECTED_INFO( it->data ));
+ gchar *dirname = fma_selected_info_get_dirname( FMA_SELECTED_INFO( it->data
));
if( fma_core_utils_slist_count( distincts, dirname ) == 0 ){
g_debug( "%s: examining new distinct selected dirname=%s", thisfn,
dirname );
@@ -1127,19 +1127,19 @@ is_candidate_for_capabilities( const FMAIContext *object, guint target, GList *f
match = FALSE;
if( !strcmp( positive ? cap : cap+1, "Owner" )){
- match = na_selected_info_is_owner( NA_SELECTED_INFO( it->data ),
getlogin());
+ match = fma_selected_info_is_owner( FMA_SELECTED_INFO( it->data ),
getlogin());
} else if( !strcmp( positive ? cap : cap+1, "Readable" )){
- match = na_selected_info_is_readable( NA_SELECTED_INFO( it->data ));
+ match = fma_selected_info_is_readable( FMA_SELECTED_INFO( it->data ));
} else if( !strcmp( positive ? cap : cap+1, "Writable" )){
- match = na_selected_info_is_writable( NA_SELECTED_INFO( it->data ));
+ match = fma_selected_info_is_writable( FMA_SELECTED_INFO( it->data ));
} else if( !strcmp( positive ? cap : cap+1, "Executable" )){
- match = na_selected_info_is_executable( NA_SELECTED_INFO( it->data ));
+ match = fma_selected_info_is_executable( FMA_SELECTED_INFO( it->data
));
} else if( !strcmp( positive ? cap : cap+1, "Local" )){
- match = na_selected_info_is_local( NA_SELECTED_INFO( it->data ));
+ match = fma_selected_info_is_local( FMA_SELECTED_INFO( it->data ));
} else {
g_warning( "%s: unknown capability %s", thisfn, cap );
diff --git a/src/core/fma-object-profile.c b/src/core/fma-object-profile.c
index 2e428c4..a46e379 100644
--- a/src/core/fma-object-profile.c
+++ b/src/core/fma-object-profile.c
@@ -43,7 +43,7 @@
#include "fma-factory-provider.h"
#include "fma-factory-object.h"
-#include "na-selected-info.h"
+#include "fma-selected-info.h"
#include "fma-gnome-vfs-uri.h"
/* private class data
diff --git a/src/core/na-selected-info.c b/src/core/fma-selected-info.c
similarity index 71%
rename from src/core/na-selected-info.c
rename to src/core/fma-selected-info.c
index 848331e..a952924 100644
--- a/src/core/na-selected-info.c
+++ b/src/core/fma-selected-info.c
@@ -35,17 +35,17 @@
#include <string.h>
#include "fma-gnome-vfs-uri.h"
-#include "na-selected-info.h"
+#include "fma-selected-info.h"
/* private class data
*/
-struct _NASelectedInfoClassPrivate {
+struct _FMASelectedInfoClassPrivate {
void *empty; /* so that gcc -pedantic is happy */
};
/* private instance data
*/
-struct _NASelectedInfoPrivate {
+struct _FMASelectedInfoPrivate {
gboolean dispose_has_run;
gchar *uri;
gchar *filename;
@@ -68,19 +68,19 @@ struct _NASelectedInfoPrivate {
static GObjectClass *st_parent_class = NULL;
static GType register_type( void );
-static void class_init( NASelectedInfoClass *klass );
+static void class_init( FMASelectedInfoClass *klass );
static void instance_init( GTypeInstance *instance, gpointer klass );
static void instance_dispose( GObject *object );
static void instance_finalize( GObject *object );
-static void dump( const NASelectedInfo *nsi );
+static void dump( const FMASelectedInfo *nsi );
static const char *dump_file_type( GFileType type );
-static NASelectedInfo *new_from_nautilus_file_info( NautilusFileInfo *item );
-static NASelectedInfo *new_from_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg );
-static void query_file_attributes( NASelectedInfo *info, GFile *location, gchar **errmsg );
+static FMASelectedInfo *new_from_nautilus_file_info( NautilusFileInfo *item );
+static FMASelectedInfo *new_from_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg );
+static void query_file_attributes( FMASelectedInfo *info, GFile *location, gchar **errmsg );
GType
-na_selected_info_get_type( void )
+fma_selected_info_get_type( void )
{
static GType object_type = 0;
@@ -94,32 +94,32 @@ na_selected_info_get_type( void )
static GType
register_type( void )
{
- static const gchar *thisfn = "na_selected_info_register_type";
+ static const gchar *thisfn = "fma_selected_info_register_type";
GType type;
static GTypeInfo info = {
- sizeof( NASelectedInfoClass ),
+ sizeof( FMASelectedInfoClass ),
( GBaseInitFunc ) NULL,
( GBaseFinalizeFunc ) NULL,
( GClassInitFunc ) class_init,
NULL,
NULL,
- sizeof( NASelectedInfo ),
+ sizeof( FMASelectedInfo ),
0,
( GInstanceInitFunc ) instance_init
};
g_debug( "%s", thisfn );
- type = g_type_register_static( G_TYPE_OBJECT, "NASelectedInfo", &info, 0 );
+ type = g_type_register_static( G_TYPE_OBJECT, "FMASelectedInfo", &info, 0 );
return( type );
}
static void
-class_init( NASelectedInfoClass *klass )
+class_init( FMASelectedInfoClass *klass )
{
- static const gchar *thisfn = "na_selected_info_class_init";
+ static const gchar *thisfn = "fma_selected_info_class_init";
GObjectClass *object_class;
g_debug( "%s: klass=%p", thisfn, ( void * ) klass );
@@ -130,23 +130,23 @@ class_init( NASelectedInfoClass *klass )
object_class->dispose = instance_dispose;
object_class->finalize = instance_finalize;
- klass->private = g_new0( NASelectedInfoClassPrivate, 1 );
+ klass->private = g_new0( FMASelectedInfoClassPrivate, 1 );
}
static void
instance_init( GTypeInstance *instance, gpointer klass )
{
- static const gchar *thisfn = "na_selected_info_instance_init";
- NASelectedInfo *self;
+ static const gchar *thisfn = "fma_selected_info_instance_init";
+ FMASelectedInfo *self;
- g_return_if_fail( NA_IS_SELECTED_INFO( instance ));
+ g_return_if_fail( FMA_IS_SELECTED_INFO( instance ));
g_debug( "%s: instance=%p (%s), klass=%p",
thisfn, ( void * ) instance, G_OBJECT_TYPE_NAME( instance ), ( void * ) klass );
- self = NA_SELECTED_INFO( instance );
+ self = FMA_SELECTED_INFO( instance );
- self->private = g_new0( NASelectedInfoPrivate, 1 );
+ self->private = g_new0( FMASelectedInfoPrivate, 1 );
self->private->dispose_has_run = FALSE;
self->private->uri = NULL;
@@ -155,11 +155,11 @@ instance_init( GTypeInstance *instance, gpointer klass )
static void
instance_dispose( GObject *object )
{
- static const gchar *thisfn = "na_selected_info_instance_dispose";
- NASelectedInfo *self;
+ static const gchar *thisfn = "fma_selected_info_instance_dispose";
+ FMASelectedInfo *self;
- g_return_if_fail( NA_IS_SELECTED_INFO( object ));
- self = NA_SELECTED_INFO( object );
+ g_return_if_fail( FMA_IS_SELECTED_INFO( object ));
+ self = FMA_SELECTED_INFO( object );
if( !self->private->dispose_has_run ){
g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ));
@@ -176,12 +176,12 @@ instance_dispose( GObject *object )
static void
instance_finalize( GObject *object )
{
- static const gchar *thisfn = "na_selected_info_instance_finalize";
- NASelectedInfo *self;
+ static const gchar *thisfn = "fma_selected_info_instance_finalize";
+ FMASelectedInfo *self;
- g_return_if_fail( NA_IS_SELECTED_INFO( object ));
+ g_return_if_fail( FMA_IS_SELECTED_INFO( object ));
- self = NA_SELECTED_INFO( object );
+ self = FMA_SELECTED_INFO( object );
g_debug( "%s: object=%p (%s)", thisfn, ( void * ) object, G_OBJECT_TYPE_NAME( object ));
@@ -204,19 +204,19 @@ instance_finalize( GObject *object )
}
/*
- * na_selected_info_get_list_from_item:
+ * fma_selected_info_get_list_from_item:
* @item: a #NautilusFileInfo item
*
- * Returns: a #GList list which contains a #NASelectedInfo item with the
+ * Returns: a #GList list which contains a #FMASelectedInfo item with the
* same URI that the @item.
*/
GList *
-na_selected_info_get_list_from_item( NautilusFileInfo *item )
+fma_selected_info_get_list_from_item( NautilusFileInfo *item )
{
GList *selected;
selected = NULL;
- NASelectedInfo *info = new_from_nautilus_file_info( item );
+ FMASelectedInfo *info = new_from_nautilus_file_info( item );
if( info ){
selected = g_list_prepend( NULL, info );
@@ -226,14 +226,14 @@ na_selected_info_get_list_from_item( NautilusFileInfo *item )
}
/*
- * na_selected_info_get_list_from_list:
+ * fma_selected_info_get_list_from_list:
* @nautilus_selection: a #GList list of #NautilusFileInfo items.
*
- * Returns: a #GList list of #NASelectedInfo items whose URI correspond
+ * Returns: a #GList list of #FMASelectedInfo items whose URI correspond
* to those of @nautilus_selection.
*/
GList *
-na_selected_info_get_list_from_list( GList *nautilus_selection )
+fma_selected_info_get_list_from_list( GList *nautilus_selection )
{
GList *selected;
GList *it;
@@ -241,7 +241,7 @@ na_selected_info_get_list_from_list( GList *nautilus_selection )
selected = NULL;
for( it = nautilus_selection ; it ; it = it->next ){
- NASelectedInfo *info = new_from_nautilus_file_info( NAUTILUS_FILE_INFO( it->data ));
+ FMASelectedInfo *info = new_from_nautilus_file_info( NAUTILUS_FILE_INFO( it->data ));
if( info ){
selected = g_list_prepend( selected, info );
@@ -252,13 +252,13 @@ na_selected_info_get_list_from_list( GList *nautilus_selection )
}
/*
- * na_selected_info_copy_list:
- * @files: a #GList list of #NASelectedInfo items.
+ * fma_selected_info_copy_list:
+ * @files: a #GList list of #FMASelectedInfo items.
*
* Returns: a copy of the provided @files list.
*/
GList *
-na_selected_info_copy_list( GList *files )
+fma_selected_info_copy_list( GList *files )
{
GList *copy;
GList *l;
@@ -273,32 +273,32 @@ na_selected_info_copy_list( GList *files )
}
/*
- * na_selected_info_free_list:
- * @files: a #GList of #NASelectedInfo items.
+ * fma_selected_info_free_list:
+ * @files: a #GList of #FMASelectedInfo items.
*
* Frees up the #GList @files.
*/
void
-na_selected_info_free_list( GList *files )
+fma_selected_info_free_list( GList *files )
{
g_list_foreach( files, ( GFunc ) g_object_unref, NULL );
g_list_free( files );
}
/*
- * na_selected_info_get_basename:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_get_basename:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: the basename of the file associated with this
- * #NASelectedInfo object, as a newly allocated string which
+ * #FMASelectedInfo object, as a newly allocated string which
* must be g_free() by the caller.
*/
gchar *
-na_selected_info_get_basename( const NASelectedInfo *nsi )
+fma_selected_info_get_basename( const FMASelectedInfo *nsi )
{
gchar *basename;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), NULL );
basename = NULL;
@@ -311,19 +311,19 @@ na_selected_info_get_basename( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_get_dirname:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_get_dirname:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: the dirname of the file associated with this
- * #NASelectedInfo object, as a newly allocated string which
+ * #FMASelectedInfo object, as a newly allocated string which
* must be g_free() by the caller.
*/
gchar *
-na_selected_info_get_dirname( const NASelectedInfo *nsi )
+fma_selected_info_get_dirname( const FMASelectedInfo *nsi )
{
gchar *dirname;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), NULL );
dirname = NULL;
@@ -336,18 +336,18 @@ na_selected_info_get_dirname( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_get_mime_type:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_get_mime_type:
+ * @nsi: this #FMASelectedInfo object.
*
- * Returns: the mime type associated with this #NASelectedInfo object,
+ * Returns: the mime type associated with this #FMASelectedInfo object,
* as a newly allocated string which should be g_free() by the caller.
*/
gchar *
-na_selected_info_get_mime_type( const NASelectedInfo *nsi )
+fma_selected_info_get_mime_type( const FMASelectedInfo *nsi )
{
gchar *mimetype;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), NULL );
mimetype = NULL;
@@ -362,18 +362,18 @@ na_selected_info_get_mime_type( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_get_path:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_get_path:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: the filename of the item as a newly allocated string which
* should be g_free() by the caller.
*/
gchar *
-na_selected_info_get_path( const NASelectedInfo *nsi )
+fma_selected_info_get_path( const FMASelectedInfo *nsi )
{
gchar *path;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), NULL );
path = NULL;
@@ -386,18 +386,18 @@ na_selected_info_get_path( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_get_uri:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_get_uri:
+ * @nsi: this #FMASelectedInfo object.
*
- * Returns: the URI associated with this #NASelectedInfo object, as a
+ * Returns: the URI associated with this #FMASelectedInfo object, as a
* newly allocated string which should be g_free() by the caller.
*/
gchar *
-na_selected_info_get_uri( const NASelectedInfo *nsi )
+fma_selected_info_get_uri( const FMASelectedInfo *nsi )
{
gchar *uri;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), NULL );
uri = NULL;
@@ -410,18 +410,18 @@ na_selected_info_get_uri( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_get_uri_host:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_get_uri_host:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: the host associated to this @nsi object, as a
* newly allocated string which should be g_free() by the caller.
*/
gchar *
-na_selected_info_get_uri_host( const NASelectedInfo *nsi )
+fma_selected_info_get_uri_host( const FMASelectedInfo *nsi )
{
gchar *host;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), NULL );
host = NULL;
@@ -434,18 +434,18 @@ na_selected_info_get_uri_host( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_get_uri_user:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_get_uri_user:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: the user associated to this @nsi object, as a
* newly allocated string which should be g_free() by the caller.
*/
gchar *
-na_selected_info_get_uri_user( const NASelectedInfo *nsi )
+fma_selected_info_get_uri_user( const FMASelectedInfo *nsi )
{
gchar *user;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), NULL );
user = NULL;
@@ -458,17 +458,17 @@ na_selected_info_get_uri_user( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_get_uri_port:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_get_uri_port:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: the port associated to this @nsi object.
*/
guint
-na_selected_info_get_uri_port( const NASelectedInfo *nsi )
+fma_selected_info_get_uri_port( const FMASelectedInfo *nsi )
{
guint port;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), 0 );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), 0 );
port = 0;
@@ -481,18 +481,18 @@ na_selected_info_get_uri_port( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_get_uri_scheme:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_get_uri_scheme:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: the scheme associated to this @nsi object, as a
* newly allocated string which should be g_free() by the caller.
*/
gchar *
-na_selected_info_get_uri_scheme( const NASelectedInfo *nsi )
+fma_selected_info_get_uri_scheme( const FMASelectedInfo *nsi )
{
gchar *scheme;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), NULL );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), NULL );
scheme = NULL;
@@ -505,17 +505,17 @@ na_selected_info_get_uri_scheme( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_is_directory:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_is_directory:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: %TRUE if the item is a directory, %FALSE else.
*/
gboolean
-na_selected_info_is_directory( const NASelectedInfo *nsi )
+fma_selected_info_is_directory( const FMASelectedInfo *nsi )
{
gboolean is_dir;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), FALSE );
is_dir = FALSE;
@@ -528,17 +528,17 @@ na_selected_info_is_directory( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_is_regular:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_is_regular:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: %TRUE if the item is a regular file, %FALSE else.
*/
gboolean
-na_selected_info_is_regular( const NASelectedInfo *nsi )
+fma_selected_info_is_regular( const FMASelectedInfo *nsi )
{
gboolean is_regular;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), FALSE );
is_regular = FALSE;
@@ -551,17 +551,17 @@ na_selected_info_is_regular( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_is_executable:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_is_executable:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: %TRUE if the item is executable by the user, %FALSE else.
*/
gboolean
-na_selected_info_is_executable( const NASelectedInfo *nsi )
+fma_selected_info_is_executable( const FMASelectedInfo *nsi )
{
gboolean is_exe;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), FALSE );
is_exe = FALSE;
@@ -574,24 +574,24 @@ na_selected_info_is_executable( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_is_local:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_is_local:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: %TRUE if the item is on a local filesystem, %FALSE else.
*/
gboolean
-na_selected_info_is_local( const NASelectedInfo *nsi )
+fma_selected_info_is_local( const FMASelectedInfo *nsi )
{
gboolean is_local;
gchar *scheme;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), FALSE );
is_local = FALSE;
if( !nsi->private->dispose_has_run ){
- scheme = na_selected_info_get_uri_scheme( nsi );
+ scheme = fma_selected_info_get_uri_scheme( nsi );
is_local = ( strcmp( scheme, "file" ) == 0 );
g_free( scheme );
}
@@ -600,18 +600,18 @@ na_selected_info_is_local( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_is_owner:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_is_owner:
+ * @nsi: this #FMASelectedInfo object.
* @user: the user to be tested against the owner of the @nsi object.
*
* Returns: %TRUE if the item is a owner, %FALSE else.
*/
gboolean
-na_selected_info_is_owner( const NASelectedInfo *nsi, const gchar *user )
+fma_selected_info_is_owner( const FMASelectedInfo *nsi, const gchar *user )
{
gboolean is_owner;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), FALSE );
is_owner = FALSE;
@@ -624,17 +624,17 @@ na_selected_info_is_owner( const NASelectedInfo *nsi, const gchar *user )
}
/*
- * na_selected_info_is_readable:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_is_readable:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: %TRUE if the item is a readable, %FALSE else.
*/
gboolean
-na_selected_info_is_readable( const NASelectedInfo *nsi )
+fma_selected_info_is_readable( const FMASelectedInfo *nsi )
{
gboolean is_readable;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), FALSE );
is_readable = FALSE;
@@ -647,17 +647,17 @@ na_selected_info_is_readable( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_is_writable:
- * @nsi: this #NASelectedInfo object.
+ * fma_selected_info_is_writable:
+ * @nsi: this #FMASelectedInfo object.
*
* Returns: %TRUE if the item is a writable, %FALSE else.
*/
gboolean
-na_selected_info_is_writable( const NASelectedInfo *nsi )
+fma_selected_info_is_writable( const FMASelectedInfo *nsi )
{
gboolean is_writable;
- g_return_val_if_fail( NA_IS_SELECTED_INFO( nsi ), FALSE );
+ g_return_val_if_fail( FMA_IS_SELECTED_INFO( nsi ), FALSE );
is_writable = FALSE;
@@ -670,30 +670,30 @@ na_selected_info_is_writable( const NASelectedInfo *nsi )
}
/*
- * na_selected_info_create_for_uri:
+ * fma_selected_info_create_for_uri:
* @uri: an URI.
* @mimetype: the corresponding Nautilus mime type, or %NULL.
* @errmsg: a pointer to a string which will contain an error message on
* return.
*
- * Returns: a newly allocated #NASelectedInfo object for the given @uri.
+ * Returns: a newly allocated #FMASelectedInfo object for the given @uri.
*/
-NASelectedInfo *
-na_selected_info_create_for_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg )
+FMASelectedInfo *
+fma_selected_info_create_for_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg )
{
- static const gchar *thisfn = "na_selected_info_create_for_uri";
+ static const gchar *thisfn = "fma_selected_info_create_for_uri";
g_debug( "%s: uri=%s, mimetype=%s", thisfn, uri, mimetype );
- NASelectedInfo *obj = new_from_uri( uri, mimetype, errmsg );
+ FMASelectedInfo *obj = new_from_uri( uri, mimetype, errmsg );
return( obj );
}
static void
-dump( const NASelectedInfo *nsi )
+dump( const FMASelectedInfo *nsi )
{
- static const gchar *thisfn = "na_selected_info_dump";
+ static const gchar *thisfn = "fma_selected_info_dump";
g_debug( "%s: uri=%s", thisfn, nsi->private->uri );
g_debug( "%s: mimetype=%s", thisfn, nsi->private->mimetype );
@@ -734,12 +734,12 @@ dump_file_type( GFileType type )
return( "unknown" );
}
-static NASelectedInfo *
+static FMASelectedInfo *
new_from_nautilus_file_info( NautilusFileInfo *item )
{
gchar *uri = nautilus_file_info_get_uri( item );
gchar *mimetype = nautilus_file_info_get_mime_type( item );
- NASelectedInfo *info = new_from_uri( uri, mimetype, NULL );
+ FMASelectedInfo *info = new_from_uri( uri, mimetype, NULL );
g_free( mimetype );
g_free( uri );
@@ -803,13 +803,13 @@ new_from_nautilus_file_info( NautilusFileInfo *item )
*
* As a result, we may have valid, non-escaped, simple quotes in an URI.
*/
-static NASelectedInfo *
+static FMASelectedInfo *
new_from_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg )
{
GFile *location;
FMAGnomeVFSURI *vfs;
- NASelectedInfo *info = g_object_new( NA_TYPE_SELECTED_INFO, NULL );
+ FMASelectedInfo *info = g_object_new( FMA_TYPE_SELECTED_INFO, NULL );
info->private->uri = g_strdup( uri );
if( mimetype ){
@@ -828,7 +828,7 @@ new_from_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg )
vfs = g_new0( FMAGnomeVFSURI, 1 );
fma_gnome_vfs_uri_parse( vfs, uri );
if( !info->private->filename ){
- g_debug( "na_selected_info_new_from_uri: uri='%s', filename=NULL, setting it to '%s'", uri,
vfs->path );
+ g_debug( "fma_selected_info_new_from_uri: uri='%s', filename=NULL, setting it to '%s'", uri,
vfs->path );
info->private->filename = g_strdup( vfs->path );
}
@@ -849,9 +849,9 @@ new_from_uri( const gchar *uri, const gchar *mimetype, gchar **errmsg )
}
static void
-query_file_attributes( NASelectedInfo *nsi, GFile *location, gchar **errmsg )
+query_file_attributes( FMASelectedInfo *nsi, GFile *location, gchar **errmsg )
{
- static const gchar *thisfn = "na_selected_info_query_file_attributes";
+ static const gchar *thisfn = "fma_selected_info_query_file_attributes";
GError *error;
error = NULL;
diff --git a/src/core/fma-selected-info.h b/src/core/fma-selected-info.h
new file mode 100644
index 0000000..dc6fda2
--- /dev/null
+++ b/src/core/fma-selected-info.h
@@ -0,0 +1,103 @@
+/*
+ * FileManager-Actions
+ * A file-manager extension which offers configurable context menu selected_infos.
+ *
+ * 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 __CORE_FMA_SELECTED_INFO_H__
+#define __CORE_FMA_SELECTED_INFO_H__
+
+/* @title: FMASelectedInfo
+ * @short_description: The #FMASelectedInfo Class Definition
+ * @include: core/fma-selected-info.h
+ *
+ * An object is instantiated for each Nautilus selected item, in order
+ * to gather some common properties for the selected item, mainly its
+ * mime type for example.
+ *
+ * This class should be replaced by NautilusFileInfo class, as soon as
+ * the required Nautilus version will have the
+ * nautilus_file_info_create_for_uri() API (after 2.28)
+ */
+
+#include <libnautilus-extension/nautilus-file-info.h>
+
+G_BEGIN_DECLS
+
+#define FMA_TYPE_SELECTED_INFO ( fma_selected_info_get_type())
+#define FMA_SELECTED_INFO( object ) ( G_TYPE_CHECK_INSTANCE_CAST( object, FMA_TYPE_SELECTED_INFO,
FMASelectedInfo ))
+#define FMA_SELECTED_INFO_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( klass, FMA_TYPE_SELECTED_INFO,
FMASelectedInfoClass ))
+#define FMA_IS_SELECTED_INFO( object ) ( G_TYPE_CHECK_INSTANCE_TYPE( object, FMA_TYPE_SELECTED_INFO ))
+#define FMA_IS_SELECTED_INFO_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE(( klass ), FMA_TYPE_SELECTED_INFO ))
+#define FMA_SELECTED_INFO_GET_CLASS( object ) ( G_TYPE_INSTANCE_GET_CLASS(( object ),
FMA_TYPE_SELECTED_INFO, FMASelectedInfoClass ))
+
+typedef struct _FMASelectedInfoPrivate FMASelectedInfoPrivate;
+
+typedef struct {
+ /*< private >*/
+ GObject parent;
+ FMASelectedInfoPrivate *private;
+}
+ FMASelectedInfo;
+
+typedef struct _FMASelectedInfoClassPrivate FMASelectedInfoClassPrivate;
+
+typedef struct {
+ /*< private >*/
+ GObjectClass parent;
+ FMASelectedInfoClassPrivate *private;
+}
+ FMASelectedInfoClass;
+
+GType fma_selected_info_get_type ( void );
+
+GList *fma_selected_info_get_list_from_item( NautilusFileInfo *item );
+GList *fma_selected_info_get_list_from_list( GList *nautilus_selection );
+GList *fma_selected_info_copy_list ( GList *files );
+void fma_selected_info_free_list ( GList *files );
+
+gchar *fma_selected_info_get_basename ( const FMASelectedInfo *nsi );
+gchar *fma_selected_info_get_dirname ( const FMASelectedInfo *nsi );
+gchar *fma_selected_info_get_mime_type ( const FMASelectedInfo *nsi );
+gchar *fma_selected_info_get_path ( const FMASelectedInfo *nsi );
+gchar *fma_selected_info_get_uri ( const FMASelectedInfo *nsi );
+gchar *fma_selected_info_get_uri_host ( const FMASelectedInfo *nsi );
+gchar *fma_selected_info_get_uri_user ( const FMASelectedInfo *nsi );
+guint fma_selected_info_get_uri_port ( const FMASelectedInfo *nsi );
+gchar *fma_selected_info_get_uri_scheme ( const FMASelectedInfo *nsi );
+gboolean fma_selected_info_is_directory ( const FMASelectedInfo *nsi );
+gboolean fma_selected_info_is_regular ( const FMASelectedInfo *nsi );
+gboolean fma_selected_info_is_executable ( const FMASelectedInfo *nsi );
+gboolean fma_selected_info_is_local ( const FMASelectedInfo *nsi );
+gboolean fma_selected_info_is_owner ( const FMASelectedInfo *nsi, const gchar *user );
+gboolean fma_selected_info_is_readable ( const FMASelectedInfo *nsi );
+gboolean fma_selected_info_is_writable ( const FMASelectedInfo *nsi );
+
+FMASelectedInfo *fma_selected_info_create_for_uri ( const gchar *uri, const gchar *mimetype, gchar
**errmsg );
+
+G_END_DECLS
+
+#endif /* __CORE_FMA_SELECTED_INFO_H__ */
diff --git a/src/core/na-tokens.c b/src/core/na-tokens.c
index 014c8e7..e811426 100644
--- a/src/core/na-tokens.c
+++ b/src/core/na-tokens.c
@@ -40,7 +40,7 @@
#include <api/fma-object-api.h>
#include "fma-gnome-vfs-uri.h"
-#include "na-selected-info.h"
+#include "fma-selected-info.h"
#include "na-settings.h"
#include "na-tokens.h"
@@ -302,7 +302,7 @@ na_tokens_new_for_example( void )
/*
* na_tokens_new_from_selection:
- * @selection: a #GList list of #NASelectedInfo objects.
+ * @selection: a #GList list of #FMASelectedInfo objects.
*
* Returns: a new #NATokens object which holds all possible tokens.
*/
@@ -323,19 +323,19 @@ na_tokens_new_from_selection( GList *selection )
tokens->private->count = g_list_length( selection );
for( it = selection ; it ; it = it->next ){
- mimetype = na_selected_info_get_mime_type( NA_SELECTED_INFO( it->data ));
+ mimetype = fma_selected_info_get_mime_type( FMA_SELECTED_INFO( it->data ));
- uri = na_selected_info_get_uri( NA_SELECTED_INFO( it->data ));
- filename = na_selected_info_get_path( NA_SELECTED_INFO( it->data ));
- basedir = na_selected_info_get_dirname( NA_SELECTED_INFO( it->data ));
- basename = na_selected_info_get_basename( NA_SELECTED_INFO( it->data ));
+ uri = fma_selected_info_get_uri( FMA_SELECTED_INFO( it->data ));
+ filename = fma_selected_info_get_path( FMA_SELECTED_INFO( it->data ));
+ basedir = fma_selected_info_get_dirname( FMA_SELECTED_INFO( it->data ));
+ basename = fma_selected_info_get_basename( FMA_SELECTED_INFO( it->data ));
fma_core_utils_dir_split_ext( basename, &bname_woext, &ext );
if( first ){
- tokens->private->hostname = na_selected_info_get_uri_host( NA_SELECTED_INFO( it->data
));
- tokens->private->username = na_selected_info_get_uri_user( NA_SELECTED_INFO( it->data
));
- tokens->private->port = na_selected_info_get_uri_port( NA_SELECTED_INFO( it->data ));
- tokens->private->scheme = na_selected_info_get_uri_scheme( NA_SELECTED_INFO( it->data
));
+ tokens->private->hostname = fma_selected_info_get_uri_host( FMA_SELECTED_INFO(
it->data ));
+ tokens->private->username = fma_selected_info_get_uri_user( FMA_SELECTED_INFO(
it->data ));
+ tokens->private->port = fma_selected_info_get_uri_port( FMA_SELECTED_INFO( it->data
));
+ tokens->private->scheme = fma_selected_info_get_uri_scheme( FMA_SELECTED_INFO(
it->data ));
first = FALSE;
}
diff --git a/src/plugin-menu/nautilus-actions.c b/src/plugin-menu/nautilus-actions.c
index de578af..248c1a5 100644
--- a/src/plugin-menu/nautilus-actions.c
+++ b/src/plugin-menu/nautilus-actions.c
@@ -45,7 +45,7 @@
#include <core/fma-pivot.h>
#include <core/fma-about.h>
-#include <core/na-selected-info.h>
+#include <core/fma-selected-info.h>
#include <core/na-tokens.h>
#include "nautilus-actions.h"
@@ -335,7 +335,7 @@ menu_provider_iface_init( NautilusMenuProviderIface *iface )
* - or when there is only one selected directory
*
* Note that 'x-nautilus-desktop:///' cannot be interpreted by
- * #NASelectedInfo::query_file_attributes() function. It so never participate
+ * #FMASelectedInfo::query_file_attributes() function. It so never participate
* to the display of actions.
*/
static GList *
@@ -350,7 +350,7 @@ menu_provider_get_background_items( NautilusMenuProvider *provider, GtkWidget *w
if( !NAUTILUS_ACTIONS( provider )->private->dispose_has_run ){
- selected = na_selected_info_get_list_from_item( current_folder );
+ selected = fma_selected_info_get_list_from_item( current_folder );
if( selected ){
uri = nautilus_file_info_get_uri( current_folder );
@@ -366,7 +366,7 @@ menu_provider_get_background_items( NautilusMenuProvider *provider, GtkWidget *w
ITEM_TARGET_LOCATION,
selected );
- na_selected_info_free_list( selected );
+ fma_selected_info_free_list( selected );
}
}
@@ -395,7 +395,7 @@ menu_provider_get_file_items( NautilusMenuProvider *provider, GtkWidget *window,
return(( GList * ) NULL );
}
- selected = na_selected_info_get_list_from_list(( GList * ) files );
+ selected = fma_selected_info_get_list_from_list(( GList * ) files );
if( selected ){
g_debug( "%s: provider=%p, window=%p, files=%p, count=%d",
@@ -420,7 +420,7 @@ menu_provider_get_file_items( NautilusMenuProvider *provider, GtkWidget *window,
ITEM_TARGET_SELECTION,
selected );
- na_selected_info_free_list( selected );
+ fma_selected_info_free_list( selected );
}
}
@@ -447,7 +447,7 @@ menu_provider_get_toolbar_items( NautilusMenuProvider *provider, GtkWidget *wind
if( !NAUTILUS_ACTIONS( provider )->private->dispose_has_run ){
- selected = na_selected_info_get_list_from_item( current_folder );
+ selected = fma_selected_info_get_list_from_item( current_folder );
if( selected ){
uri = nautilus_file_info_get_uri( current_folder );
@@ -463,7 +463,7 @@ menu_provider_get_toolbar_items( NautilusMenuProvider *provider, GtkWidget *wind
ITEM_TARGET_TOOLBAR,
selected );
- na_selected_info_free_list( selected );
+ fma_selected_info_free_list( selected );
}
}
@@ -475,10 +475,10 @@ menu_provider_get_toolbar_items( NautilusMenuProvider *provider, GtkWidget *wind
* build_nautilus_menu:
* @target: whether the menu targets a location (a folder) or a selection
* (the list of currently selected items in the file manager)
- * @selection: a list of NASelectedInfo, with:
+ * @selection: a list of FMASelectedInfo, with:
* - only one item if a location
* - one item by selected file manager item, if a selection.
- * Note: a NASelectedInfo is just a sort of NautilusFileInfo, with
+ * Note: a FMASelectedInfo is just a sort of NautilusFileInfo, with
* some added APIs.
*
* Build the Nautilus menu as a list of NautilusMenuItem items
diff --git a/src/utils/nautilus-actions-run.c b/src/utils/nautilus-actions-run.c
index 84ac9db..b9bbc75 100644
--- a/src/utils/nautilus-actions-run.c
+++ b/src/utils/nautilus-actions-run.c
@@ -43,7 +43,7 @@
#include <core/fma-gconf-migration.h>
#include <core/fma-pivot.h>
-#include <core/na-selected-info.h>
+#include <core/fma-selected-info.h>
#include <core/na-tokens.h>
#include "console-utils.h"
@@ -174,7 +174,7 @@ main( int argc, char** argv )
execute_action( action, profile, targets );
- na_selected_info_free_list( targets );
+ fma_selected_info_free_list( targets );
exit( status );
}
@@ -256,7 +256,7 @@ get_action( const gchar *id )
* where each selected item brings up both its URI and its Nautilus
* mime type.
*
- * We return to the caller a GList of NASelectedInfo objects
+ * We return to the caller a GList of FMASelectedInfo objects
*/
static GList *
targets_from_selection( void )
@@ -328,7 +328,7 @@ targets_from_selection( void )
/*
* get targets from command-line
*
- * We return to the caller a GList of NASelectedInfo objects.
+ * We return to the caller a GList of FMASelectedInfo objects.
*/
static GList *
targets_from_commandline( void )
@@ -362,7 +362,7 @@ get_selection_from_strv( const gchar **strv, gboolean has_mimetype )
}
errmsg = NULL;
- NASelectedInfo *nsi = na_selected_info_create_for_uri( uri, mimetype, &errmsg );
+ FMASelectedInfo *nsi = fma_selected_info_create_for_uri( uri, mimetype, &errmsg );
if( errmsg ){
g_printerr( "%s\n", errmsg );
@@ -420,9 +420,9 @@ dump_targets( GList *targets )
gchar *uri, *mimetype;
for( it = targets ; it ; it = it->next ){
- NASelectedInfo *nsi = NA_SELECTED_INFO( it->data );
- uri = na_selected_info_get_uri( nsi );
- mimetype = na_selected_info_get_mime_type( nsi );
+ FMASelectedInfo *nsi = FMA_SELECTED_INFO( it->data );
+ uri = fma_selected_info_get_uri( nsi );
+ mimetype = fma_selected_info_get_mime_type( nsi );
g_print( "%s\t[%s]\n", uri, mimetype );
g_free( mimetype );
g_free( uri );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]