add configurable max file size to generate thumbnails for, also block thumbnail generation for movie files entirely since this isn't even possible

ticket #1545


SVN revision: 76931
devs/princeamd/enlightenment-0.17-elive
Mike Blumenkrantz 11 years ago
parent 37f4478e0a
commit 709c740a27
  1. 14
      src/bin/e_fm.c
  2. 1
      src/bin/e_fm.h
  3. 1
      src/modules/fileman/e_fwin.c
  4. 9
      src/modules/fileman/e_mod_config.c
  5. 6
      src/modules/fileman/e_mod_main.c
  6. 3
      src/modules/fileman/e_mod_main.h

@ -1025,6 +1025,7 @@ e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path)
sd->config->view.single_click = e_config->filemanager_single_click;
sd->config->view.single_click_delay = EINA_FALSE;
sd->config->view.no_subdir_jump = EINA_FALSE;
sd->config->icon.max_thumb_size = 5;
sd->config->icon.icon.w = 128;
sd->config->icon.icon.h = 128;
sd->config->icon.list.w = 24;
@ -2176,6 +2177,19 @@ e_fm2_icon_get(Evas *evas, E_Fm2_Icon *ic,
if (o) return o;
}
if (eina_str_has_extension(ic->info.file, ".avi") ||
eina_str_has_extension(ic->info.file, ".mpg") ||
eina_str_has_extension(ic->info.file, ".mpeg") ||
eina_str_has_extension(ic->info.file, ".mkv") ||
(ic->info.statinfo.st_size >= (ic->sd->config->icon.max_thumb_size ?: 5) * 1024 * 1024))
{
/* block movie thumbnails, which we can't do, and large file previews,
* which we won't do
*/
ic->thumb_failed = EINA_TRUE;
}
/* create thumbnails for edje files */
if (_e_fm2_file_is_edje(ic->info.file))
{

@ -90,6 +90,7 @@ struct _E_Fm2_Config
Eina_Bool show : 1;
} extension;
const char *key_hint;
unsigned int max_thumb_size;
} icon;
/* how to sort files */
struct

@ -1432,6 +1432,7 @@ _e_fwin_config_set(E_Fwin_Page *page)
fmc.view.selector = 0;
fmc.view.single_click = fileman_config->view.single_click;
fmc.view.no_subdir_jump = 0;
fmc.icon.max_thumb_size = fileman_config->icon.max_thumb_size;
fmc.icon.extension.show = fileman_config->icon.extension.show;
fmc.list.sort.no_case = fileman_config->list.sort.no_case;
fmc.list.sort.extension = fileman_config->list.sort.extension;

@ -44,6 +44,7 @@ struct _E_Config_Dialog_Data
int show;
} extension;
const char *key_hint;
int max_thumb_size;
} icon;
/* how to sort files */
struct
@ -147,6 +148,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->view.show_sidebar = fileman_config->view.show_sidebar;
cfdata->view.desktop_navigation = fileman_config->view.desktop_navigation;
cfdata->view.menu_shows_files = fileman_config->view.menu_shows_files;
cfdata->icon.max_thumb_size = fileman_config->icon.max_thumb_size;
cfdata->icon.icon.w = fileman_config->icon.icon.w;
cfdata->icon.icon.h = fileman_config->icon.icon.h;
cfdata->tooltip.delay = fileman_config->tooltip.delay;
@ -237,6 +239,7 @@ _basic_check_changed(E_Config_Dialog *cfd __UNUSED__,
(fileman_config->view.desktop_navigation != cfdata->view.desktop_navigation) ||
(fileman_config->view.menu_shows_files != cfdata->view.menu_shows_files) ||
(fileman_config->icon.extension.show != cfdata->icon.extension.show) ||
((int)fileman_config->icon.max_thumb_size != cfdata->icon.max_thumb_size) ||
(fileman_config->selection.windows_modifiers != cfdata->selection.windows_modifiers) ||
(fileman_config->icon.icon.w != cfdata->icon.icon.w) ||
(fileman_config->icon.icon.h != cfdata->icon.icon.w) ||
@ -391,6 +394,12 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__,
&(cfdata->view.desktop_navigation));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_label_add(evas, _("Max File Size For Thumbnailing"));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f"), 1.0, 10.0, 1, 0,
NULL, &(cfdata->icon.max_thumb_size), 150);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_label_add(evas, _("Spring Delay"));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f"), 1.0, 10.0, 1, 0,

@ -252,6 +252,7 @@ _e_mod_fileman_config_load(void)
E_CONFIG_VAL(D, T, icon.fixed.w, UCHAR);
E_CONFIG_VAL(D, T, icon.fixed.h, UCHAR);
E_CONFIG_VAL(D, T, icon.extension.show, UCHAR);
E_CONFIG_VAL(D, T, icon.max_thumb_size, UINT);
E_CONFIG_VAL(D, T, list.sort.no_case, UCHAR);
E_CONFIG_VAL(D, T, list.sort.extension, UCHAR);
E_CONFIG_VAL(D, T, list.sort.mtime, UCHAR);
@ -340,6 +341,10 @@ _e_mod_fileman_config_load(void)
fileman_config->view.spring_delay = 1;
IFMODCFGEND;
IFMODCFG(0x0115);
fileman_config->icon.max_thumb_size = 5;
IFMODCFGEND;
fileman_config->config_version = MOD_CONFIG_FILE_VERSION;
/* UCHAR's give nasty compile warnings about comparisons so not gonna limit those */
@ -352,6 +357,7 @@ _e_mod_fileman_config_load(void)
E_CONFIG_LIMIT(fileman_config->tooltip.delay, 0.0, 5.0);
E_CONFIG_LIMIT(fileman_config->tooltip.size, 10.0, 75.0);
E_CONFIG_LIMIT(fileman_config->view.spring_delay, 1, 10);
E_CONFIG_LIMIT(fileman_config->icon.max_thumb_size, 1, 10);
e_config_save_queue();
}

@ -4,7 +4,7 @@
/* Increment for Major Changes */
#define MOD_CONFIG_FILE_EPOCH 0x0001
/* Increment for Minor Changes (ie: user doesn't need a new config) */
#define MOD_CONFIG_FILE_GENERATION 0x0114
#define MOD_CONFIG_FILE_GENERATION 0x0115
#define MOD_CONFIG_FILE_VERSION ((MOD_CONFIG_FILE_EPOCH << 16) | MOD_CONFIG_FILE_GENERATION)
typedef struct _Config Config;
@ -76,6 +76,7 @@ struct _Config
unsigned char show;
} extension;
const char *key_hint;
unsigned int max_thumb_size;
} icon;
/* how to sort files */
struct

Loading…
Cancel
Save