a few other palces use config thing.. only 3 e_db_open references there now..

and they read lists from db's


SVN revision: 4213
This commit is contained in:
Carsten Haitzler 2001-02-15 00:45:08 +00:00
parent 922fbf4662
commit 2755e1ea78
2 changed files with 15 additions and 21 deletions

View File

@ -409,13 +409,12 @@ e_focus_out(Eevent * ev)
E_DB_File *db;
int focus_mode;
char buf[4096];
E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
settings_db = e_config_get("settings");
E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
b->current.selected = 0;
/* settings - click to focus would affect grabs */
db = e_db_open_read(settings_db);
sprintf(buf, "/focus/mode");
if ((db) && (e_db_int_get(db, buf, &focus_mode)) && (!b->current.selected))
if (!b->current.selected)
{
if (focus_mode == 2) /* click to focus */
{
@ -430,7 +429,6 @@ e_focus_out(Eevent * ev)
b->grabs = evas_list_append(b->grabs, g);
e_button_grab(b->win.main, 0, XEV_BUTTON | XEV_MOUSE_MOVE, EV_KEY_MODIFIER_NONE, 1);
}
e_db_close(db);
}
b->changed = 1;
}
@ -1406,17 +1404,16 @@ void
e_border_attach_mouse_grabs(E_Border *b)
{
char *grabs_db;
char *settings_db;
E_DB_File *db;
int focus_mode;
char buf[4096];
E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
grabs_db = e_config_get("grabs");
settings_db = e_config_get("settings");
/* settings - click to focus would affect grabs */
db = e_db_open_read(settings_db);
sprintf(buf, "/focus/mode");
if ((db) && (e_db_int_get(db, buf, &focus_mode)) && (!b->current.selected))
if ((!b->current.selected))
{
if (focus_mode == 2) /* click to focus */
{
@ -1430,7 +1427,6 @@ e_border_attach_mouse_grabs(E_Border *b)
g->remove_after = 1;
b->grabs = evas_list_append(b->grabs, g);
e_button_grab(b->win.main, 0, XEV_BUTTON | XEV_MOUSE_MOVE, EV_KEY_MODIFIER_NONE, 1);
e_db_close(db);
}
}

View File

@ -9,23 +9,21 @@ e_resist_border(E_Border *b)
int ok = 0;
int dx, dy, d;
int resist_x = 0, resist_y = 0;
char *settings_db;
Evas_List l, rects = NULL;
E_Rect *r;
E_CFG_INT(cfg_resist, "settings", "/move/resist", 1);
E_CFG_INT(cfg_desk_resist, "settings", "/move/resist/desk", 32);
E_CFG_INT(cfg_win_resist, "settings", "/move/resist/win", 12);
settings_db = e_config_get("settings");
E_DB_INT_GET(settings_db, "/move/resist", resist, ok);
if (!ok) resist = 1;
E_CONFIG_INT_GET(cfg_resist, resist);
E_CONFIG_INT_GET(cfg_desk_resist, desk_resist);
E_CONFIG_INT_GET(cfg_win_resist, win_resist);
if (!resist)
{
b->current.x = b->current.requested.x;
b->current.y = b->current.requested.y;
return;
}
ok = 0; E_DB_INT_GET(settings_db, "/move/resist/desk", desk_resist, ok);
if (!ok) desk_resist = 32;
ok = 0; E_DB_INT_GET(settings_db, "/move/resist/win", win_resist, ok);
if (!ok) win_resist = 12;
if (!b->desk) return;
dx = b->current.requested.x - b->previous.requested.x;
dy = b->current.requested.y - b->previous.requested.y;