comparison src/evdev-plug/ed_internals.c @ 435:c18fd1befd1f trunk

[svn] - added audacious_get_localdir() in util.c/h, returns a string with the full path of audacious local datadir
author giacomo
date Mon, 15 Jan 2007 12:38:45 -0800
parents 5e46b57d1eda
children 4fec4a3ca1a4
comparison
equal deleted inserted replaced
434:7385182ae4b8 435:c18fd1befd1f
22 #include "ed_internals.h" 22 #include "ed_internals.h"
23 #include "ed_actions.h" 23 #include "ed_actions.h"
24 #include "ed_bindings_store.h" 24 #include "ed_bindings_store.h"
25 #include "ed_common.h" 25 #include "ed_common.h"
26 26
27 #include <audacious/util.h>
27 #include <stdint.h> 28 #include <stdint.h>
28 #include <stdio.h> 29 #include <stdio.h>
29 #include <linux/input.h> 30 #include <linux/input.h>
30 #include <sys/types.h> 31 #include <sys/types.h>
31 #include <sys/stat.h> 32 #include <sys/stat.h>
468 GList *config_devices_list = NULL; 469 GList *config_devices_list = NULL;
469 gboolean is_loaded = FALSE; 470 gboolean is_loaded = FALSE;
470 gchar **device_names = NULL; 471 gchar **device_names = NULL;
471 gsize device_names_num = 0; 472 gsize device_names_num = 0;
472 gchar *config_pathfilename = NULL; 473 gchar *config_pathfilename = NULL;
474 gchar *config_datadir = NULL;
473 gint i = 0; 475 gint i = 0;
474 476
475 config_pathfilename = g_strjoin( "" , g_get_home_dir() , 477 config_datadir = (gchar*)audacious_get_localdir();
476 "/" PLAYER_LOCALRC_DIR "/" PLAYER_LOCALRC_FILE , NULL ); 478 config_pathfilename = g_build_filename( config_datadir , PLAYER_LOCALRC_FILE , NULL );
479 g_free( config_datadir );
477 keyfile = g_key_file_new(); 480 keyfile = g_key_file_new();
478 is_loaded = g_key_file_load_from_file( keyfile , config_pathfilename , G_KEY_FILE_NONE , NULL ); 481 is_loaded = g_key_file_load_from_file( keyfile , config_pathfilename , G_KEY_FILE_NONE , NULL );
479 g_free( config_pathfilename ); 482 g_free( config_pathfilename );
480 483
481 if ( is_loaded != TRUE ) 484 if ( is_loaded != TRUE )
559 GKeyFile *keyfile = NULL; 562 GKeyFile *keyfile = NULL;
560 gboolean is_loaded = FALSE; 563 gboolean is_loaded = FALSE;
561 gchar **device_names = NULL; 564 gchar **device_names = NULL;
562 gsize device_names_num = 0; 565 gsize device_names_num = 0;
563 gchar *config_pathfilename = NULL; 566 gchar *config_pathfilename = NULL;
567 gchar *config_datadir = NULL;
564 GList *system_devices_list = NULL; 568 GList *system_devices_list = NULL;
565 gint i = 0; 569 gint i = 0;
566 570
567 config_pathfilename = g_strjoin( "" , g_get_home_dir() , 571 config_datadir = (gchar*)audacious_get_localdir();
568 "/" PLAYER_LOCALRC_DIR "/" PLAYER_LOCALRC_FILE , NULL ); 572 config_pathfilename = g_build_filename( config_datadir , PLAYER_LOCALRC_FILE , NULL );
573 g_free( config_datadir );
569 keyfile = g_key_file_new(); 574 keyfile = g_key_file_new();
570 is_loaded = g_key_file_load_from_file( keyfile , config_pathfilename , G_KEY_FILE_NONE , NULL ); 575 is_loaded = g_key_file_load_from_file( keyfile , config_pathfilename , G_KEY_FILE_NONE , NULL );
571 g_free( config_pathfilename ); 576 g_free( config_pathfilename );
572 577
573 if ( is_loaded != TRUE ) 578 if ( is_loaded != TRUE )
791 GList *iter_list = NULL; 796 GList *iter_list = NULL;
792 gchar *keyfile_str = NULL; 797 gchar *keyfile_str = NULL;
793 gsize keyfile_str_len = 0; 798 gsize keyfile_str_len = 0;
794 GIOChannel *iochan; 799 GIOChannel *iochan;
795 gchar *config_pathfilename = NULL; 800 gchar *config_pathfilename = NULL;
796 801 gchar *config_datadir = NULL;
797 config_pathfilename = g_strjoin( "" , g_get_home_dir() , 802
798 "/" PLAYER_LOCALRC_DIR "/" PLAYER_LOCALRC_FILE , NULL ); 803 config_datadir = (gchar*)audacious_get_localdir();
804 config_pathfilename = g_build_filename( config_datadir , PLAYER_LOCALRC_FILE , NULL );
805 g_free( config_datadir );
799 806
800 keyfile = g_key_file_new(); 807 keyfile = g_key_file_new();
801 808
802 g_key_file_set_string( keyfile , "___plugin___" , "config_ver" , ED_VERSION_CONFIG ); 809 g_key_file_set_string( keyfile , "___plugin___" , "config_ver" , ED_VERSION_CONFIG );
803 810