dont add collection plugin config each start

SVN revision: 49257
This commit is contained in:
Hannes Janetzek 2010-05-28 20:58:01 +00:00
parent 1a818e8ac8
commit 49b152519c
4 changed files with 44 additions and 46 deletions

View File

@ -396,9 +396,9 @@ _config_init()
/* setup defaults */ /* setup defaults */
IFMODCFG(0x0001); IFMODCFG(0x0001);
evry_conf->rel_x = 0.5; evry_conf->rel_x = 0.5;
evry_conf->rel_y = 0.33; evry_conf->rel_y = 0.43;
evry_conf->width = 435; evry_conf->width = 455;
evry_conf->height = 385; evry_conf->height = 430;
evry_conf->scroll_animate = 1; evry_conf->scroll_animate = 1;
evry_conf->scroll_speed = 10.0; evry_conf->scroll_speed = 10.0;
evry_conf->hide_input = 0; evry_conf->hide_input = 0;

View File

@ -4,7 +4,7 @@
#include "e.h" #include "e.h"
#include "evry_api.h" #include "evry_api.h"
#define MOD_CONFIG_FILE_EPOCH 0x0004 #define MOD_CONFIG_FILE_EPOCH 0x0005
#define MOD_CONFIG_FILE_GENERATION 0x0001 #define MOD_CONFIG_FILE_GENERATION 0x0001
#define MOD_CONFIG_FILE_VERSION \ #define MOD_CONFIG_FILE_VERSION \
((MOD_CONFIG_FILE_EPOCH << 16) | MOD_CONFIG_FILE_GENERATION) ((MOD_CONFIG_FILE_EPOCH << 16) | MOD_CONFIG_FILE_GENERATION)

View File

@ -15,7 +15,7 @@ void
evry_plugins_shutdown(void) evry_plugins_shutdown(void)
{ {
Evry_Action *act; Evry_Action *act;
EINA_LIST_FREE(actions, act) EINA_LIST_FREE(actions, act)
evry_action_free(act); evry_action_free(act);
} }
@ -97,17 +97,17 @@ _evry_plugin_action_browse(Evry_Action *act)
Evry_Plugin *p; Evry_Plugin *p;
Eina_List *plugins = NULL; Eina_List *plugins = NULL;
Evry_Selector *sel; Evry_Selector *sel;
GET_ITEM(it, act->it1.item); GET_ITEM(it, act->it1.item);
GET_EVRY_PLUGIN(pp, EVRY_ITEM(act)->data); GET_EVRY_PLUGIN(pp, EVRY_ITEM(act)->data);
if (!it->plugin || !it->plugin->state) if (!it->plugin || !it->plugin->state)
return 0; return 0;
sel = it->plugin->state->selector; sel = it->plugin->state->selector;
evry_selectors_switch(-1, EINA_TRUE); evry_selectors_switch(-1, EINA_TRUE);
if ((p = pp->begin(pp, it))) if ((p = pp->begin(pp, it)))
{ {
plugins = eina_list_append(plugins, p); plugins = eina_list_append(plugins, p);
@ -115,7 +115,7 @@ _evry_plugin_action_browse(Evry_Action *act)
if (!evry_state_push(sel, plugins)) if (!evry_state_push(sel, plugins))
eina_list_free(plugins); eina_list_free(plugins);
} }
return 0; return 0;
} }
@ -146,7 +146,7 @@ evry_plugin_register(Evry_Plugin *p, int type, int priority)
Evry_Action *act; Evry_Action *act;
char buf[256]; char buf[256];
snprintf(buf, sizeof(buf), _("Browse %s"), EVRY_ITEM(p)->label); snprintf(buf, sizeof(buf), _("Browse %s"), EVRY_ITEM(p)->label);
act = EVRY_ACTION_NEW(buf, p->input_type, 0, EVRY_ITEM(p)->icon, act = EVRY_ACTION_NEW(buf, p->input_type, 0, EVRY_ITEM(p)->icon,
_evry_plugin_action_browse, NULL); _evry_plugin_action_browse, NULL);
EVRY_ITEM(act)->data = p; EVRY_ITEM(act)->data = p;
@ -158,49 +158,47 @@ evry_plugin_register(Evry_Plugin *p, int type, int priority)
conf[1] = evry_conf->conf_actions; conf[1] = evry_conf->conf_actions;
conf[2] = evry_conf->conf_objects; conf[2] = evry_conf->conf_objects;
EINA_LIST_FOREACH(conf[type], l, pc)
if (pc->name && p->name && !strcmp(pc->name, p->name))
break;
/* collection plugin sets its own config */ /* collection plugin sets its own config */
if (p->config) if (!pc && p->config)
{ {
conf[type] = eina_list_append(conf[type], p->config); conf[type] = eina_list_append(conf[type], p->config);
pc = p->config;
} }
else else if (!pc)
{ {
EINA_LIST_FOREACH(conf[type], l, pc) new_conf = 1;
if (pc->name && p->name && !strcmp(pc->name, p->name)) pc = E_NEW(Plugin_Config, 1);
break; pc->name = eina_stringshare_add(p->name);
pc->enabled = 1;
pc->priority = priority ? priority : 100;
pc->view_mode = VIEW_MODE_NONE;
pc->aggregate = EINA_TRUE;
pc->top_level = EINA_TRUE;
if (!pc) conf[type] = eina_list_append(conf[type], pc);
{
new_conf = 1;
pc = E_NEW(Plugin_Config, 1);
pc->name = eina_stringshare_add(p->name);
pc->enabled = 1;
pc->priority = priority ? priority : 100;
pc->view_mode = VIEW_MODE_NONE;
pc->aggregate = EINA_TRUE;
pc->top_level = EINA_TRUE;
conf[type] = eina_list_append(conf[type], pc);
}
if (pc->trigger && strlen(pc->trigger) == 0)
{
eina_stringshare_del(pc->trigger);
pc->trigger = NULL;
}
p->config = pc;
pc->plugin = p;
conf[type] = eina_list_sort(conf[type], -1, _evry_cb_plugin_sort);
/* EINA_LIST_FOREACH(conf[type], l, pc)
* pc->priority = i++; */
} }
if (pc->trigger && strlen(pc->trigger) == 0)
{
eina_stringshare_del(pc->trigger);
pc->trigger = NULL;
}
p->config = pc;
pc->plugin = p;
conf[type] = eina_list_sort(conf[type], -1, _evry_cb_plugin_sort);
/* EINA_LIST_FOREACH(conf[type], l, pc)
* pc->priority = i++; */
evry_conf->conf_subjects = conf[0]; evry_conf->conf_subjects = conf[0];
evry_conf->conf_actions = conf[1]; evry_conf->conf_actions = conf[1];
evry_conf->conf_objects = conf[2]; evry_conf->conf_objects = conf[2];
return new_conf; return new_conf;
} }
@ -233,10 +231,10 @@ evry_plugin_find(const char *name)
if (pc->name == n) if (pc->name == n)
break; break;
} }
eina_stringshare_del(n); eina_stringshare_del(n);
if (!pc) return NULL; if (!pc) return NULL;
return pc->plugin; return pc->plugin;
} }

View File

@ -397,7 +397,7 @@ _e_smart_reconfigure_do(void *data)
{ {
size = 192; size = 192;
col = width / size; col = width / size;
aspect_w = width * (sd->h / size); aspect_w = width * (1 + (sd->h / size));
} }
if (col < 1) col = 1; if (col < 1) col = 1;