comparison src/dialogs.c @ 262:07abf2ed6665

[gaim-migrate @ 272] Since everyone on sourceforge raised such a stink about having 3 dot-files in ~, I moved .gaimbdcache_<SN> to .gaim/<SN>.blist. I hope this makes people happy. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 25 May 2000 04:56:31 +0000
parents be4ac6d5c1b4
children 3b5b469d07f7
comparison
equal deleted inserted replaced
261:aebbe6ca6919 262:07abf2ed6665
2055 struct stat sbuf; 2055 struct stat sbuf;
2056 extern char g_screenname[]; 2056 extern char g_screenname[];
2057 2057
2058 file = getenv( "HOME" ); 2058 file = getenv( "HOME" );
2059 if ( file != (char *) NULL ) { 2059 if ( file != (char *) NULL ) {
2060 sprintf( path, "%s/.gaimbdcache_%s", file, g_screenname ); 2060 sprintf( path, "%s/.gaim/%s.blist", file, g_screenname );
2061 if ( !stat(path, &sbuf) ) 2061 if ( !stat(path, &sbuf) )
2062 ret = TRUE; 2062 ret = TRUE;
2063 } 2063 }
2064 return ret; 2064 return ret;
2065 } 2065 }
2066 2066
2067 /* if dummy is 0, save to ~/.gaimbdcache_screenname. Else, let user choose */ 2067 /* if dummy is 0, save to ~/.gaim/screenname.blist. Else, let user choose */
2068 2068
2069 void do_export(GtkWidget *w, void *dummy) 2069 void do_export(GtkWidget *w, void *dummy)
2070 { 2070 {
2071 FILE *f; 2071 FILE *f;
2072 gint show_dialog = (int) dummy; 2072 gint show_dialog = (int) dummy;
2079 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(exportdialog)); 2079 file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(exportdialog));
2080 strncpy( path, file, PATHSIZE - 1 ); 2080 strncpy( path, file, PATHSIZE - 1 );
2081 } 2081 }
2082 else { 2082 else {
2083 file = getenv( "HOME" ); 2083 file = getenv( "HOME" );
2084 if ( file != (char *) NULL ) 2084 if ( file != (char *) NULL ) {
2085 sprintf( path, "%s/.gaimbdcache_%s", file, g_screenname ); 2085 FILE *dir;
2086 else 2086 sprintf(buf, "%s/.gaim/");
2087 dir = fopen(buf, "r");
2088 if (!dir)
2089 mkdir(buf, S_IRUSR | S_IWUSR | S_IXUSR);
2090 else
2091 fclose(dir);
2092 sprintf( path, "%s/.gaim/%s.blist", file, g_screenname );
2093 } else
2087 return; 2094 return;
2088 } 2095 }
2089 if ((f = fopen(path,"w"))) { 2096 if ((f = fopen(path,"w"))) {
2090 serv_build_config(buf, 8192 - 1); 2097 serv_build_config(buf, 8192 - 1);
2091 fprintf(f, "%s\n", buf); 2098 fprintf(f, "%s\n", buf);
2132 gtk_widget_show(exportdialog); 2139 gtk_widget_show(exportdialog);
2133 gdk_window_raise(exportdialog->window); 2140 gdk_window_raise(exportdialog->window);
2134 2141
2135 } 2142 }
2136 2143
2137 /* if dummy is 0, then import from ~/.gaimbdcache_screenname, else let user 2144 /* if dummy is 0, then import from ~/.gaim/screenname.blist, else let user
2138 choose */ 2145 choose */
2139 2146
2140 void do_import(GtkWidget *w, void *dummy) 2147 void do_import(GtkWidget *w, void *dummy)
2141 { 2148 {
2142 gint show_dialog = (int) dummy; 2149 gint show_dialog = (int) dummy;
2154 strncpy( path, file, PATHSIZE - 1 ); 2161 strncpy( path, file, PATHSIZE - 1 );
2155 } 2162 }
2156 else { 2163 else {
2157 file = getenv( "HOME" ); 2164 file = getenv( "HOME" );
2158 if ( file != (char *) NULL ) 2165 if ( file != (char *) NULL )
2159 sprintf( path, "%s/.gaimbdcache_%s", file, g_screenname ); 2166 sprintf( path, "%s/.gaim/%s.blist", file, g_screenname );
2160 else 2167 else
2161 return; 2168 return;
2162 } 2169 }
2163 2170
2164 if (!(f = fopen(path,"r"))) { 2171 if (!(f = fopen(path,"r"))) {