]> git.pld-linux.org Git - packages/bluefish.git/blob - bluefish-home_etc.patch
- already included
[packages/bluefish.git] / bluefish-home_etc.patch
1 diff -Nru bluefish-0.11.orig/src/bluefish.c bluefish-0.11/src/bluefish.c
2 --- bluefish-0.11.orig/src/bluefish.c   2003-07-27 17:26:58.000000000 +0200
3 +++ bluefish-0.11/src/bluefish.c        2003-11-19 12:48:08.000000000 +0100
4 @@ -110,7 +110,8 @@
5  #ifndef NOSPLASH
6         GtkWidget *splash_window;
7  #endif /* #ifndef NOSPLASH */
8 -
9 +       gchar *home_etc = getenv("HOME_ETC");
10 +       
11  #ifdef ENABLE_NLS                                                               
12         setlocale(LC_ALL,"");                                                   
13         bindtextdomain(PACKAGE,LOCALEDIR);
14 @@ -139,7 +140,7 @@
15  #endif /* #ifndef NOSPLASH */
16  
17         {
18 -               gchar *filename = g_strconcat(g_get_home_dir(), "/.bluefish/dir_history", NULL);
19 +               gchar *filename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/dir_history", NULL);
20                 main_v->recent_directories = get_stringlist(filename, NULL);
21                 g_free(filename);
22         }
23 @@ -171,7 +172,7 @@
24                 gchar *shortcutfilename;
25                 GtkSettings* gtksettings = gtk_settings_get_default();
26                 g_object_set(G_OBJECT(gtksettings), "gtk-can-change-accels", TRUE, NULL); 
27 -               shortcutfilename = g_strconcat(g_get_home_dir(), "/.bluefish/menudump_2", NULL);
28 +               shortcutfilename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/menudump_2", NULL);
29                 gtk_accel_map_load(shortcutfilename);
30                 g_free(shortcutfilename);
31         }
32 @@ -218,7 +219,8 @@
33         
34         rcfile_save_all();
35         {
36 -               gchar *filename = g_strconcat(g_get_home_dir(), "/.bluefish/dir_history", NULL);
37 +               gchar *home_etc = getenv("HOME_ETC");
38 +               gchar *filename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/dir_history", NULL);
39                 put_stringlist_limited(filename, main_v->recent_directories, main_v->props.max_dir_history);
40                 g_free(filename);
41         }
42 diff -Nru bluefish-0.11.orig/src/fref.c bluefish-0.11/src/fref.c
43 --- bluefish-0.11.orig/src/fref.c       2003-07-27 17:26:58.000000000 +0200
44 +++ bluefish-0.11/src/fref.c    2003-11-19 12:45:04.000000000 +0100
45 @@ -1456,7 +1456,8 @@
46  
47  
48  static void fref_popup_menu_rescan_lcb(GtkWidget *widget,gpointer user_data) {
49 -       gchar *userdir = g_strconcat(g_get_home_dir(), "/.bluefish/", NULL);
50 +       gchar *home_etc = getenv("HOME_ETC");
51 +       gchar *userdir = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/", NULL);
52         DEBUG_MSG("fref_popup_menu_rescan_lcb, started\n");
53         fref_rescan_dir(PKGDATADIR);
54         fref_rescan_dir(userdir);
55 diff -Nru bluefish-0.11.orig/src/menu.c bluefish-0.11/src/menu.c
56 --- bluefish-0.11.orig/src/menu.c       2003-07-27 17:26:58.000000000 +0200
57 +++ bluefish-0.11/src/menu.c    2003-11-19 12:49:55.000000000 +0100
58 @@ -796,11 +796,12 @@
59  
60  void recent_menu_init() {
61         gchar *recentfile;
62 +       gchar *home_etc = getenv("HOME_ETC");
63         GList *filenames=NULL, *tmp, *tmp2, *newlist=NULL;
64         gint recent_file_count=0;
65  
66         DEBUG_MSG("open_recent_list, started\n");
67 -       recentfile = g_strconcat(g_get_home_dir(), "/.bluefish/recentlist", NULL);
68 +       recentfile = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/recentlist", NULL);
69         filenames = get_stringlist(recentfile, filenames);
70         if (!filenames) {
71                 filenames = add_to_stringlist(menus.recent_files, _("(none)"));
72 @@ -862,7 +863,8 @@
73  
74         } else {
75                 gchar *tmpfilename, *recentfile;
76 -               recentfile = g_strconcat(g_get_home_dir(), "/.bluefish/recentlist", NULL);
77 +               gchar *home_etc = getenv("HOME_ETC");
78 +               recentfile = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/recentlist", NULL);
79                 /* save the new list */
80                 tmpfilename = g_strconcat(filename, "\n", NULL);
81                 DEBUG_MSG("add_to_recent_list, trying to append to %s\n", recentfile);
82 diff -Nru bluefish-0.11.orig/src/rcfile.c bluefish-0.11/src/rcfile.c
83 --- bluefish-0.11.orig/src/rcfile.c     2003-07-27 18:19:58.000000000 +0200
84 +++ bluefish-0.11/src/rcfile.c  2003-11-19 12:56:12.000000000 +0100
85 @@ -469,6 +469,7 @@
86  void rcfile_parse_main(void)
87  {
88         gchar *filename;
89 +       gchar *home_etc = getenv("HOME_ETC");
90  
91         DEBUG_MSG("rcfile_parse_main, started\n");
92  
93 @@ -478,7 +479,7 @@
94         /*Make the config_rc list ready for filling with data and set default values */
95         main_configlist = props_init_main(NULL);
96  
97 -       filename = g_strconcat(g_get_home_dir(), "/.bluefish/rcfile_v2", NULL);
98 +       filename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/rcfile_v2", NULL);
99         if (!parse_config_file(main_configlist, filename)) {
100                 /* should we initialize some things ?? */
101         }
102 @@ -567,7 +568,7 @@
103                 main_v->props.filefilters = g_list_append(main_v->props.filefilters, arr);
104         }
105         if (main_v->props.reference_files == NULL) {
106 -               gchar *userdir = g_strconcat(g_get_home_dir(), "/.bluefish/", NULL);
107 +               gchar *userdir = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/", NULL);
108                 /* if the user does not yet have any function reference files, set them to default values */
109                 fref_rescan_dir(PKGDATADIR);
110                 fref_rescan_dir(userdir);
111 @@ -589,7 +590,8 @@
112  }
113  
114  static gint rcfile_save_main(void) {
115 -       gchar *filename = g_strconcat(g_get_home_dir(), "/.bluefish/rcfile_v2", NULL);
116 +       gchar *home_etc = getenv("HOME_ETC");
117 +       gchar *filename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/rcfile_v2", NULL);
118         return save_config_file(main_configlist, filename);
119  }
120  /*
121 @@ -607,13 +609,14 @@
122  void rcfile_parse_highlighting(void) {
123         gchar *filename;
124         gchar *defaultfile;
125 +       gchar *home_etc = getenv("HOME_ETC");
126  
127         DEBUG_MSG("rcfile_parse_highlighting, started\n");
128  
129         highlighting_configlist = NULL;
130         init_prop_arraylist(&highlighting_configlist, &main_v->props.highlight_patterns, "patterns:", 0);
131  
132 -       filename = g_strconcat(g_get_home_dir(), "/.bluefish/highlighting", NULL);
133 +       filename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/highlighting", NULL);
134         defaultfile = return_first_existing_filename(PKGDATADIR"highlighting.default",
135                                                                         "data/highlighting.default",
136                                                                         "../data/highlighting.default",NULL);
137 @@ -638,7 +641,8 @@
138  
139  static gint rcfile_save_highlighting(void) {
140         gint retval;
141 -       gchar *filename = g_strconcat(g_get_home_dir(), "/.bluefish/highlighting", NULL);
142 +       gchar *home_etc = getenv("HOME_ETC");
143 +       gchar *filename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/highlighting", NULL);
144         retval = save_config_file(highlighting_configlist, filename);
145         g_free(filename);
146         return retval;
147 @@ -647,6 +651,7 @@
148  void rcfile_parse_custom_menu(void) {
149         gchar *filename;
150         gchar *defaultfile;
151 +       gchar *home_etc = getenv("HOME_ETC");
152         DEBUG_MSG("rcfile_parse_custom_menu, started\n");
153  
154         custom_menu_configlist = NULL;
155 @@ -654,7 +659,7 @@
156         init_prop_arraylist(&custom_menu_configlist, &main_v->props.cmenu_insert, "cmenu_insert:", 0);
157         init_prop_arraylist(&custom_menu_configlist, &main_v->props.cmenu_replace, "cmenu_replace:", 0);
158  
159 -       filename = g_strconcat(g_get_home_dir(), "/.bluefish/custom_menu", NULL);
160 +       filename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/custom_menu", NULL);
161         defaultfile = return_first_existing_filename(PKGDATADIR"custom_menu.default",
162                                                                         "data/custom_menu.default",
163                                                                         "../data/custom_menu.default",NULL);
164 @@ -771,7 +776,8 @@
165  }
166  static gint rcfile_save_custom_menu(void) {
167         gint retval;
168 -       gchar *filename = g_strconcat(g_get_home_dir(), "/.bluefish/custom_menu", NULL);
169 +       gchar *home_etc = getenv("HOME_ETC");
170 +       gchar *filename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/custom_menu", NULL);
171         retval = save_config_file(custom_menu_configlist, filename);
172         g_free(filename);
173         return retval;
174 @@ -779,7 +785,8 @@
175  
176  #define DIR_MODE (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)     /* same as 0755 */
177  void rcfile_check_directory(void) {
178 -       gchar *rcdir = g_strconcat(g_get_home_dir(), "/.bluefish", NULL);
179 +       gchar *home_etc = getenv("HOME_ETC");
180 +       gchar *rcdir = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish", NULL);
181         if (!g_file_test(rcdir, G_FILE_TEST_IS_DIR)) {
182                 mkdir(rcdir, DIR_MODE);
183         }
184 @@ -799,7 +806,8 @@
185         break;
186         case 3:
187                 {
188 -                       gchar *shortcutfilename = g_strconcat(g_get_home_dir(), "/.bluefish/menudump_2", NULL);
189 +                       gchar *home_etc = getenv("HOME_ETC");
190 +                       gchar *shortcutfilename = g_strconcat(home_etc ? home_etc : g_get_home_dir(), "/.bluefish/menudump_2", NULL);
191                         gtk_accel_map_save(shortcutfilename);
192                         g_free(shortcutfilename);
193                 }
This page took 0.043087 seconds and 3 git commands to generate.