Mercurial > geeqie
comparison src/rcfile.c @ 318:b16b9b8979e5
Add a new struct ConfOptions to handle options.
Changes were made among the code to use only one global var
named "options" of type ConfOptions *.
Initialization takes place in new init_options().
author | zas_ |
---|---|
date | Fri, 11 Apr 2008 22:14:36 +0000 |
parents | 667e49f52168 |
children | f9611a6cf0e2 |
comparison
equal
deleted
inserted
replaced
317:46169c246c51 | 318:b16b9b8979e5 |
---|---|
288 write_bool_option(ssi, "lazy_image_sync", lazy_image_sync); | 288 write_bool_option(ssi, "lazy_image_sync", lazy_image_sync); |
289 write_bool_option(ssi, "update_on_time_change", update_on_time_change); | 289 write_bool_option(ssi, "update_on_time_change", update_on_time_change); |
290 write_bool_option(ssi, "exif_auto_rotate", exif_rotate_enable); | 290 write_bool_option(ssi, "exif_auto_rotate", exif_rotate_enable); |
291 secure_fputc(ssi, '\n'); | 291 secure_fputc(ssi, '\n'); |
292 | 292 |
293 write_bool_option(ssi, "enable_startup_path", startup_path_enable); | 293 write_bool_option(ssi, "enable_startup_path", options->startup_path_enable); |
294 write_char_option(ssi, "startup_path", startup_path); | 294 write_char_option(ssi, "startup_path", options->startup_path); |
295 secure_fputc(ssi, '\n'); | 295 secure_fputc(ssi, '\n'); |
296 | 296 |
297 secure_fprintf(ssi, "zoom_mode: "); | 297 secure_fprintf(ssi, "zoom_mode: "); |
298 if (zoom_mode == ZOOM_RESET_ORIGINAL) secure_fprintf(ssi, "original\n"); | 298 if (options->zoom_mode == ZOOM_RESET_ORIGINAL) secure_fprintf(ssi, "original\n"); |
299 if (zoom_mode == ZOOM_RESET_FIT_WINDOW) secure_fprintf(ssi, "fit\n"); | 299 if (options->zoom_mode == ZOOM_RESET_FIT_WINDOW) secure_fprintf(ssi, "fit\n"); |
300 if (zoom_mode == ZOOM_RESET_NONE) secure_fprintf(ssi, "dont_change\n"); | 300 if (options->zoom_mode == ZOOM_RESET_NONE) secure_fprintf(ssi, "dont_change\n"); |
301 write_bool_option(ssi, "two_pass_scaling", two_pass_zoom); | 301 write_bool_option(ssi, "two_pass_scaling", options->two_pass_zoom); |
302 write_bool_option(ssi, "zoom_to_fit_allow_expand", zoom_to_fit_expands); | 302 write_bool_option(ssi, "zoom_to_fit_allow_expand", options->zoom_to_fit_expands); |
303 secure_fputc(ssi, '\n'); | 303 secure_fputc(ssi, '\n'); |
304 | 304 |
305 write_bool_option(ssi, "fit_window_to_image", fit_window); | 305 write_bool_option(ssi, "fit_window_to_image", options->fit_window); |
306 write_bool_option(ssi, "limit_window_size", limit_window_size); | 306 write_bool_option(ssi, "limit_window_size", options->limit_window_size); |
307 write_int_option(ssi, "max_window_size", max_window_size); | 307 write_int_option(ssi, "max_window_size", options->max_window_size); |
308 write_bool_option(ssi, "limit_autofit_size", limit_autofit_size); | 308 write_bool_option(ssi, "limit_autofit_size", options->limit_autofit_size); |
309 write_int_option(ssi, "max_autofit_size", max_autofit_size); | 309 write_int_option(ssi, "max_autofit_size", options->max_autofit_size); |
310 secure_fputc(ssi, '\n'); | 310 secure_fputc(ssi, '\n'); |
311 | 311 |
312 write_bool_option(ssi, "progressive_keyboard_scrolling", progressive_key_scrolling); | 312 write_bool_option(ssi, "progressive_keyboard_scrolling", options->progressive_key_scrolling); |
313 write_int_option(ssi, "scroll_reset_method", scroll_reset_method); | 313 write_int_option(ssi, "scroll_reset_method", options->scroll_reset_method); |
314 secure_fputc(ssi, '\n'); | 314 secure_fputc(ssi, '\n'); |
315 | 315 |
316 write_bool_option(ssi, "enable_thumbnails", thumbnails_enabled); | 316 write_bool_option(ssi, "enable_thumbnails", options->thumbnails_enabled); |
317 write_int_option(ssi, "thumbnail_width", thumb_max_width); | 317 write_int_option(ssi, "thumbnail_width", options->thumb_max_width); |
318 write_int_option(ssi, "thumbnail_height", thumb_max_height); | 318 write_int_option(ssi, "thumbnail_height", options->thumb_max_height); |
319 write_bool_option(ssi, "cache_thumbnails", enable_thumb_caching); | 319 write_bool_option(ssi, "cache_thumbnails", options->enable_thumb_caching); |
320 write_bool_option(ssi, "cache_thumbnails_into_dirs", enable_thumb_dirs); | 320 write_bool_option(ssi, "cache_thumbnails_into_dirs", options->enable_thumb_dirs); |
321 write_bool_option(ssi, "thumbnail_fast", thumbnail_fast); | 321 write_bool_option(ssi, "thumbnail_fast", options->thumbnail_fast); |
322 write_bool_option(ssi, "use_xvpics_thumbnails", use_xvpics_thumbnails); | 322 write_bool_option(ssi, "use_xvpics_thumbnails", options->use_xvpics_thumbnails); |
323 write_bool_option(ssi, "thumbnail_spec_standard", thumbnail_spec_standard); | 323 write_bool_option(ssi, "thumbnail_spec_standard", options->thumbnail_spec_standard); |
324 secure_fputc(ssi, '\n'); | 324 secure_fputc(ssi, '\n'); |
325 | 325 |
326 write_bool_option(ssi, "local_metadata", enable_metadata_dirs); | 326 write_bool_option(ssi, "local_metadata", options->enable_metadata_dirs); |
327 secure_fputc(ssi, '\n'); | 327 secure_fputc(ssi, '\n'); |
328 | 328 |
329 write_int_option(ssi, "sort_method", (gint)file_sort_method); | 329 write_int_option(ssi, "sort_method", (gint)options->file_sort_method); |
330 write_bool_option(ssi, "sort_ascending", file_sort_ascending); | 330 write_bool_option(ssi, "sort_ascending", options->file_sort_ascending); |
331 write_bool_option(ssi, "sort_case_sensitive", file_sort_case_sensitive); | 331 write_bool_option(ssi, "sort_case_sensitive", file_sort_case_sensitive); |
332 secure_fputc(ssi, '\n'); | 332 secure_fputc(ssi, '\n'); |
333 | 333 |
334 write_bool_option(ssi, "confirm_delete", confirm_delete); | 334 write_bool_option(ssi, "confirm_delete", options->confirm_delete); |
335 write_bool_option(ssi, "enable_delete_key", enable_delete_key); | 335 write_bool_option(ssi, "enable_delete_key", options->enable_delete_key); |
336 write_bool_option(ssi, "safe_delete", safe_delete_enable); | 336 write_bool_option(ssi, "safe_delete", options->safe_delete_enable); |
337 write_char_option(ssi, "safe_delete_path", safe_delete_path); | 337 write_char_option(ssi, "safe_delete_path", options->safe_delete_path); |
338 write_int_option(ssi, "safe_delete_size", safe_delete_size); | 338 write_int_option(ssi, "safe_delete_size", options->safe_delete_size); |
339 secure_fputc(ssi, '\n'); | 339 secure_fputc(ssi, '\n'); |
340 | 340 |
341 write_bool_option(ssi, "tools_float", tools_float); | 341 write_bool_option(ssi, "tools_float", options->tools_float); |
342 write_bool_option(ssi, "tools_hidden", tools_hidden); | 342 write_bool_option(ssi, "tools_hidden", options->tools_hidden); |
343 write_bool_option(ssi, "restore_tool_state", restore_tool); | 343 write_bool_option(ssi, "restore_tool_state", options->restore_tool); |
344 write_bool_option(ssi, "toolbar_hidden", toolbar_hidden); | 344 write_bool_option(ssi, "toolbar_hidden", options->toolbar_hidden); |
345 secure_fputc(ssi, '\n'); | 345 secure_fputc(ssi, '\n'); |
346 | 346 |
347 write_bool_option(ssi, "mouse_wheel_scrolls", mousewheel_scrolls); | 347 write_bool_option(ssi, "mouse_wheel_scrolls", options->mousewheel_scrolls); |
348 write_bool_option(ssi, "in_place_rename", enable_in_place_rename); | 348 write_bool_option(ssi, "in_place_rename", options->enable_in_place_rename); |
349 write_int_option(ssi, "open_recent_max", recent_list_max); | 349 write_int_option(ssi, "open_recent_max", options->recent_list_max); |
350 write_int_option(ssi, "image_cache_size_max", tile_cache_max); | 350 write_int_option(ssi, "image_cache_size_max", options->tile_cache_max); |
351 write_int_option(ssi, "thumbnail_quality", thumbnail_quality); | 351 write_int_option(ssi, "thumbnail_quality", options->thumbnail_quality); |
352 write_int_option(ssi, "zoom_quality", zoom_quality); | 352 write_int_option(ssi, "zoom_quality", options->zoom_quality); |
353 write_int_option(ssi, "dither_quality", dither_quality); | 353 write_int_option(ssi, "dither_quality", options->dither_quality); |
354 write_int_option(ssi, "zoom_increment", zoom_increment); | 354 write_int_option(ssi, "zoom_increment", options->zoom_increment); |
355 write_bool_option(ssi, "enable_read_ahead", enable_read_ahead); | 355 write_bool_option(ssi, "enable_read_ahead", options->enable_read_ahead); |
356 write_bool_option(ssi, "display_dialogs_under_mouse", place_dialogs_under_mouse); | 356 write_bool_option(ssi, "display_dialogs_under_mouse", options->place_dialogs_under_mouse); |
357 secure_fputc(ssi, '\n'); | 357 secure_fputc(ssi, '\n'); |
358 | 358 |
359 write_bool_option(ssi, "user_specified_window_background", user_specified_window_background); | 359 write_bool_option(ssi, "user_specified_window_background", options->user_specified_window_background); |
360 write_color_option(ssi, "window_background_color", &window_background_color); | 360 write_color_option(ssi, "window_background_color", &options->window_background_color); |
361 secure_fputc(ssi, '\n'); | 361 secure_fputc(ssi, '\n'); |
362 | 362 |
363 write_int_option(ssi, "fullscreen_screen", fullscreen_screen); | 363 write_int_option(ssi, "fullscreen_screen", options->fullscreen_screen); |
364 write_bool_option(ssi, "fullscreen_clean_flip", fullscreen_clean_flip); | 364 write_bool_option(ssi, "fullscreen_clean_flip", options->fullscreen_clean_flip); |
365 write_bool_option(ssi, "fullscreen_disable_saver", fullscreen_disable_saver); | 365 write_bool_option(ssi, "fullscreen_disable_saver", options->fullscreen_disable_saver); |
366 write_bool_option(ssi, "fullscreen_above", fullscreen_above); | 366 write_bool_option(ssi, "fullscreen_above", options->fullscreen_above); |
367 write_bool_option(ssi, "show_fullscreen_info", show_fullscreen_info); | 367 write_bool_option(ssi, "show_fullscreen_info", options->show_fullscreen_info); |
368 write_char_option(ssi, "fullscreen_info", fullscreen_info); | 368 write_char_option(ssi, "fullscreen_info", options->fullscreen_info); |
369 secure_fputc(ssi, '\n'); | 369 secure_fputc(ssi, '\n'); |
370 | 370 |
371 write_int_option(ssi, "custom_similarity_threshold", dupe_custom_threshold); | 371 write_int_option(ssi, "custom_similarity_threshold", options->dupe_custom_threshold); |
372 | 372 |
373 secure_fprintf(ssi, "\n##### Slideshow Options #####\n\n"); | 373 secure_fprintf(ssi, "\n##### Slideshow Options #####\n\n"); |
374 | 374 |
375 write_int_unit_option(ssi, "slideshow_delay", slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION); | 375 write_int_unit_option(ssi, "slideshow_delay", options->slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION); |
376 | 376 |
377 write_bool_option(ssi, "slideshow_random", slideshow_random); | 377 write_bool_option(ssi, "slideshow_random", options->slideshow_random); |
378 write_bool_option(ssi, "slideshow_repeat", slideshow_repeat); | 378 write_bool_option(ssi, "slideshow_repeat", options->slideshow_repeat); |
379 | 379 |
380 secure_fprintf(ssi, "\n##### Filtering Options #####\n\n"); | 380 secure_fprintf(ssi, "\n##### Filtering Options #####\n\n"); |
381 | 381 |
382 write_bool_option(ssi, "show_dotfiles", show_dot_files); | 382 write_bool_option(ssi, "show_dotfiles", options->show_dot_files); |
383 write_bool_option(ssi, "disable_filtering", file_filter_disable); | 383 write_bool_option(ssi, "disable_filtering", options->file_filter_disable); |
384 | 384 |
385 filter_write_list(ssi); | 385 filter_write_list(ssi); |
386 | 386 |
387 sidecar_ext_write(ssi); | 387 sidecar_ext_write(ssi); |
388 | 388 |
416 secure_fprintf(ssi, "# Maximum of 10 programs (external_1 through external_10)\n"); | 416 secure_fprintf(ssi, "# Maximum of 10 programs (external_1 through external_10)\n"); |
417 secure_fprintf(ssi, "# format: external_n: \"menu name\" \"command line\"\n\n"); | 417 secure_fprintf(ssi, "# format: external_n: \"menu name\" \"command line\"\n\n"); |
418 | 418 |
419 for (i = 0; i < GQ_EDITOR_SLOTS; i++) | 419 for (i = 0; i < GQ_EDITOR_SLOTS; i++) |
420 { | 420 { |
421 gchar *qname = escquote_value(editor_name[i]); | 421 gchar *qname = escquote_value(options->editor_name[i]); |
422 gchar *qcommand = escquote_value(editor_command[i]); | 422 gchar *qcommand = escquote_value(options->editor_command[i]); |
423 secure_fprintf(ssi, "external_%d: %s %s\n", i+1, qname, qcommand); | 423 secure_fprintf(ssi, "external_%d: %s %s\n", i+1, qname, qcommand); |
424 g_free(qname); | 424 g_free(qname); |
425 g_free(qcommand); | 425 g_free(qcommand); |
426 } | 426 } |
427 | 427 |
428 secure_fprintf(ssi, "\n##### Collection Options #####\n\n"); | 428 secure_fprintf(ssi, "\n##### Collection Options #####\n\n"); |
429 | 429 |
430 write_bool_option(ssi, "rectangular_selections", collection_rectangular_selection); | 430 write_bool_option(ssi, "rectangular_selections", options->collection_rectangular_selection); |
431 | 431 |
432 secure_fprintf(ssi, "\n##### Window Positions #####\n\n"); | 432 secure_fprintf(ssi, "\n##### Window Positions #####\n\n"); |
433 | 433 |
434 write_bool_option(ssi, "restore_window_positions", save_window_positions); | 434 write_bool_option(ssi, "restore_window_positions", options->save_window_positions); |
435 secure_fputc(ssi, '\n'); | 435 secure_fputc(ssi, '\n'); |
436 write_int_option(ssi, "main_window_x", main_window_x); | 436 write_int_option(ssi, "main_window_x", options->main_window_x); |
437 write_int_option(ssi, "main_window_y", main_window_y); | 437 write_int_option(ssi, "main_window_y", options->main_window_y); |
438 write_int_option(ssi, "main_window_width", main_window_w); | 438 write_int_option(ssi, "main_window_width", options->main_window_w); |
439 write_int_option(ssi, "main_window_height", main_window_h); | 439 write_int_option(ssi, "main_window_height", options->main_window_h); |
440 write_bool_option(ssi, "main_window_maximized", main_window_maximized); | 440 write_bool_option(ssi, "main_window_maximized", options->main_window_maximized); |
441 write_int_option(ssi, "float_window_x", float_window_x); | 441 write_int_option(ssi, "float_window_x", options->float_window_x); |
442 write_int_option(ssi, "float_window_y", float_window_y); | 442 write_int_option(ssi, "float_window_y", options->float_window_y); |
443 write_int_option(ssi, "float_window_width", float_window_w); | 443 write_int_option(ssi, "float_window_width", options->float_window_w); |
444 write_int_option(ssi, "float_window_height", float_window_h); | 444 write_int_option(ssi, "float_window_height", options->float_window_h); |
445 write_int_option(ssi, "float_window_divider", float_window_divider); | 445 write_int_option(ssi, "float_window_divider", options->float_window_divider); |
446 write_int_option(ssi, "divider_position_h", window_hdivider_pos); | 446 write_int_option(ssi, "divider_position_h", options->window_hdivider_pos); |
447 write_int_option(ssi, "divider_position_v", window_vdivider_pos); | 447 write_int_option(ssi, "divider_position_v", options->window_vdivider_pos); |
448 | 448 |
449 secure_fprintf(ssi, "\n##### Exif #####\n# 0: never\n# 1: if set\n# 2: always\n\n"); | 449 secure_fprintf(ssi, "\n##### Exif #####\n# 0: never\n# 1: if set\n# 2: always\n\n"); |
450 for (i = 0; ExifUIList[i].key; i++) | 450 for (i = 0; ExifUIList[i].key; i++) |
451 { | 451 { |
452 secure_fprintf(ssi, "exif_"); | 452 secure_fprintf(ssi, "exif_"); |
545 update_on_time_change = read_bool_option(f, option, | 545 update_on_time_change = read_bool_option(f, option, |
546 "update_on_time_change", value, update_on_time_change); | 546 "update_on_time_change", value, update_on_time_change); |
547 exif_rotate_enable = read_bool_option(f, option, | 547 exif_rotate_enable = read_bool_option(f, option, |
548 "exif_auto_rotate", value, exif_rotate_enable); | 548 "exif_auto_rotate", value, exif_rotate_enable); |
549 | 549 |
550 startup_path_enable = read_bool_option(f, option, | 550 options->startup_path_enable = read_bool_option(f, option, |
551 "enable_startup_path", value, startup_path_enable); | 551 "enable_startup_path", value, options->startup_path_enable); |
552 startup_path = read_char_option(f, option, | 552 options->startup_path = read_char_option(f, option, |
553 "startup_path", value_all, startup_path); | 553 "startup_path", value_all, options->startup_path); |
554 | 554 |
555 if (strcasecmp(option,"zoom_mode") == 0) | 555 if (strcasecmp(option, "zoom_mode") == 0) |
556 { | 556 { |
557 if (strcasecmp(value, "original") == 0) zoom_mode = ZOOM_RESET_ORIGINAL; | 557 if (strcasecmp(value, "original") == 0) options->zoom_mode = ZOOM_RESET_ORIGINAL; |
558 if (strcasecmp(value, "fit") == 0) zoom_mode = ZOOM_RESET_FIT_WINDOW; | 558 if (strcasecmp(value, "fit") == 0) options->zoom_mode = ZOOM_RESET_FIT_WINDOW; |
559 if (strcasecmp(value, "dont_change") == 0) zoom_mode = ZOOM_RESET_NONE; | 559 if (strcasecmp(value, "dont_change") == 0) options->zoom_mode = ZOOM_RESET_NONE; |
560 } | 560 } |
561 two_pass_zoom = read_bool_option(f, option, | 561 options->two_pass_zoom = read_bool_option(f, option, |
562 "two_pass_scaling", value, two_pass_zoom); | 562 "two_pass_scaling", value, options->two_pass_zoom); |
563 zoom_to_fit_expands = read_bool_option(f, option, | 563 options->zoom_to_fit_expands = read_bool_option(f, option, |
564 "zoom_to_fit_allow_expand", value, zoom_to_fit_expands); | 564 "zoom_to_fit_allow_expand", value, options->zoom_to_fit_expands); |
565 | 565 |
566 fit_window = read_bool_option(f, option, | 566 options->fit_window = read_bool_option(f, option, |
567 "fit_window_to_image", value, fit_window); | 567 "fit_window_to_image", value, options->fit_window); |
568 limit_window_size = read_bool_option(f, option, | 568 options->limit_window_size = read_bool_option(f, option, |
569 "limit_window_size", value, limit_window_size); | 569 "limit_window_size", value, options->limit_window_size); |
570 max_window_size = read_int_option(f, option, | 570 options->max_window_size = read_int_option(f, option, |
571 "max_window_size", value, max_window_size); | 571 "max_window_size", value, options->max_window_size); |
572 limit_autofit_size = read_bool_option(f, option, | 572 options->limit_autofit_size = read_bool_option(f, option, |
573 "limit_autofit_size", value, limit_autofit_size); | 573 "limit_autofit_size", value, options->limit_autofit_size); |
574 max_autofit_size = read_int_option(f, option, | 574 options->max_autofit_size = read_int_option(f, option, |
575 "max_autofit_size", value, max_autofit_size); | 575 "max_autofit_size", value, options->max_autofit_size); |
576 progressive_key_scrolling = read_bool_option(f, option, | 576 options->progressive_key_scrolling = read_bool_option(f, option, |
577 "progressive_keyboard_scrolling", value, progressive_key_scrolling); | 577 "progressive_keyboard_scrolling", value, options->progressive_key_scrolling); |
578 scroll_reset_method = read_int_option(f, option, | 578 options->scroll_reset_method = read_int_option(f, option, |
579 "scroll_reset_method", value, scroll_reset_method); | 579 "scroll_reset_method", value, options->scroll_reset_method); |
580 | 580 |
581 thumbnails_enabled = read_bool_option(f, option, | 581 options->thumbnails_enabled = read_bool_option(f, option, |
582 "enable_thumbnails", value, thumbnails_enabled); | 582 "enable_thumbnails", value, options->thumbnails_enabled); |
583 thumb_max_width = read_int_option(f, option, | 583 options->thumb_max_width = read_int_option(f, option, |
584 "thumbnail_width", value, thumb_max_width); | 584 "thumbnail_width", value, options->thumb_max_width); |
585 if (thumb_max_width < 16) thumb_max_width = 16; | 585 if (options->thumb_max_width < 16) options->thumb_max_width = 16; |
586 thumb_max_height = read_int_option(f, option, | 586 options->thumb_max_height = read_int_option(f, option, |
587 "thumbnail_height", value, thumb_max_height); | 587 "thumbnail_height", value, options->thumb_max_height); |
588 if (thumb_max_height < 16) thumb_max_height = 16; | 588 if (options->thumb_max_height < 16) options->thumb_max_height = 16; |
589 enable_thumb_caching = read_bool_option(f, option, | 589 options->enable_thumb_caching = read_bool_option(f, option, |
590 "cache_thumbnails", value, enable_thumb_caching); | 590 "cache_thumbnails", value, options->enable_thumb_caching); |
591 enable_thumb_dirs = read_bool_option(f, option, | 591 options->enable_thumb_dirs = read_bool_option(f, option, |
592 "cache_thumbnails_into_dirs", value, enable_thumb_dirs); | 592 "cache_thumbnails_into_dirs", value, options->enable_thumb_dirs); |
593 thumbnail_fast = read_bool_option(f, option, | 593 options->thumbnail_fast = read_bool_option(f, option, |
594 "thumbnail_fast", value, thumbnail_fast); | 594 "thumbnail_fast", value, options->thumbnail_fast); |
595 use_xvpics_thumbnails = read_bool_option(f, option, | 595 options->use_xvpics_thumbnails = read_bool_option(f, option, |
596 "use_xvpics_thumbnails", value, use_xvpics_thumbnails); | 596 "use_xvpics_thumbnails", value, options->use_xvpics_thumbnails); |
597 thumbnail_spec_standard = read_bool_option(f, option, | 597 options->thumbnail_spec_standard = read_bool_option(f, option, |
598 "thumbnail_spec_standard", value, thumbnail_spec_standard); | 598 "thumbnail_spec_standard", value, options->thumbnail_spec_standard); |
599 | 599 |
600 enable_metadata_dirs = read_bool_option(f, option, | 600 options->enable_metadata_dirs = read_bool_option(f, option, |
601 "local_metadata", value, enable_metadata_dirs); | 601 "local_metadata", value, options->enable_metadata_dirs); |
602 | 602 |
603 file_sort_method = (SortType)read_int_option(f, option, | 603 options->file_sort_method = (SortType)read_int_option(f, option, |
604 "sort_method", value, (gint)file_sort_method); | 604 "sort_method", value, (gint)options->file_sort_method); |
605 file_sort_ascending = read_bool_option(f, option, | 605 options->file_sort_ascending = read_bool_option(f, option, |
606 "sort_ascending", value, file_sort_ascending); | 606 "sort_ascending", value, options->file_sort_ascending); |
607 file_sort_case_sensitive = read_bool_option(f, option, | 607 file_sort_case_sensitive = read_bool_option(f, option, |
608 "sort_case_sensitive", value, file_sort_case_sensitive); | 608 "sort_case_sensitive", value, file_sort_case_sensitive); |
609 | 609 |
610 confirm_delete = read_bool_option(f, option, | 610 options->confirm_delete = read_bool_option(f, option, |
611 "confirm_delete", value, confirm_delete); | 611 "confirm_delete", value, options->confirm_delete); |
612 enable_delete_key = read_bool_option(f, option, | 612 options->enable_delete_key = read_bool_option(f, option, |
613 "enable_delete_key", value, enable_delete_key); | 613 "enable_delete_key", value, options->enable_delete_key); |
614 safe_delete_enable = read_bool_option(f, option, | 614 options->safe_delete_enable = read_bool_option(f, option, |
615 "safe_delete", value, safe_delete_enable); | 615 "safe_delete", value, options->safe_delete_enable); |
616 safe_delete_path = read_char_option(f, option, | 616 options->safe_delete_path = read_char_option(f, option, |
617 "safe_delete_path", value, safe_delete_path); | 617 "safe_delete_path", value, options->safe_delete_path); |
618 safe_delete_size = read_int_option(f, option, | 618 options->safe_delete_size = read_int_option(f, option, |
619 "safe_delete_size", value, safe_delete_size); | 619 "safe_delete_size", value,options->safe_delete_size); |
620 | 620 |
621 tools_float = read_bool_option(f, option, | 621 options->tools_float = read_bool_option(f, option, |
622 "tools_float", value, tools_float); | 622 "tools_float", value, options->tools_float); |
623 tools_hidden = read_bool_option(f, option, | 623 options->tools_hidden = read_bool_option(f, option, |
624 "tools_hidden", value, tools_hidden); | 624 "tools_hidden", value, options->tools_hidden); |
625 restore_tool = read_bool_option(f, option, | 625 options->restore_tool = read_bool_option(f, option, |
626 "restore_tool_state", value, restore_tool); | 626 "restore_tool_state", value, options->restore_tool); |
627 | 627 |
628 toolbar_hidden = read_bool_option(f, option, | 628 options->toolbar_hidden = read_bool_option(f, option, |
629 "toolbar_hidden", value, toolbar_hidden); | 629 "toolbar_hidden", value, options->toolbar_hidden); |
630 | 630 |
631 mousewheel_scrolls = read_bool_option(f, option, | 631 options->mousewheel_scrolls = read_bool_option(f, option, |
632 "mouse_wheel_scrolls", value, mousewheel_scrolls); | 632 "mouse_wheel_scrolls", value, options->mousewheel_scrolls); |
633 enable_in_place_rename = read_bool_option(f, option, | 633 options->enable_in_place_rename = read_bool_option(f, option, |
634 "in_place_rename", value, enable_in_place_rename); | 634 "in_place_rename", value, options->enable_in_place_rename); |
635 | 635 |
636 recent_list_max = read_int_option(f, option, | 636 options->recent_list_max = read_int_option(f, option, |
637 "open_recent_max", value, recent_list_max); | 637 "open_recent_max", value, options->recent_list_max); |
638 | 638 |
639 tile_cache_max = read_int_option(f, option, | 639 options->tile_cache_max = read_int_option(f, option, |
640 "image_cache_size_max", value, tile_cache_max); | 640 "image_cache_size_max", value, options->tile_cache_max); |
641 | 641 |
642 thumbnail_quality = CLAMP(read_int_option(f, option, | 642 options->thumbnail_quality = CLAMP(read_int_option(f, option, |
643 "thumbnail_quality", value, thumbnail_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); | 643 "thumbnail_quality", value, options->thumbnail_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); |
644 zoom_quality = CLAMP(read_int_option(f, option, | 644 options->zoom_quality = CLAMP(read_int_option(f, option, |
645 "zoom_quality", value, zoom_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); | 645 "zoom_quality", value, options->zoom_quality), GDK_INTERP_NEAREST, GDK_INTERP_HYPER); |
646 dither_quality = CLAMP(read_int_option(f, option, | 646 options->dither_quality = CLAMP(read_int_option(f, option, |
647 "dither_quality", value, dither_quality), GDK_RGB_DITHER_NONE, GDK_RGB_DITHER_MAX); | 647 "dither_quality", value, options->dither_quality), GDK_RGB_DITHER_NONE, GDK_RGB_DITHER_MAX); |
648 | 648 |
649 zoom_increment = read_int_option(f, option, | 649 options->zoom_increment = read_int_option(f, option, |
650 "zoom_increment", value, zoom_increment); | 650 "zoom_increment", value, options->zoom_increment); |
651 | 651 |
652 enable_read_ahead = read_bool_option(f, option, | 652 options->enable_read_ahead = read_bool_option(f, option, |
653 "enable_read_ahead", value, enable_read_ahead); | 653 "enable_read_ahead", value, options->enable_read_ahead); |
654 | 654 |
655 place_dialogs_under_mouse = read_bool_option(f, option, | 655 options->place_dialogs_under_mouse = read_bool_option(f, option, |
656 "display_dialogs_under_mouse", value, place_dialogs_under_mouse); | 656 "display_dialogs_under_mouse", value, options->place_dialogs_under_mouse); |
657 | 657 |
658 user_specified_window_background = read_bool_option(f, option, | 658 options->user_specified_window_background = read_bool_option(f, option, |
659 "user_specified_window_background", value, user_specified_window_background); | 659 "user_specified_window_background", value, options->user_specified_window_background); |
660 read_color_option(f, option, | 660 read_color_option(f, option, |
661 "window_background_color", value, &window_background_color); | 661 "window_background_color", value, &options->window_background_color); |
662 | 662 |
663 fullscreen_screen = read_int_option(f, option, | 663 options->fullscreen_screen = read_int_option(f, option, |
664 "fullscreen_screen", value, fullscreen_screen); | 664 "fullscreen_screen", value, options->fullscreen_screen); |
665 fullscreen_clean_flip = read_bool_option(f, option, | 665 options->fullscreen_clean_flip = read_bool_option(f, option, |
666 "fullscreen_clean_flip", value, fullscreen_clean_flip); | 666 "fullscreen_clean_flip", value, options->fullscreen_clean_flip); |
667 fullscreen_disable_saver = read_bool_option(f, option, | 667 options->fullscreen_disable_saver = read_bool_option(f, option, |
668 "fullscreen_disable_saver", value, fullscreen_disable_saver); | 668 "fullscreen_disable_saver", value, options->fullscreen_disable_saver); |
669 fullscreen_above = read_bool_option(f, option, | 669 options->fullscreen_above = read_bool_option(f, option, |
670 "fullscreen_above", value, fullscreen_above); | 670 "fullscreen_above", value, options->fullscreen_above); |
671 show_fullscreen_info = read_bool_option(f, option, | 671 options->show_fullscreen_info = read_bool_option(f, option, |
672 "show_fullscreen_info", value, show_fullscreen_info); | 672 "show_fullscreen_info", value, options->show_fullscreen_info); |
673 fullscreen_info = read_char_option(f, option, | 673 options->fullscreen_info = read_char_option(f, option, |
674 "fullscreen_info", value_all, fullscreen_info); | 674 "fullscreen_info", value_all, options->fullscreen_info); |
675 | 675 |
676 dupe_custom_threshold = read_int_option(f, option, | 676 options->dupe_custom_threshold = read_int_option(f, option, |
677 "custom_similarity_threshold", value, dupe_custom_threshold); | 677 "custom_similarity_threshold", value, options->dupe_custom_threshold); |
678 | 678 |
679 /* slideshow options */ | 679 /* slideshow options */ |
680 | 680 |
681 slideshow_delay = read_int_unit_option(f, option, | 681 options->slideshow_delay = read_int_unit_option(f, option, |
682 "slideshow_delay", value, slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION); | 682 "slideshow_delay", value, options->slideshow_delay, SLIDESHOW_SUBSECOND_PRECISION); |
683 slideshow_random = read_bool_option(f, option, | 683 options->slideshow_random = read_bool_option(f, option, |
684 "slideshow_random", value, slideshow_random); | 684 "slideshow_random", value, options->slideshow_random); |
685 slideshow_repeat = read_bool_option(f, option, | 685 options->slideshow_repeat = read_bool_option(f, option, |
686 "slideshow_repeat", value, slideshow_repeat); | 686 "slideshow_repeat", value, options->slideshow_repeat); |
687 | 687 |
688 /* filtering options */ | 688 /* filtering options */ |
689 | 689 |
690 show_dot_files = read_bool_option(f, option, | 690 options->show_dot_files = read_bool_option(f, option, |
691 "show_dotfiles", value, show_dot_files); | 691 "show_dotfiles", value, options->show_dot_files); |
692 file_filter_disable = read_bool_option(f, option, | 692 options->file_filter_disable = read_bool_option(f, option, |
693 "disable_filtering", value, file_filter_disable); | 693 "disable_filtering", value, options->file_filter_disable); |
694 | 694 |
695 if (strcasecmp(option, "filter_ext") == 0) | 695 if (strcasecmp(option, "filter_ext") == 0) |
696 { | 696 { |
697 filter_parse(value_all); | 697 filter_parse(value_all); |
698 } | 698 } |
742 i = strtol(option + 9, NULL, 0); | 742 i = strtol(option + 9, NULL, 0); |
743 if (i > 0 && i <= GQ_EDITOR_SLOTS) | 743 if (i > 0 && i <= GQ_EDITOR_SLOTS) |
744 { | 744 { |
745 const gchar *ptr; | 745 const gchar *ptr; |
746 i--; | 746 i--; |
747 g_free(editor_name[i]); | 747 g_free(options->editor_name[i]); |
748 g_free(editor_command[i]); | 748 g_free(options->editor_command[i]); |
749 | 749 |
750 editor_name[i] = quoted_value(value_all, &ptr); | 750 options->editor_name[i] = quoted_value(value_all, &ptr); |
751 editor_command[i] = quoted_value(ptr, NULL); | 751 options->editor_command[i] = quoted_value(ptr, NULL); |
752 } | 752 } |
753 } | 753 } |
754 | 754 |
755 /* colection options */ | 755 /* colection options */ |
756 | 756 |
757 collection_rectangular_selection = read_bool_option(f, option, | 757 options->collection_rectangular_selection = read_bool_option(f, option, |
758 "rectangular_selections", value, collection_rectangular_selection); | 758 "rectangular_selections", value, options->collection_rectangular_selection); |
759 | 759 |
760 /* window positions */ | 760 /* window positions */ |
761 | 761 |
762 save_window_positions = read_bool_option(f, option, | 762 options->save_window_positions = read_bool_option(f, option, |
763 "restore_window_positions", value, save_window_positions); | 763 "restore_window_positions", value, options->save_window_positions); |
764 | 764 |
765 main_window_x = read_int_option(f, option, | 765 options->main_window_x = read_int_option(f, option, |
766 "main_window_x", value, main_window_x); | 766 "main_window_x", value, options->main_window_x); |
767 main_window_y = read_int_option(f, option, | 767 options->main_window_y = read_int_option(f, option, |
768 "main_window_y", value, main_window_y); | 768 "main_window_y", value, options->main_window_y); |
769 main_window_w = read_int_option(f, option, | 769 options->main_window_w = read_int_option(f, option, |
770 "main_window_width", value, main_window_w); | 770 "main_window_width", value, options->main_window_w); |
771 main_window_h = read_int_option(f, option, | 771 options->main_window_h = read_int_option(f, option, |
772 "main_window_height", value, main_window_h); | 772 "main_window_height", value, options->main_window_h); |
773 main_window_maximized = read_bool_option(f, option, | 773 options->main_window_maximized = read_bool_option(f, option, |
774 "main_window_maximized", value, main_window_maximized); | 774 "main_window_maximized", value, options->main_window_maximized); |
775 float_window_x = read_int_option(f, option, | 775 options->float_window_x = read_int_option(f, option, |
776 "float_window_x", value, float_window_x); | 776 "float_window_x", value, options->float_window_x); |
777 float_window_y = read_int_option(f, option, | 777 options->float_window_y = read_int_option(f, option, |
778 "float_window_y", value, float_window_y); | 778 "float_window_y", value, options->float_window_y); |
779 float_window_w = read_int_option(f, option, | 779 options->float_window_w = read_int_option(f, option, |
780 "float_window_width", value, float_window_w); | 780 "float_window_width", value, options->float_window_w); |
781 float_window_h = read_int_option(f, option, | 781 options->float_window_h = read_int_option(f, option, |
782 "float_window_height", value, float_window_h); | 782 "float_window_height", value, options->float_window_h); |
783 float_window_divider = read_int_option(f, option, | 783 options->float_window_divider = read_int_option(f, option, |
784 "float_window_divider", value, float_window_divider); | 784 "float_window_divider", value, options->float_window_divider); |
785 window_hdivider_pos = read_int_option(f, option, | 785 options->window_hdivider_pos = read_int_option(f, option, |
786 "divider_position_h", value, window_hdivider_pos); | 786 "divider_position_h", value,options-> window_hdivider_pos); |
787 window_vdivider_pos = read_int_option(f, option, | 787 options->window_vdivider_pos = read_int_option(f, option, |
788 "divider_position_v", value, window_vdivider_pos); | 788 "divider_position_v", value, options->window_vdivider_pos); |
789 | 789 |
790 if (0 == strncasecmp(option, "exif_", 5)) | 790 if (0 == strncasecmp(option, "exif_", 5)) |
791 { | 791 { |
792 for (i = 0; ExifUIList[i].key; i++) | 792 for (i = 0; ExifUIList[i].key; i++) |
793 if (0 == strcasecmp(option+5, ExifUIList[i].key)) | 793 if (0 == strcasecmp(option+5, ExifUIList[i].key)) |