Mercurial > geeqie
comparison src/cache_maint.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 | d1f74154463e |
children | 767b53cd9ab7 |
comparison
equal
deleted
inserted
replaced
317:46169c246c51 | 318:b16b9b8979e5 |
---|---|
545 g_free(d); | 545 g_free(d); |
546 g_free(buf); | 546 g_free(buf); |
547 } | 547 } |
548 g_free(base); | 548 g_free(base); |
549 | 549 |
550 if (enable_thumb_caching && thumbnail_spec_standard) thumb_std_maint_moved(src, dest); | 550 if (options->enable_thumb_caching && options->thumbnail_spec_standard) |
551 thumb_std_maint_moved(src, dest); | |
551 } | 552 } |
552 | 553 |
553 static void cache_file_remove(const gchar *path) | 554 static void cache_file_remove(const gchar *path) |
554 { | 555 { |
555 if (path && isfile(path) && !unlink_file(path)) | 556 if (path && isfile(path) && !unlink_file(path)) |
572 | 573 |
573 buf = cache_find_location(CACHE_TYPE_METADATA, fd->path); | 574 buf = cache_find_location(CACHE_TYPE_METADATA, fd->path); |
574 cache_file_remove(buf); | 575 cache_file_remove(buf); |
575 g_free(buf); | 576 g_free(buf); |
576 | 577 |
577 if (enable_thumb_caching && thumbnail_spec_standard) thumb_std_maint_removed(fd->path); | 578 if (options->enable_thumb_caching && options->thumbnail_spec_standard) |
579 thumb_std_maint_removed(fd->path); | |
578 } | 580 } |
579 | 581 |
580 void cache_maint_copied(FileData *fd) | 582 void cache_maint_copied(FileData *fd) |
581 { | 583 { |
582 gchar *dest_base; | 584 gchar *dest_base; |
736 gint success; | 738 gint success; |
737 | 739 |
738 path = cd->list->data; | 740 path = cd->list->data; |
739 cd->list = g_list_remove(cd->list, path); | 741 cd->list = g_list_remove(cd->list, path); |
740 | 742 |
741 cd->tl = (ThumbLoaderStd *)thumb_loader_new(thumb_max_width, thumb_max_height); | 743 cd->tl = (ThumbLoaderStd *)thumb_loader_new(options->thumb_max_width, options->thumb_max_height); |
742 thumb_loader_set_callbacks((ThumbLoader *)cd->tl, | 744 thumb_loader_set_callbacks((ThumbLoader *)cd->tl, |
743 cache_manager_render_thumb_done_cb, | 745 cache_manager_render_thumb_done_cb, |
744 cache_manager_render_thumb_done_cb, | 746 cache_manager_render_thumb_done_cb, |
745 NULL, cd); | 747 NULL, cd); |
746 thumb_loader_set_cache((ThumbLoader *)cd->tl, TRUE, cd->local, TRUE); | 748 thumb_loader_set_cache((ThumbLoader *)cd->tl, TRUE, cd->local, TRUE); |
847 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); | 849 gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); |
848 gtk_widget_show(label); | 850 gtk_widget_show(label); |
849 | 851 |
850 pref_checkbox_new_int(cd->group, _("Include subfolders"), FALSE, &cd->recurse); | 852 pref_checkbox_new_int(cd->group, _("Include subfolders"), FALSE, &cd->recurse); |
851 button = pref_checkbox_new_int(cd->group, _("Store thumbnails local to source images"), FALSE, &cd->local); | 853 button = pref_checkbox_new_int(cd->group, _("Store thumbnails local to source images"), FALSE, &cd->local); |
852 gtk_widget_set_sensitive(button, thumbnail_spec_standard); | 854 gtk_widget_set_sensitive(button, options->thumbnail_spec_standard); |
853 | 855 |
854 pref_line(cd->gd->vbox, PREF_PAD_SPACE); | 856 pref_line(cd->gd->vbox, PREF_PAD_SPACE); |
855 hbox = pref_box_new(cd->gd->vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); | 857 hbox = pref_box_new(cd->gd->vbox, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE); |
856 | 858 |
857 cd->progress = gtk_entry_new(); | 859 cd->progress = gtk_entry_new(); |