[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9.0-88-gee346aa
Rémi Cardona
nobody at users.sourceforge.net
Sun Mar 20 23:50:54 CET 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".
The branch, master has been updated
via ee346aa52a5e60241f35e48ca53e99abcdff9992 (commit)
via 8ec2d6309842572149a67fc8c393f874373ed219 (commit)
via 9ace08f6b8372bca3a304258006ce679c581f599 (commit)
via 4a8a71fd92296c1f3ecae46c898bb1361e900b22 (commit)
via fb689a9097e58dff96159bc7558ff9ec24f47b3a (commit)
from d0967feba21182af82f9dae2907fe4d12e4bd6fc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ee346aa52a5e60241f35e48ca53e99abcdff9992
Author: Rémi Cardona <remi at gentoo.org>
Date: Sun Mar 20 23:39:49 2011 +0100
Replace C_DIRECTORY_SEPARATOR with glib's G_DIR_SEPARATOR_S
commit 8ec2d6309842572149a67fc8c393f874373ed219
Author: Rémi Cardona <remi at gentoo.org>
Date: Sun Mar 20 23:10:21 2011 +0100
Remove leading / from C_GRISBIRC()'s and C_OLD_GRISBIRC()'s output
commit 9ace08f6b8372bca3a304258006ce679c581f599
Author: Rémi Cardona <remi at gentoo.org>
Date: Sun Mar 20 23:18:47 2011 +0100
Rework new code in gsb_dirs.[ch]
commit 4a8a71fd92296c1f3ecae46c898bb1361e900b22
Author: Rémi Cardona <remi at gentoo.org>
Date: Fri Mar 18 00:13:49 2011 +0100
Move more dir/file path code to gsb_dirs.[ch]
No code change, just different locations.
commit fb689a9097e58dff96159bc7558ff9ec24f47b3a
Author: Rémi Cardona <remi at gentoo.org>
Date: Thu Mar 17 23:53:34 2011 +0100
Remove useless #include "structures.h"
-----------------------------------------------------------------------
Changes:
diff --git a/src/erreur.c b/src/erreur.c
index 340d543..689a658 100644
--- a/src/erreur.c
+++ b/src/erreur.c
@@ -35,17 +35,15 @@
/*START_INCLUDE*/
#include "erreur.h"
#include "dialog.h"
+#include "gsb_dirs.h"
#include "gsb_file_save.h"
#include "gsb_file_util.h"
-#include "gsb_file_config.h"
#include "gsb_plugins.h"
#include "gsb_real.h"
#include "gsb_status.h"
#include "import.h"
#include "main.h"
-#include "structures.h"
#include "utils.h"
-#include "utils_files.h"
#include "utils_str.h"
/*END_INCLUDE*/
diff --git a/src/file_obfuscate.c b/src/file_obfuscate.c
index 0396887..a9873ab 100644
--- a/src/file_obfuscate.c
+++ b/src/file_obfuscate.c
@@ -46,10 +46,10 @@
#include "gsb_data_report.h"
#include "gsb_data_scheduled.h"
#include "gsb_data_transaction.h"
+#include "gsb_dirs.h"
#include "gsb_file_save.h"
#include "gsb_file_util.h"
#include "gsb_status.h"
-#include "utils_files.h"
#include "utils.h"
/*END_INCLUDE*/
diff --git a/src/gsb_assistant_file.c b/src/gsb_assistant_file.c
index 6c31d8c..656d4cb 100644
--- a/src/gsb_assistant_file.c
+++ b/src/gsb_assistant_file.c
@@ -41,16 +41,15 @@
#include "gsb_category.h"
#include "gsb_currency_config.h"
#include "gsb_currency.h"
+#include "gsb_dirs.h"
#include "gsb_file.h"
#include "parametres.h"
#include "gsb_select_icon.h"
#include "import.h"
#include "traitement_variables.h"
-#include "utils_files.h"
#include "utils_str.h"
#include "utils.h"
#include "affichage.h"
-#include "structures.h"
#include "erreur.h"
/*END_INCLUDE*/
diff --git a/src/gsb_assistant_first.c b/src/gsb_assistant_first.c
index dd8f8ba..c41cdc6 100644
--- a/src/gsb_assistant_first.c
+++ b/src/gsb_assistant_first.c
@@ -39,6 +39,7 @@
#include "gsb_assistant_file.h"
#include "gsb_automem.h"
#include "parametres.h"
+#include "gsb_dirs.h"
#include "gsb_file.h"
#include "traitement_variables.h"
#include "dialog.h"
diff --git a/src/gsb_category.c b/src/gsb_category.c
index 2480f0f..1a61c96 100644
--- a/src/gsb_category.c
+++ b/src/gsb_category.c
@@ -306,20 +306,20 @@ GSList * gsb_category_assistant_scan_directory ( gchar * basename, GtkTreeModel
GDir * dir;
GSList * list = NULL;
- dirname = g_strconcat ( DATA_PATH, C_DIRECTORY_SEPARATOR, "categories", C_DIRECTORY_SEPARATOR, basename, NULL );
+ dirname = g_strconcat ( DATA_PATH, G_DIR_SEPARATOR_S, "categories", G_DIR_SEPARATOR_S, basename, NULL );
if ( ! g_file_test ( dirname, G_FILE_TEST_IS_DIR ) )
{
gchar * pos = strchr ( basename, '.' );
if ( pos )
*pos = '\0';
- dirname = g_strconcat ( DATA_PATH, C_DIRECTORY_SEPARATOR, "categories", C_DIRECTORY_SEPARATOR, basename, NULL );
+ dirname = g_strconcat ( DATA_PATH, G_DIR_SEPARATOR_S, "categories", G_DIR_SEPARATOR_S, basename, NULL );
}
if ( ! g_file_test ( dirname, G_FILE_TEST_IS_DIR ) )
{
gchar * pos = strchr ( basename, '_' );
if ( pos )
*pos = '\0';
- dirname = g_strconcat ( DATA_PATH, C_DIRECTORY_SEPARATOR, "categories", C_DIRECTORY_SEPARATOR, basename, NULL );
+ dirname = g_strconcat ( DATA_PATH, G_DIR_SEPARATOR_S, "categories", G_DIR_SEPARATOR_S, basename, NULL );
}
dir = g_dir_open ( dirname, 0, NULL );
diff --git a/src/gsb_currency.c b/src/gsb_currency.c
index 3ae2d15..272873c 100644
--- a/src/gsb_currency.c
+++ b/src/gsb_currency.c
@@ -325,8 +325,8 @@ gboolean gsb_currency_update_combobox_currency_list ( void )
gint currency_number;
currency_number = gsb_data_currency_get_no_currency (list_tmp -> data);
- string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), C_DIRECTORY_SEPARATOR,
- "flags", C_DIRECTORY_SEPARATOR,
+ string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), G_DIR_SEPARATOR_S,
+ "flags", G_DIR_SEPARATOR_S,
gsb_data_currency_get_code_iso4217 (currency_number),
".png", NULL );
pixbuf = gdk_pixbuf_new_from_file ( string, NULL );
@@ -1055,8 +1055,8 @@ GtkWidget *gsb_currency_make_combobox_exchange_dialog ( gint transaction_currenc
combobox_store = gtk_list_store_new ( 3, G_TYPE_INT, GDK_TYPE_PIXBUF,
G_TYPE_STRING);
- string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), C_DIRECTORY_SEPARATOR,
- "flags", C_DIRECTORY_SEPARATOR,
+ string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), G_DIR_SEPARATOR_S,
+ "flags", G_DIR_SEPARATOR_S,
gsb_data_currency_get_code_iso4217 (
transaction_currency_number ),
".png", NULL );
@@ -1070,8 +1070,8 @@ GtkWidget *gsb_currency_make_combobox_exchange_dialog ( gint transaction_currenc
2, gsb_data_currency_get_name ( transaction_currency_number ),
-1 );
- string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), C_DIRECTORY_SEPARATOR,
- "flags", C_DIRECTORY_SEPARATOR,
+ string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), G_DIR_SEPARATOR_S,
+ "flags", G_DIR_SEPARATOR_S,
gsb_data_currency_get_code_iso4217 (
account_currency_number ),
".png", NULL );
diff --git a/src/gsb_currency_config.c b/src/gsb_currency_config.c
index 9f18163..28dd0cb 100644
--- a/src/gsb_currency_config.c
+++ b/src/gsb_currency_config.c
@@ -564,8 +564,8 @@ void gsb_currency_append_currency_to_list ( GtkListStore *model,
GtkTreeIter iter;
gchar *string;
- string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), C_DIRECTORY_SEPARATOR,
- "flags", C_DIRECTORY_SEPARATOR,
+ string = g_strconcat( gsb_dirs_get_pixmaps_dir ( ), G_DIR_SEPARATOR_S,
+ "flags", G_DIR_SEPARATOR_S,
gsb_data_currency_get_code_iso4217 (currency_number),
".png", NULL );
pixbuf = gdk_pixbuf_new_from_file ( string,
diff --git a/src/gsb_dirs.c b/src/gsb_dirs.c
index 3a478e8..52ed6ae 100644
--- a/src/gsb_dirs.c
+++ b/src/gsb_dirs.c
@@ -29,10 +29,20 @@
#include "include.h"
#include "gsb_dirs.h"
+#include "structures.h"
static gchar *locale_dir;
static gchar *pixmaps_dir;
static gchar *plugins_dir;
+static gchar *_C_GRISBIRC;
+static gchar *_C_OLD_GRISBIRC;
+static gchar *_C_PATH_CONFIG;
+static gchar *_C_PATH_DATA_FILES;
+static gchar *_C_PATH_CONFIG_ACCELS;
+static gchar *_my_get_XDG_grisbi_data_dir;
+static gchar *_my_get_XDG_grisbirc_dir;
+static gchar *_my_get_grisbirc_dir;
+static gchar *_my_get_gsb_file_default_dir;
void gsb_dirs_init ( void )
@@ -53,6 +63,59 @@ void gsb_dirs_init ( void )
pixmaps_dir = g_strdup ( PIXMAPS_DIR );
plugins_dir = g_strdup ( PLUGINS_DIR );
}
+
+ /*
+ * FIXME: code from gsb_file_config.h
+ */
+#ifndef _WIN32
+
+#if IS_DEVELOPMENT_VERSION == 1
+ _C_GRISBIRC = g_strconcat ( PACKAGE, "dev.conf", NULL);
+#else
+ _C_GRISBIRC = g_strconcat ( PACKAGE, ".conf", NULL);
+#endif
+
+ _C_OLD_GRISBIRC = g_strconcat ( ".", PACKAGE, "rc", NULL);
+
+#ifdef OS_OSX
+ _C_PATH_CONFIG = g_strconcat (g_get_home_dir ( ), G_DIR_SEPARATOR_S,
+ "Library/Application Support/Grisbi/config", NULL);
+ _C_PATH_DATA_FILES = g_strconcat (g_get_home_dir ( ), G_DIR_SEPARATOR_S,
+ "Library/Application Support/Grisbi/data", NULL);
+#else /* OS_OSX */
+ _C_PATH_CONFIG = g_strconcat (g_get_user_config_dir ( ), G_DIR_SEPARATOR_S,
+ "grisbi", NULL);
+ _C_PATH_DATA_FILES = g_strconcat (g_get_user_data_dir ( ), G_DIR_SEPARATOR_S,
+ "grisbi", NULL);
+#endif /* OS_OSX */
+
+#else /* _WIN32 */
+
+/* Some old Windows version have difficulties with dat starting file names */
+ _C_GRISBIRC = g_strconcat ( PACKAGE, "rc", NULL);
+ _C_OLD_GRISBIRC = g_strconcat ( ".", PACKAGE, "rc", NULL);
+ _C_PATH_CONFIG = win32_get_grisbirc_folder_path( );
+ _C_PATH_DATA_FILES = g_get_home_dir ( );
+
+#endif /* _WIN32 */
+
+ _C_PATH_CONFIG_ACCELS = g_strconcat ( _C_PATH_CONFIG, G_DIR_SEPARATOR_S,
+ "grisbi-accels", NULL );
+
+ /*
+ * FIXME: code from utils_files.c
+ */
+#ifndef _WIN32
+ _my_get_XDG_grisbirc_dir = g_strdup ( _C_PATH_CONFIG );
+ _my_get_XDG_grisbi_data_dir = g_strdup ( _C_PATH_DATA_FILES );
+ _my_get_grisbirc_dir = g_strdup ( g_get_home_dir () );
+ _my_get_gsb_file_default_dir = g_strdup ( g_get_home_dir() );
+#else
+ _my_get_XDG_grisbirc_dir = g_strdup ( win32_get_grisbirc_folder_path() );
+ _my_get_XDG_grisbi_data_dir = g_strdup ( g_get_home_dir () );
+ _my_get_grisbirc_dir = g_strdup ( win32_get_grisbirc_folder_path() );
+ _my_get_gsb_file_default_dir = g_strdup ( win32_get_my_documents_folder_path() );
+#endif
}
@@ -61,6 +124,15 @@ void gsb_dirs_shutdown ( void )
g_free ( locale_dir );
g_free ( pixmaps_dir );
g_free ( plugins_dir );
+ g_free ( _C_GRISBIRC );
+ g_free ( _C_OLD_GRISBIRC );
+ g_free ( _C_PATH_CONFIG );
+ g_free ( _C_PATH_DATA_FILES );
+ g_free ( _C_PATH_CONFIG_ACCELS );
+ g_free ( _my_get_XDG_grisbi_data_dir );
+ g_free ( _my_get_XDG_grisbirc_dir );
+ g_free ( _my_get_grisbirc_dir );
+ g_free ( _my_get_gsb_file_default_dir );
}
@@ -80,3 +152,87 @@ const gchar *gsb_dirs_get_plugins_dir ( void )
{
return plugins_dir;
}
+
+
+const gchar *C_GRISBIRC ( void )
+{
+ return _C_GRISBIRC;
+}
+
+
+const gchar *C_OLD_GRISBIRC ( void )
+{
+ return _C_OLD_GRISBIRC;
+}
+
+
+const gchar *C_PATH_CONFIG ( void )
+{
+ return _C_PATH_CONFIG;
+}
+
+
+const gchar *C_PATH_DATA_FILES ( void )
+{
+ return _C_PATH_DATA_FILES;
+}
+
+
+const gchar *C_PATH_CONFIG_ACCELS ( void )
+{
+ return _C_PATH_CONFIG_ACCELS;
+}
+
+
+/**
+ * return the absolute path of where the configuration file should be located
+ * On UNIX platforms this is determined using the mechanisms described
+ * in the XDG Base Directory Specification
+ * on Windows based systems return APPDATA\Grisbi
+ *
+ * \return the absolute path of the configuration file directory
+ */
+const gchar *my_get_XDG_grisbirc_dir ( void )
+{
+ return _my_get_XDG_grisbirc_dir;
+}
+
+
+/**
+ * return the absolute path of where the data files should be located
+ * On UNIX platforms this is determined using the mechanisms described
+ * in the XDG Base Directory Specification
+ * on Windows based systems return APPDATA\Grisbi
+ *
+ * \return the absolute path of the home directory
+ */
+const gchar *my_get_XDG_grisbi_data_dir ( void )
+{
+ return _my_get_XDG_grisbi_data_dir;
+}
+
+
+/**
+ * return the absolute path of where the configuration file should be located
+ * on Un*x based system return $HOME
+ * on Windows based systems return APPDATA\Grisbi
+ *
+ * \return the absolute path of the configuration file directory
+ */
+const gchar *my_get_grisbirc_dir ( void )
+{
+ return _my_get_grisbirc_dir;
+}
+
+
+/**
+ * return the absolute path of the default accounts files location
+ * on Un*x based system return $HOME
+ * on Windows based systems return "My Documents"
+ *
+ * \return the absolute path of the configuration file directory
+ */
+const gchar *my_get_gsb_file_default_dir ( void )
+{
+ return _my_get_gsb_file_default_dir;
+}
diff --git a/src/gsb_dirs.h b/src/gsb_dirs.h
index 5b1e255..2ec5531 100644
--- a/src/gsb_dirs.h
+++ b/src/gsb_dirs.h
@@ -8,5 +8,14 @@ void gsb_dirs_shutdown ( void );
const gchar *gsb_dirs_get_locale_dir ( void );
const gchar *gsb_dirs_get_pixmaps_dir ( void );
const gchar *gsb_dirs_get_plugins_dir ( void );
+const gchar *C_GRISBIRC ( void );
+const gchar *C_OLD_GRISBIRC ( void );
+const gchar *C_PATH_CONFIG ( void );
+const gchar *C_PATH_DATA_FILES ( void );
+const gchar *C_PATH_CONFIG_ACCELS ( void );
+const gchar *my_get_XDG_grisbi_data_dir ( void );
+const gchar *my_get_XDG_grisbirc_dir ( void );
+const gchar *my_get_grisbirc_dir ( void );
+const gchar *my_get_gsb_file_default_dir ( void );
#endif
diff --git a/src/gsb_file.c b/src/gsb_file.c
index 9bf1f5b..c151dc3 100644
--- a/src/gsb_file.c
+++ b/src/gsb_file.c
@@ -52,7 +52,7 @@
#include "gsb_assistant_file.h"
#include "gsb_data_account.h"
#include "gsb_data_archive_store.h"
-#include "gsb_file_config.h"
+#include "gsb_dirs.h"
#include "gsb_file_load.h"
#include "gsb_file_save.h"
#include "gsb_file_util.h"
@@ -322,7 +322,7 @@ const gchar *gsb_file_get_backup_path ( void )
void gsb_file_set_backup_path ( const gchar *path )
{
if ( path == NULL || strlen ( path ) == 0 )
- backup_path = my_strdup ( C_PATH_DATA_FILES );
+ backup_path = my_strdup ( C_PATH_DATA_FILES ( ) );
else
backup_path = my_strdup ( path );
diff --git a/src/gsb_file_config.c b/src/gsb_file_config.c
index 904fa57..572aa77 100644
--- a/src/gsb_file_config.c
+++ b/src/gsb_file_config.c
@@ -40,6 +40,7 @@
/*START_INCLUDE*/
#include "gsb_file_config.h"
#include "dialog.h"
+#include "gsb_dirs.h"
#include "gsb_file.h"
#include "main.h"
#include "structures.h"
@@ -111,12 +112,14 @@ gboolean gsb_file_config_load_config ( void )
devel_debug (NULL);
gsb_file_config_clean_config ();
- filename = g_strconcat ( my_get_XDG_grisbirc_dir(), C_GRISBIRC, NULL );
+ filename = g_strconcat ( my_get_XDG_grisbirc_dir(), G_DIR_SEPARATOR_S,
+ C_GRISBIRC ( ), NULL );
#if IS_DEVELOPMENT_VERSION == 1
if ( !g_file_test (filename, G_FILE_TEST_EXISTS) )
{
g_free ( filename );
- filename = g_strconcat ( my_get_XDG_grisbirc_dir(), "/", PACKAGE, ".conf", NULL );
+ filename = g_strconcat ( my_get_XDG_grisbirc_dir(), G_DIR_SEPARATOR_S,
+ PACKAGE, ".conf", NULL );
used_model = FALSE;
}
#endif
@@ -140,7 +143,8 @@ devel_debug (NULL);
if ( ! filename || strlen ( filename ) == 0 )
return FALSE;
#else
- filename = g_strconcat ( my_get_grisbirc_dir(), C_OLD_GRISBIRC, NULL );
+ filename = g_strconcat ( my_get_grisbirc_dir(), G_DIR_SEPARATOR_S,
+ C_OLD_GRISBIRC ( ), NULL );
#endif
config = g_key_file_new ();
@@ -517,7 +521,8 @@ gboolean gsb_file_config_save_config ( void )
devel_debug (NULL);
- filename = g_strconcat ( my_get_XDG_grisbirc_dir(), C_GRISBIRC, NULL );
+ filename = g_strconcat ( my_get_XDG_grisbirc_dir(), G_DIR_SEPARATOR_S,
+ C_GRISBIRC ( ), NULL );
config = g_key_file_new ();
#if IS_DEVELOPMENT_VERSION == 1
@@ -1424,8 +1429,7 @@ gchar *gsb_config_get_old_conf_name ( void )
gtk_list_store_set (store, &iter,
0, (gchar *) liste -> data,
-1);
- if ( g_strcmp0 ( (gchar *) liste -> data,
- ( C_OLD_GRISBIRC + 1 ) ) == 0 )
+ if ( g_strcmp0 ( (gchar *) liste -> data, C_OLD_GRISBIRC ( ) ) == 0 )
j = i;
liste = liste -> next;
i++;
diff --git a/src/gsb_file_config.h b/src/gsb_file_config.h
index cbf5932..dcd15ae 100644
--- a/src/gsb_file_config.h
+++ b/src/gsb_file_config.h
@@ -1,45 +1,10 @@
#ifndef _GSB_FILE_CONFIG_H
#define _GSB_FILE_CONFIG_H (1)
-/* START_INCLUDE_H */
-#include "structures.h"
-/* END_INCLUDE_H */
-
+#include <glib.h>
#define ETAT_WWW_BROWSER "xdg-open"
-/* mise en conformité avec les recommandations FreeDesktop. */
-
-#ifndef _WIN32
-#if IS_DEVELOPMENT_VERSION == 1
-#define C_GRISBIRC (g_strconcat ( "/", PACKAGE, "dev.conf", NULL))
-#else
-#define C_GRISBIRC (g_strconcat ( "/", PACKAGE, ".conf", NULL))
-#endif
-#define C_OLD_GRISBIRC (g_strconcat ( "/.", PACKAGE, "rc", NULL))
-
-#ifdef OS_OSX
-#define C_PATH_CONFIG (g_strconcat (g_get_home_dir ( ), G_DIR_SEPARATOR_S,\
- "Library/Application Support/Grisbi/config", NULL))
-#define C_PATH_DATA_FILES (g_strconcat (g_get_home_dir ( ), G_DIR_SEPARATOR_S,\
- "Library/Application Support/Grisbi/data", NULL))
-#else
-#define C_PATH_CONFIG (g_strconcat (g_get_user_config_dir ( ), G_DIR_SEPARATOR_S,\
- "grisbi", NULL))
-#define C_PATH_DATA_FILES (g_strconcat (g_get_user_data_dir ( ), G_DIR_SEPARATOR_S,\
- "grisbi", NULL))
-#endif
-#else
-/* Some old Windows version have difficulties with dat starting file names */
-#define C_GRISBIRC (g_strconcat ( "\\", PACKAGE, "rc", NULL))
-#define C_OLD_GRISBIRC (g_strconcat ( "\\.", PACKAGE, "rc", NULL))
-#define C_PATH_CONFIG (win32_get_grisbirc_folder_path( ))
-#define C_PATH_DATA_FILES (g_get_home_dir ( ))
-#endif
-
-#define C_PATH_CONFIG_ACCELS (g_strconcat ( C_PATH_CONFIG, G_DIR_SEPARATOR_S,\
- "grisbi-accels", NULL ))
-
/* START_DECLARATION */
gboolean gsb_file_config_load_config ( void );
gboolean gsb_file_config_save_config ( void );
diff --git a/src/main.c b/src/main.c
index 2745c76..668fe27 100644
--- a/src/main.c
+++ b/src/main.c
@@ -211,7 +211,7 @@ void main_linux ( int argc, char **argv )
gtk_main ();
/* sauvegarde les raccourcis claviers */
- gtk_accel_map_save ( C_PATH_CONFIG_ACCELS );
+ gtk_accel_map_save ( C_PATH_CONFIG_ACCELS ( ) );
}
@@ -314,7 +314,7 @@ void main_mac_osx ( int argc, char **argv )
gtk_main ();
/* sauvegarde les raccourcis claviers */
- gtk_accel_map_save ( C_PATH_CONFIG_ACCELS );
+ gtk_accel_map_save ( C_PATH_CONFIG_ACCELS ( ) );
g_object_unref ( theApp );
@@ -385,7 +385,7 @@ void main_win_32 ( int argc, char **argv )
gtk_main ();
/* sauvegarde les raccourcis claviers */
- gtk_accel_map_save ( C_PATH_CONFIG_ACCELS );
+ gtk_accel_map_save ( C_PATH_CONFIG_ACCELS ( ) );
#endif /* WIN_32 */
}
@@ -518,7 +518,7 @@ GtkWidget *gsb_grisbi_create_main_menu ( GtkWidget *vbox )
menus_sensitifs ( FALSE );
/* charge les raccourcis claviers */
- gtk_accel_map_load ( C_PATH_CONFIG_ACCELS );
+ gtk_accel_map_load ( C_PATH_CONFIG_ACCELS ( ) );
/* set the last opened files */
affiche_derniers_fichiers_ouverts ( );
@@ -836,10 +836,10 @@ gchar *gsb_main_get_print_dir_var ( void )
"\tgsb_dirs_get_pixmaps_dir ( ) = %s\n\n",
g_get_user_data_dir ( ),
g_get_user_config_dir ( ),
- C_GRISBIRC,
- C_PATH_CONFIG,
- C_PATH_CONFIG_ACCELS,
- C_PATH_DATA_FILES,
+ C_GRISBIRC ( ),
+ C_PATH_CONFIG ( ),
+ C_PATH_CONFIG_ACCELS ( ),
+ C_PATH_DATA_FILES ( ),
gsb_dirs_get_locale_dir ( ),
gsb_dirs_get_plugins_dir ( ),
gsb_dirs_get_pixmaps_dir ( ) );
@@ -855,11 +855,6 @@ gchar *gsb_main_get_print_dir_var ( void )
*/
void gsb_main_free_global_definitions ( void )
{
- g_free ( C_GRISBIRC );
- g_free ( C_OLD_GRISBIRC );
- g_free ( C_PATH_CONFIG );
- g_free ( C_PATH_CONFIG_ACCELS );
- g_free ( C_PATH_DATA_FILES );
}
diff --git a/src/parametres.c b/src/parametres.c
index 0e68e78..118cc36 100644
--- a/src/parametres.c
+++ b/src/parametres.c
@@ -49,6 +49,7 @@
#include "gsb_currency_config.h"
#include "gsb_currency_link_config.h"
#include "gsb_data_account.h"
+#include "gsb_dirs.h"
#include "gsb_file.h"
#include "gsb_form_config.h"
#include "gsb_fyear_config.h"
diff --git a/src/utils_files.c b/src/utils_files.c
index 6c4066f..0b1dc2d 100644
--- a/src/utils_files.c
+++ b/src/utils_files.c
@@ -35,6 +35,7 @@
#include "dialog.h"
#include "utils_file_selection.h"
#include "go-charmap-sel.h"
+#include "gsb_dirs.h"
#include "gsb_file.h"
#include "utils_str.h"
#include "gsb_file_config.h"
@@ -202,75 +203,6 @@ void browse_file ( GtkButton *button, gpointer data )
}
}
-/**
- * return the absolute path of where the configuration file should be located
- * on Un*x based system return $HOME
- * on Windows based systems return APPDATA\Grisbi
- *
- * \return the absolute path of the configuration file directory
- */
-gchar* my_get_grisbirc_dir(void)
-{
-#ifndef _WIN32
- return (gchar *) g_get_home_dir ();
-#else
- return win32_get_grisbirc_folder_path();
-#endif
-}
-
-
-/**
- * return the absolute path of where the configuration file should be located
- * On UNIX platforms this is determined using the mechanisms described
- * in the XDG Base Directory Specification
- * on Windows based systems return APPDATA\Grisbi
- *
- * \return the absolute path of the configuration file directory
- */
-gchar* my_get_XDG_grisbirc_dir(void)
-{
-#ifndef _WIN32
- return (gchar *) C_PATH_CONFIG;
-#else
- return win32_get_grisbirc_folder_path();
-#endif
-}
-
-
-/**
- * return the absolute path of where the data files should be located
- * On UNIX platforms this is determined using the mechanisms described
- * in the XDG Base Directory Specification
- * on Windows based systems return APPDATA\Grisbi
- *
- * \return the absolute path of the home directory
- */
-gchar* my_get_XDG_grisbi_data_dir ( void )
-{
-#ifndef _WIN32
- return (gchar *) C_PATH_DATA_FILES;
-#else
- return g_get_home_dir ();
-#endif
-}
-
-/**
- * return the absolute path of the default accounts files location
- * on Un*x based system return $HOME
- * on Windows based systems return "My Documents"
- *
- * \return the absolute path of the configuration file directory
- */
-gchar* my_get_gsb_file_default_dir ( void )
-{
-#ifndef _WIN32
- return (gchar *) g_get_home_dir();
-#else
- return win32_get_my_documents_folder_path();
-#endif
-}
-
-
/* get the line af the file,
* convert it in UTF8 and fill string with that line
@@ -482,8 +414,8 @@ gboolean utils_files_create_XDG_dir ( void )
#else
int mode = S_IRUSR | S_IWUSR | S_IXUSR;
#endif /*_MSC_VER */
- if ( g_mkdir_with_parents ( C_PATH_CONFIG, mode ) == 0 &&
- g_mkdir_with_parents ( C_PATH_DATA_FILES, mode ) == 0 )
+ if ( g_mkdir_with_parents ( C_PATH_CONFIG ( ), mode ) == 0 &&
+ g_mkdir_with_parents ( C_PATH_DATA_FILES ( ), mode ) == 0 )
return TRUE;
else
return FALSE;
diff --git a/src/utils_files.h b/src/utils_files.h
index e0c2117..5c8168a 100644
--- a/src/utils_files.h
+++ b/src/utils_files.h
@@ -12,20 +12,10 @@ enum get_filename_returned_value {
/* START_INCLUDE_H */
/* END_INCLUDE_H */
-#ifdef _WIN32
-#define C_DIRECTORY_SEPARATOR "\\"
-#else
-#define C_DIRECTORY_SEPARATOR "/"
-#endif
-
/*START_DECLARATION*/
gint get_utf8_line_from_file ( FILE *fichier,
gchar **string,
const gchar *coding_system );
-gchar* my_get_XDG_grisbi_data_dir ( void );
-gchar* my_get_XDG_grisbirc_dir ( void );
-gchar* my_get_grisbirc_dir ( void );
-gchar* my_get_gsb_file_default_dir ( void );
gchar *safe_file_name ( gchar *filename );
G_MODULE_EXPORT FILE* utf8_fopen ( const gchar *utf8filename, gchar *mode );
gint utf8_remove ( const gchar *utf8filename );
hooks/post-receive
--
grisbi
More information about the cvs
mailing list