From 5adb2747b8b9d24962be7d6a260582adc65edccb Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 5 Jul 2012 09:38:43 +0000 Subject: [PATCH] make min size 1x1 for warning fix, add 2 todo's and make configs versioned finally. :) SVN revision: 73336 --- TODO | 2 ++ src/bin/config.c | 25 ++++++++++++++++++++++++- src/bin/config.h | 1 + src/bin/media.c | 6 +++--- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index d1bc720f..f6d894db 100644 --- a/TODO +++ b/TODO @@ -2,6 +2,8 @@ here's a short list of things i think we can do in the short to medium term to make it a first-class terminal: +[ ] ecore-fb doesnt seem to do keyrpeat? +[ ] ecore-fb ctrl, alt broken. [ ] blink and blink2 attributes need to be supported [ ] improve terminal emulation handling. known apps with problems: mc diff --git a/src/bin/config.c b/src/bin/config.c index a060b534..789dbd0a 100644 --- a/src/bin/config.c +++ b/src/bin/config.c @@ -3,6 +3,8 @@ #include #include "config.h" +#define CONF_VER 1 + #define LIM(v, min, max) {if (v >= max) v = max; else if (v <= min) v = min;} static Eet_Data_Descriptor *edd_base = NULL; @@ -42,6 +44,8 @@ config_init(void) (&eddc, sizeof(eddc), "Config", sizeof(Config)); edd_base = eet_data_descriptor_stream_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC + (edd_base, Config, "version", version, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_BASIC (edd_base, Config, "font.name", font.name, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC @@ -146,7 +150,18 @@ config_load(const char *key) eet_close(ef); if (config) { - LIM(config->font.size, 3, 400); + if (config->version < CONF_VER) + { + // currently no upgrade path so reset config. + config_del(config); + config = NULL; + } + else + { + LIM(config->font.size, 3, 400); + LIM(config->scrollback, 0, 200000); + LIM(config->vidmod, 0, 3) + } } } if (!config) @@ -207,6 +222,7 @@ config_load(const char *key) config = calloc(1, sizeof(Config)); if (config) { + config->version = CONF_VER; config->font.bitmap = EINA_TRUE; config->font.name = eina_stringshare_add("nexus.pcf"); config->font.size = 10; @@ -252,6 +268,13 @@ config_del(Config *config) eina_stringshare_del(config->theme); eina_stringshare_del(config->background); eina_stringshare_del(config->wordsep); + eina_stringshare_del(config->helper.email); + eina_stringshare_del(config->helper.url.general); + eina_stringshare_del(config->helper.url.video); + eina_stringshare_del(config->helper.url.image); + eina_stringshare_del(config->helper.local.general); + eina_stringshare_del(config->helper.local.video); + eina_stringshare_del(config->helper.local.image); eina_stringshare_del(config->config_key); /* not in eet */ free(config); diff --git a/src/bin/config.h b/src/bin/config.h index aeaabc38..d2258887 100644 --- a/src/bin/config.h +++ b/src/bin/config.h @@ -7,6 +7,7 @@ typedef struct _Config Config; struct _Config { + int version; struct { const char *name; int size; diff --git a/src/bin/media.c b/src/bin/media.c index 01174267..2148259c 100644 --- a/src/bin/media.c +++ b/src/bin/media.c @@ -141,7 +141,7 @@ _type_img_calc(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_ } else { - int iw, ih; + int iw = 1, ih = 1; if (sd->mode == MEDIA_BG) { @@ -225,7 +225,7 @@ _type_scale_calc(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Eva } else { - int iw, ih; + int iw = 1, ih = 1; if (sd->mode == MEDIA_BG) { @@ -529,7 +529,7 @@ _type_mov_calc(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_ } else { - int iw = 0, ih = 0; + int iw = 1, ih = 1; double ratio; ratio = emotion_object_ratio_get(sd->o_img);