]> git.pld-linux.org Git - packages/gg.git/blob - gg-home_etc.patch
- forgot one thing... now it works
[packages/gg.git] / gg-home_etc.patch
1 diff -Nur gg-0.2.2.1.orig/src/callbacks.c gg-0.2.2.1/src/callbacks.c
2 --- gg-0.2.2.1.orig/src/callbacks.c     Wed May  1 10:07:08 2002
3 +++ gg-0.2.2.1/src/callbacks.c  Wed May 29 13:43:33 2002
4 @@ -408,7 +408,7 @@
5                 gchar *path;
6  
7                 path =
8 -                   g_strdup_printf("%s/.gg/history/%d", getenv("HOME"),
9 +                   g_strdup_printf("%s/history/%d", config.homedir,
10                                     kontakt->uin);
11                 fp = fopen(path, "r");
12                 if (fp) {
13 diff -Nur gg-0.2.2.1.orig/src/gg-types.h gg-0.2.2.1/src/gg-types.h
14 --- gg-0.2.2.1.orig/src/gg-types.h      Mon Apr 22 11:59:01 2002
15 +++ gg-0.2.2.1/src/gg-types.h   Wed May 29 13:34:54 2002
16 @@ -61,6 +61,7 @@
17         guint save_config_on_exit;
18         guint save_contacts_on_exit;
19         gchar *server;
20 +       gchar *homedir;
21  } GGConfig;
22  
23  typedef struct {
24 diff -Nur gg-0.2.2.1.orig/src/gg.c gg-0.2.2.1/src/gg.c
25 --- gg-0.2.2.1.orig/src/gg.c    Fri Apr 19 16:04:50 2002
26 +++ gg-0.2.2.1/src/gg.c Wed May 29 13:43:09 2002
27 @@ -407,12 +407,12 @@
28         gchar *path, *timestamp, *lognick;
29         FILE *fp;
30  
31 -       path = g_strdup_printf("%s/.gg/history", getenv("HOME"));
32 +       path = g_strdup_printf("%s/history", config.homedir);
33         mkdir(path, 0755);
34         g_free(path);
35  
36         path =
37 -           g_strdup_printf("%s/.gg/history/%d", getenv("HOME"), sess_uin);
38 +           g_strdup_printf("%s/history/%d", config.homedir, sess_uin);
39         fp = fopen(path, "a");
40         g_free(path);
41  
42 diff -Nur gg-0.2.2.1.orig/src/main.c gg-0.2.2.1/src/main.c
43 --- gg-0.2.2.1.orig/src/main.c  Mon Apr 22 11:59:01 2002
44 +++ gg-0.2.2.1/src/main.c       Wed May 29 13:39:50 2002
45 @@ -80,7 +80,7 @@
46         FILE *fp;
47         GList *tmplist;
48  
49 -       path = g_strconcat(g_get_home_dir(), "/.gg/userlist", NULL);
50 +       path = g_strconcat(config.homedir, "/userlist", NULL);
51  
52         fp = fopen(path, "w");
53  
54 @@ -139,7 +139,7 @@
55         }
56         gtk_clist_clear(GTK_CLIST(lista));
57  
58 -       path = g_strconcat(getenv("HOME"), "/.gg/userlist", NULL);
59 +       path = g_strconcat(config.homedir, "/userlist", NULL);
60  
61         fp = fopen(path, "r");
62  
63 @@ -271,7 +271,7 @@
64         config.save_contacts_on_exit = 1;
65         config.server = g_strdup(GG_DEFAULT_HOST);
66                 
67 -       path = g_strconcat(getenv("HOME"), "/.gg/config", NULL);
68 +       path = g_strconcat(config.homedir, "/config", NULL);
69  
70         g_list_free(ignore);
71  
72 @@ -431,7 +431,7 @@
73             config.width=window->allocation.width;
74             config.height=window->allocation.height;
75         }
76 -       path = g_strconcat(getenv("HOME"), "/.gg/config", NULL);
77 +       path = g_strconcat(config.homedir, "/config", NULL);
78  
79         fp = fopen(path, "w");
80  
81 @@ -572,12 +572,16 @@
82  #ifdef USE_APPLET
83         gchar applet_name[] = "gg";
84  #endif
85 -       gchar *path = NULL;
86  
87 -       path = g_strconcat(getenv("HOME"), "/.gg", NULL);
88 -       mkdir(path, 0755);
89 -       g_free(path);
90 +       config.homedir = NULL;
91 +       if (getenv("CONFIG_DIR"))
92 +           config.homedir = g_strconcat(getenv("HOME"),"/", 
93 +               getenv("CONFIG_DIR"), "/gg", NULL);
94 +       else
95 +           config.homedir = g_strconcat(getenv("HOME"), "/.gg", NULL);
96  
97 +       mkdir(config.homedir, 0700);
98 +       
99         read_config();
100  
101         g_set_print_handler((GPrintFunc) my_g_print);
102 @@ -649,5 +653,7 @@
103         gtk_main();
104  #endif
105  
106 +       g_free(config.homedir);
107 +       
108         return 0;
109  }
This page took 0.140098 seconds and 3 git commands to generate.