[nautilus-actions] Refactoring: rename src/io-desktop/nadp-xdg-data-dirs.{c, h} to src/io-desktop/nadp-xdg-dirs.{c, h}
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Refactoring: rename src/io-desktop/nadp-xdg-data-dirs.{c, h} to src/io-desktop/nadp-xdg-dirs.{c, h}
- Date: Fri, 19 Feb 2010 02:24:58 +0000 (UTC)
commit 9894eda775b6c613e469f49ddeb889c9b427e96d
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Feb 15 18:16:57 2010 +0100
Refactoring: rename src/io-desktop/nadp-xdg-data-dirs.{c,h} to src/io-desktop/nadp-xdg-dirs.{c,h}
ChangeLog | 1 +
src/io-desktop/Makefile.am | 4 +-
.../{nadp-xdg-data-dirs.c => nadp-xdg-dirs.c} | 54 ++++++--------------
.../{nadp-xdg-data-dirs.h => nadp-xdg-dirs.h} | 14 +++---
4 files changed, 26 insertions(+), 47 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fd6e5e3..e83a37e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
2009-02-15 Pierre Wieser <pwieser trychlos org>
+ Rename src/io-desktop/nadp-xdg-data-dirs.{c,h} to src/io-desktop/nadp-xdg-dirs.{c,h}
Rename src/io-desktop/nadp-write.{c,h} to src/io-desktop/nadp-writer.{c,h}
Rename src/io-desktop/nadp-read.{c,h} to src/io-desktop/nadp-reader.{c,h}
diff --git a/src/io-desktop/Makefile.am b/src/io-desktop/Makefile.am
index 120e843..308f133 100644
--- a/src/io-desktop/Makefile.am
+++ b/src/io-desktop/Makefile.am
@@ -46,8 +46,8 @@ libna_io_desktop_la_SOURCES = \
nadp-utils.h \
nadp-writer.c \
nadp-writer.h \
- nadp-xdg-data-dirs.c \
- nadp-xdg-data-dirs.h \
+ nadp-xdg-dirs.c \
+ nadp-xdg-dirs.h \
$(NULL)
libna_io_desktop_la_LIBADD = \
diff --git a/src/io-desktop/nadp-xdg-data-dirs.c b/src/io-desktop/nadp-xdg-dirs.c
similarity index 61%
rename from src/io-desktop/nadp-xdg-data-dirs.c
rename to src/io-desktop/nadp-xdg-dirs.c
index 62f4997..a1e0275 100644
--- a/src/io-desktop/nadp-xdg-data-dirs.c
+++ b/src/io-desktop/nadp-xdg-dirs.c
@@ -32,13 +32,12 @@
#include <config.h>
#endif
-#include "nadp-desktop-provider.h"
-#include "nadp-xdg-data-dirs.h"
+#include <api/na-core-utils.h>
+
+#include "nadp-xdg-dirs.h"
/**
- * nadp_xdg_data_dirs_get_dirs:
- * @provider: this #NadpDesktopProvider instance.
- * @messages: error messages go here.
+ * nadp_xdg_dirs_get_data_dirs:
*
* Returns: the ordered list of data directories, most important first,
* as a GSList of newly allocated strings.
@@ -47,25 +46,23 @@
* freed by the caller.
*/
GSList *
-nadp_xdg_data_dirs_get_dirs( const NadpDesktopProvider *provider, GSList **messages )
+nadp_xdg_dirs_get_data_dirs( void )
{
GSList *listdirs;
gchar *userdir;
GSList *datadirs;
- userdir = nadp_xdg_data_dirs_get_user_dir( provider, messages );
+ userdir = nadp_xdg_dirs_get_user_data_dir();
listdirs = g_slist_prepend( NULL, userdir );
- datadirs = nadp_xdg_data_dirs_get_data_dirs( provider, messages );
+ datadirs = nadp_xdg_dirs_get_system_data_dirs();
listdirs = g_slist_concat( listdirs, datadirs );
return( listdirs );
}
/**
- * nadp_xdg_data_dirs_get_user_dir:
- * @provider: this #NadpDesktopProvider instance.
- * @messages: error messages go here.
+ * nadp_xdg_dirs_get_user_data_dir:
*
* Returns: the path to the single base directory relative to which
* user-specific data files should be written, as a newly allocated
@@ -73,28 +70,22 @@ nadp_xdg_data_dirs_get_dirs( const NadpDesktopProvider *provider, GSList **messa
*
* This directory is defined by the environment variable XDG_DATA_HOME.
* It defaults to ~/.local/share.
- *
- * source: http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
+ * cf. http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
*
* The returned string should be g_free() by the caller.
*/
gchar *
-nadp_xdg_data_dirs_get_user_dir( const NadpDesktopProvider *provider, GSList **messages )
+nadp_xdg_dirs_get_user_data_dir( void )
{
- /*static const gchar *thisfn = "nadp_xdg_data_dirs_get_user_dir";*/
gchar *dir;
dir = g_strdup( g_get_user_data_dir());
- /*g_debug( "%s: provider=%p, messages=%p, user_dir=%s", thisfn, ( void * ) provider, ( void * ) messages, dir );*/
-
return( dir );
}
/**
- * nadp_xdg_data_dirs_get_data_dirs:
- * @provider: this #NadpDesktopProvider instance.
- * @messages: error messages go here.
+ * nadp_xdg_dirs_get_system_data_dirs:
*
* Returns: the set of preference ordered base directories relative to
* which data files should be written, as a GSList of newly allocated
@@ -109,27 +100,14 @@ nadp_xdg_data_dirs_get_user_dir( const NadpDesktopProvider *provider, GSList **m
* by the caller.
*/
GSList *
-nadp_xdg_data_dirs_get_data_dirs( const NadpDesktopProvider *provider, GSList **messages )
+nadp_xdg_dirs_get_system_data_dirs( void )
{
- static const gchar *thisfn = "nadp_xdg_data_dirs_get_data_dirs";
- gchar **dirs;
- gchar **id;
- GSList *paths, *ip;
-
- paths = NULL;
- dirs = ( gchar ** ) g_get_system_data_dirs();
- id = dirs;
- while( *id ){
- paths = g_slist_prepend( paths, g_strdup( *id ));
- id++;
- }
+ const gchar **dirs;
+ GSList *paths;
- paths = g_slist_reverse( paths );
+ dirs = ( const gchar ** ) g_get_system_data_dirs();
- for( ip = paths ; ip ; ip = ip->next ){
- g_debug( "%s: provider=%p, messages=%p, data_dir=%s",
- thisfn, ( void * ) provider, ( void * ) messages, ( const gchar * ) ip->data );
- }
+ paths = na_core_utils_slist_from_str_array( dirs );
return( paths );
}
diff --git a/src/io-desktop/nadp-xdg-data-dirs.h b/src/io-desktop/nadp-xdg-dirs.h
similarity index 74%
rename from src/io-desktop/nadp-xdg-data-dirs.h
rename to src/io-desktop/nadp-xdg-dirs.h
index d7038fd..1960953 100644
--- a/src/io-desktop/nadp-xdg-data-dirs.h
+++ b/src/io-desktop/nadp-xdg-dirs.h
@@ -28,19 +28,19 @@
* ... and many others (see AUTHORS)
*/
-#include "nadp-desktop-provider.h"
+#ifndef __NADP_XDG_DIRS_H__
+#define __NADP_XDG_DIRS_H__
-#ifndef __NADP_XDG_DATA_DIRS_H__
-#define __NADP_XDG_DATA_DIRS_H__
+#include <glib.h>
G_BEGIN_DECLS
-GSList *nadp_xdg_data_dirs_get_dirs( const NadpDesktopProvider *provider, GSList **messages );
+GSList *nadp_xdg_dirs_get_data_dirs( void );
-gchar *nadp_xdg_data_dirs_get_user_dir( const NadpDesktopProvider *provider, GSList **messages );
+gchar *nadp_xdg_dirs_get_user_data_dir( void );
-GSList *nadp_xdg_data_dirs_get_data_dirs( const NadpDesktopProvider *provider, GSList **messages );
+GSList *nadp_xdg_dirs_get_system_data_dirs( void );
G_END_DECLS
-#endif /* __NADP_XDG_DATA_DIRS_H__ */
+#endif /* __NADP_XDG_DIRS_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]