File dia_bugfixes.diff of Package dia
--- dia-0.94/app/app_procs.c
+++ dia-0.94/app/app_procs.c
@@ -99,6 +99,7 @@
const char *size);
static void create_user_dirs(void);
+static void create_user_files(void);
static PluginInitResult internal_plugin_init(PluginInfo *info);
static void process_opts(int argc, char **argv,
#ifdef HAVE_POPT
@@ -393,6 +394,7 @@
char *size = NULL;
gboolean made_conversions = FALSE;
GSList *files = NULL;
+ gchar *rcf;
#ifdef HAVE_POPT
poptContext poptCtx = NULL;
@@ -517,14 +519,17 @@
gdk_rgb_init();
- gtk_rc_parse("diagtkrc");
-
if (!nosplash) {
app_splash_init("");
}
}
create_user_dirs();
+ create_user_files();
+
+ rcf = dia_config_filename("diagtkrc");
+ gtk_rc_parse(rcf);
+ g_free(rcf);
/* Init cursors: */
if (dia_is_interactive) {
@@ -703,6 +708,25 @@
return TRUE;
}
+static void create_user_files(void)
+{
+ gchar *rc = NULL;
+
+ rc = dia_config_filename("diagtkrc");
+
+ /* If the file does not exist, we put in our defaults */
+ if (!g_file_test(rc, G_FILE_TEST_EXISTS)) {
+ FILE *f;
+
+ /* Never mind if it fails */
+ if ((f = fopen(rc, "w"))!= NULL) {
+ fprintf(f, "gtk-can-change-accels = 1");
+ fclose(f);
+ }
+ }
+ g_free(rc);
+}
+
static void create_user_dirs(void)
{
gchar *dir, *subdir;