Fix bad formatting, remove whitespace, remove the _gc_id_del function.

SVN revision: 37592
This commit is contained in:
Christopher Michael 2008-11-12 00:50:51 +00:00
parent 513ce4e1fd
commit a65292bb87
1 changed files with 33 additions and 81 deletions

View File

@ -11,8 +11,6 @@
#include <sys/sysctl.h>
#endif
/***************************************************************************/
/**/
/* gadcon requirements */
static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style);
static void _gc_shutdown(E_Gadcon_Client *gcc);
@ -24,20 +22,14 @@ static void _gc_id_del(E_Gadcon_Client_Class *client_class, const char *id);
/* and actually define the gadcon class that this module provides (just 1) */
static const E_Gadcon_Client_Class _gadcon_class =
{
GADCON_CLIENT_CLASS_VERSION,
"temperature",
GADCON_CLIENT_CLASS_VERSION, "temperature",
{
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, _gc_id_del
_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon, _gc_id_new, NULL
},
E_GADCON_CLIENT_STYLE_PLAIN
};
/**/
/***************************************************************************/
/***************************************************************************/
/**/
/* actual module specifics */
static int _temperature_cb_exe_data(void *data, int type, void *event);
static int _temperature_cb_exe_del(void *data, int type, void *event);
static void _temperature_face_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
@ -95,12 +87,10 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst->tempget_data_handler =
ecore_event_handler_add(ECORE_EXE_EVENT_DATA,
_temperature_cb_exe_data,
inst);
_temperature_cb_exe_data, inst);
inst->tempget_del_handler =
ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
_temperature_cb_exe_del,
inst);
_temperature_cb_exe_del, inst);
temperature_face_update_config(inst);
@ -188,30 +178,6 @@ _gc_id_new(E_Gadcon_Client_Class *client_class)
return inst->id;
}
static void
_gc_id_del(E_Gadcon_Client_Class *client_class, const char *id)
{
/* yes - don't do this. on shutdown gadgets are deleted and this means config
* for them is deleted - that means empty config is saved. keep them around
* as if u add a gadget back it can pick up its old config again
*
Config_Face *inst;
inst = evas_hash_find(temperature_config->faces, id);
if (inst)
{
temperature_config->faces = evas_hash_del(temperature_config->faces, id, inst);
if (inst->sensor_name) eina_stringshare_del(inst->sensor_name);
free(inst);
}
*/
}
/**/
/***************************************************************************/
/***************************************************************************/
/**/
static int
_temperature_cb_exe_data(void *data, int type, void *event)
{
@ -329,7 +295,6 @@ _temperature_face_cb_post_menu(void *data, E_Menu *m)
Config_Face *inst;
inst = data;
if (!inst->menu) return;
e_object_del(E_OBJECT(inst->menu));
inst->menu = NULL;
@ -362,7 +327,6 @@ _temperature_face_shutdown(const Evas_Hash *hash __UNUSED__, const void *key __U
Config_Face *inst;
inst = hdata;
if (inst->sensor_name) eina_stringshare_del(inst->sensor_name);
if (inst->id) eina_stringshare_del(inst->id);
free(inst);
@ -410,8 +374,7 @@ temperature_face_update_config(Config_Face *inst)
Ecore_List *
temperature_get_bus_files(const char* bus)
{
Ecore_List *result;
Ecore_List *therms;
Ecore_List *result, *therms;
char path[PATH_MAX];
char busdir[PATH_MAX];
@ -432,8 +395,7 @@ temperature_get_bus_files(const char* bus)
/* Search each device for temp*_input, these should be
* temperature devices. */
snprintf(path, sizeof(path),
"%s/%s", busdir, name);
snprintf(path, sizeof(path), "%s/%s", busdir, name);
files = ecore_file_ls(path);
if (files)
{
@ -462,9 +424,6 @@ temperature_get_bus_files(const char* bus)
return result;
}
/***************************************************************************/
/**/
/* module setup */
EAPI E_Module_Api e_modapi =
{
@ -497,13 +456,9 @@ e_modapi_init(E_Module *m)
temperature_config = e_config_domain_load("module.temperature", conf_edd);
if (!temperature_config)
{
temperature_config = E_NEW(Config, 1);
}
else
{
evas_hash_foreach(temperature_config->faces, _temperature_face_id_max, &uuid);
}
temperature_config->module = m;
e_gadcon_provider_register(&_gadcon_class);
@ -514,7 +469,6 @@ EAPI int
e_modapi_shutdown(E_Module *m)
{
e_gadcon_provider_unregister(&_gadcon_class);
evas_hash_foreach(temperature_config->faces, _temperature_face_shutdown, NULL);
evas_hash_free(temperature_config->faces);
free(temperature_config);
@ -530,5 +484,3 @@ e_modapi_save(E_Module *m)
e_config_domain_save("module.temperature", conf_edd, temperature_config);
return 1;
}
/**/
/***************************************************************************/