@@ -379,67 +379,66 @@ static void lxappearance_save_gtkrc()
379
379
g_file_set_contents (gtkrc_files [0 ], content -> str , content -> len , NULL );
380
380
381
381
g_string_free (content , TRUE);
382
- g_free (file_path );
383
382
384
383
#else
385
384
386
- GKeyFile * content_gtk3 = g_key_file_new ();
387
- char * file_path_gtk3 = g_build_filename (g_get_user_config_dir (), "gtk-3.0" , NULL );
388
- char * file_path_settings = g_build_filename (file_path_gtk3 , "settings.ini" , NULL );
385
+ GKeyFile * content = g_key_file_new ();
386
+ char * file_path = g_build_filename (g_get_user_config_dir (), "gtk-3.0" , NULL );
387
+ char * file_path_settings = g_build_filename (file_path , "settings.ini" , NULL );
389
388
390
- if (!g_file_test (file_path_gtk3 , G_FILE_TEST_IS_DIR ))
389
+ if (!g_file_test (file_path , G_FILE_TEST_IS_DIR ))
391
390
{
392
- g_mkdir_with_parents (file_path_gtk3 , 0755 );
391
+ g_mkdir_with_parents (file_path , 0755 );
393
392
}
394
393
395
- g_key_file_load_from_file (content_gtk3 , file_path_settings , /* ignoring errors */
394
+ g_key_file_load_from_file (content , file_path_settings , /* ignoring errors */
396
395
G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS , NULL );
397
396
398
397
if (app .widget_theme )
399
- g_key_file_set_string (content_gtk3 , "Settings" ,
398
+ g_key_file_set_string (content , "Settings" ,
400
399
"gtk-theme-name" , app .widget_theme );
401
400
if (app .icon_theme )
402
- g_key_file_set_string (content_gtk3 , "Settings" ,
401
+ g_key_file_set_string (content , "Settings" ,
403
402
"gtk-icon-theme-name" , app .icon_theme );
404
403
if (app .default_font )
405
- g_key_file_set_string (content_gtk3 , "Settings" ,
404
+ g_key_file_set_string (content , "Settings" ,
406
405
"gtk-font-name" , app .default_font );
407
406
if (app .cursor_theme )
408
- g_key_file_set_string (content_gtk3 , "Settings" ,
407
+ g_key_file_set_string (content , "Settings" ,
409
408
"gtk-cursor-theme-name" , app .cursor_theme );
410
409
save_cursor_theme_name ();
411
410
412
- g_key_file_set_integer (content_gtk3 , "Settings" ,
411
+ g_key_file_set_integer (content , "Settings" ,
413
412
"gtk-cursor-theme-size" , app .cursor_theme_size );
414
- g_key_file_set_string (content_gtk3 , "Settings" ,
413
+ g_key_file_set_string (content , "Settings" ,
415
414
"gtk-toolbar-style" , tb_styles [app .toolbar_style ]);
416
- g_key_file_set_string (content_gtk3 , "Settings" ,
415
+ g_key_file_set_string (content , "Settings" ,
417
416
"gtk-toolbar-icon-size" , tb_icon_sizes [app .toolbar_icon_size ]);
418
- g_key_file_set_integer (content_gtk3 , "Settings" ,
417
+ g_key_file_set_integer (content , "Settings" ,
419
418
"gtk-button-images" , app .button_images ? 1 : 0 );
420
- g_key_file_set_integer (content_gtk3 , "Settings" ,
419
+ g_key_file_set_integer (content , "Settings" ,
421
420
"gtk-menu-images" , app .menu_images ? 1 : 0 );
422
- g_key_file_set_integer (content_gtk3 , "Settings" ,
421
+ g_key_file_set_integer (content , "Settings" ,
423
422
"gtk-enable-event-sounds" , app .enable_event_sound ? 1 : 0 );
424
- g_key_file_set_integer (content_gtk3 , "Settings" ,
423
+ g_key_file_set_integer (content , "Settings" ,
425
424
"gtk-enable-input-feedback-sounds" , app .enable_input_feedback ? 1 : 0 );
426
- g_key_file_set_integer (content_gtk3 , "Settings" ,
425
+ g_key_file_set_integer (content , "Settings" ,
427
426
"gtk-xft-antialias" , app .enable_antialising ? 1 : 0 );
428
- g_key_file_set_integer (content_gtk3 , "Settings" ,
427
+ g_key_file_set_integer (content , "Settings" ,
429
428
"gtk-xft-hinting" , app .enable_hinting ? 1 : 0 );
430
429
431
430
if (app .hinting_style )
432
- g_key_file_set_string (content_gtk3 , "Settings" ,
431
+ g_key_file_set_string (content , "Settings" ,
433
432
"gtk-xft-hintstyle" , app .hinting_style );
434
433
435
434
if (app .font_rgba )
436
- g_key_file_set_string (content_gtk3 , "Settings" ,
435
+ g_key_file_set_string (content , "Settings" ,
437
436
"gtk-xft-rgba" , app .font_rgba );
438
437
439
438
if (app .modules && app .modules [0 ])
440
- g_key_file_set_string (content_gtk3 , "Settings" , "gtk-modules" , app .modules );
439
+ g_key_file_set_string (content , "Settings" , "gtk-modules" , app .modules );
441
440
else
442
- g_key_file_remove_key (content_gtk3 , "Settings" , "gtk-modules" , NULL );
441
+ g_key_file_remove_key (content , "Settings" , "gtk-modules" , NULL );
443
442
444
443
#if 0
445
444
/* unfortunately we cannot set colors without XSETTINGS daemon,
@@ -448,30 +447,31 @@ static void lxappearance_save_gtkrc()
448
447
if (app .color_scheme )
449
448
{
450
449
char * escaped = g_strescape (app .color_scheme , NULL );
451
- g_string_append_printf (content_gtk3 ,
450
+ g_string_append_printf (content ,
452
451
"gtk-color-scheme=%s\n" ,
453
452
escaped );
454
453
g_free (escaped );
455
454
}
456
455
#endif
457
456
458
457
#if GLIB_CHECK_VERSION (2 , 40 , 0 )
459
- g_key_file_save_to_file (content_gtk3 , file_path_settings , NULL );
458
+ g_key_file_save_to_file (content , file_path_settings , NULL );
460
459
#else
461
460
char * contents ;
462
461
gsize s ;
463
462
464
- contents = g_key_file_to_data (content_gtk3 , & s , NULL );
463
+ contents = g_key_file_to_data (content , & s , NULL );
465
464
if (contents )
466
465
g_file_set_contents (file_path_settings , contents , s , NULL );
467
466
g_free (contents );
468
467
#endif
469
468
470
- g_free (file_path_gtk3 );
471
469
g_free (file_path_settings );
472
- g_key_file_free (content_gtk3 );
470
+ g_key_file_free (content );
473
471
474
472
#endif
473
+
474
+ g_free (file_path );
475
475
}
476
476
477
477
static void lxappearance_save_lxsession ()
0 commit comments