[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_1_1_1-69-g7b8f402

Cédric Bosdonnat nobody at users.sourceforge.net
Fri Jan 18 10:31:07 CET 2013


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  7b8f40220678a238dc7bd50e57aedb93e9baf073 (commit)
      from  8f16a12d3cd35635792a0eba0963ea8755e4991a (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 7b8f40220678a238dc7bd50e57aedb93e9baf073
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Fri Jan 18 10:20:17 2013 +0100

    Look for ui folder next to grisbi extecutable
    
    This is useful when running src/grisbi after a make otherwise it can't
    find ui files in the normal location (/usr/....) as it's not installed.

-----------------------------------------------------------------------

Changes:
diff --git a/src/gsb_dirs.c b/src/gsb_dirs.c
index 769c5ce..6261300 100644
--- a/src/gsb_dirs.c
+++ b/src/gsb_dirs.c
@@ -41,10 +41,17 @@ static gchar *user_default_dir;
 
 static gchar *grisbirc_filename;
 static gchar *accelerator_filename;
+static gchar *grisbi_dir;
 
 
-void gsb_dirs_init ( void )
+void gsb_dirs_init ( char* gsb_bin_path )
 {
+    gchar* local_ui_dir;
+
+    /* Get the grisbi executable directory as it may be useful when running dev instances */
+    grisbi_dir = g_path_get_dirname( gsb_bin_path );
+    local_ui_dir = g_strconcat( grisbi_dir, "/ui", NULL );
+
 #ifdef G_OS_WIN32
     {
         gchar *dir;
@@ -106,6 +113,13 @@ void gsb_dirs_init ( void )
 #endif /* OS_OSX */
 #endif
 
+
+    GDir* local_ui_handle = g_dir_open( local_ui_dir, 0, NULL );
+    if ( NULL != local_ui_handle )
+    {
+        g_free( ui_dir );
+        ui_dir = local_ui_dir;
+    }
     accelerator_filename = g_build_filename ( user_config_dir, "grisbi-accels", NULL );
 }
 
@@ -121,6 +135,7 @@ void gsb_dirs_shutdown ( void )
 
     g_free ( grisbirc_filename );
     g_free ( accelerator_filename );
+    g_free ( grisbi_dir );
     g_free ( user_default_dir );
 }
 
diff --git a/src/gsb_dirs.h b/src/gsb_dirs.h
index f7ccd18..256f724 100644
--- a/src/gsb_dirs.h
+++ b/src/gsb_dirs.h
@@ -3,7 +3,7 @@
 
 #include <glib.h>
 
-void gsb_dirs_init ( void );
+void gsb_dirs_init ( char* gsb_bin_path );
 void gsb_dirs_shutdown ( void );
 const gchar *gsb_dirs_get_categories_dir ( void );
 const gchar *gsb_dirs_get_default_dir ( void );
diff --git a/src/main.c b/src/main.c
index b180968..763f87e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -161,7 +161,7 @@ void main_linux ( int argc, char **argv )
     gint status = CMDLINE_SYNTAX_OK;
 
     /* initialisation des différents répertoires */
-    gsb_dirs_init ( );
+    gsb_dirs_init ( argv[0] );
 
     bindtextdomain ( PACKAGE, gsb_dirs_get_locale_dir ( ) );
     bind_textdomain_codeset ( PACKAGE, "UTF-8" );
@@ -260,7 +260,7 @@ void main_mac_osx ( int argc, char **argv )
     go_plugins_init (NULL, NULL, NULL, NULL, TRUE, GO_TYPE_PLUGIN_LOADER_MODULE);
 
     /* initialisation des différents répertoires */
-    gsb_dirs_init ( );
+    gsb_dirs_init ( argv[0] );
 
 #if IS_DEVELOPMENT_VERSION == 1
     gsb_grisbi_print_environment_var ( );
@@ -383,7 +383,7 @@ void main_win_32 (  int argc, char **argv )
     win32_make_sure_the_gtk2_dlls_path_is_in_PATH();
 
     /* initialisation des différents répertoires */
-    gsb_dirs_init ( );
+    gsb_dirs_init ( argv[0] );
 
     bindtextdomain ( PACKAGE, gsb_dirs_get_locale_dir ( ) );
     bind_textdomain_codeset ( PACKAGE, "UTF-8" );


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list