Fix some errors thanks to llvm clang static analyzer, also begin config inwin.

This commit is contained in:
Jaime Thomas 2009-01-08 02:33:00 +00:00
parent c873d87e2e
commit ae96ca5e10
6 changed files with 97 additions and 50 deletions

View File

@ -26,6 +26,7 @@
#include <time.h>
#include <unistd.h>
#include <limits.h>
//#define PATH_MAX 4095
#include <pthread.h>
/* ECDB Global Variables */

View File

@ -7,10 +7,9 @@ static void _button_cb_begin(void *data, Evas_Object *obj, void *event_info);
static void
_button_cb_return(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *swallow, *gui;
Evas_Object *swallow;
char *signal;
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"erase_page");
@ -24,12 +23,11 @@ _button_cb_return(void *data, Evas_Object *obj, void *event_info)
static void
_button_cb_begin(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *swallow, *gui, *o;
Evas_Object *swallow, *o;
Ecdb_Erase_Project *proj;
char buf[1024];
int drive;
gui = evas_object_name_find(ecore_evas_get(em->main_win_ee), "gui");
swallow = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"erase_page");

View File

@ -263,40 +263,40 @@ ecdb_handle_typebuf(Evas_Object *gui)
/* What to do about multi-word directories? */
dir = ecdb_strip_string(ext);
if ((dir) && (dir[0] == '/'))
{
if (ecore_file_exists(dir))
{
ewl_filelist_directory_set(EWL_FILELIST(fl), dir);
}
}
else if (dir[0] == '~')
{
char path[PATH_MAX];
snprintf(path, PATH_MAX, "%s%s", getenv("HOME"), &dir[1]);
if (ecore_file_exists(path))
{
ewl_filelist_directory_set(EWL_FILELIST(fl), path);
}
}
else if (dir)
{
/* Try to concate it to our current directory */
char path[PATH_MAX];
snprintf(path, PATH_MAX, "%s/%s", ewl_filelist_directory_get
(EWL_FILELIST(fl)), dir);
if (ecore_file_exists(path))
{
ewl_filelist_directory_set(EWL_FILELIST(fl), path);
}
}
if (dir)
{
if (dir[0] == '/')
{
if (ecore_file_exists(dir))
{
ewl_filelist_directory_set(EWL_FILELIST(fl), dir);
}
}
else if (dir[0] == '~')
{
char path[PATH_MAX];
snprintf(path, PATH_MAX, "%s%s", getenv("HOME"), &dir[1]);
if (ecore_file_exists(path))
{
ewl_filelist_directory_set(EWL_FILELIST(fl), path);
}
}
else
{
/* Try to concate it to our current directory */
char path[PATH_MAX];
snprintf(path, PATH_MAX, "%s/%s", ewl_filelist_directory_get
(EWL_FILELIST(fl)), dir);
if (ecore_file_exists(path))
{
ewl_filelist_directory_set(EWL_FILELIST(fl), path);
}
}
FREE(dir);
}
@ -542,7 +542,7 @@ ecdb_gui_controls_enable(const char **ids, int n)
}
}
Evas_Object *
void
ecdb_gui_combo_header_from_drive(Evas_Object *c, const char *name, void *data,
Evas_Object *obj, int sel)
{
@ -553,11 +553,9 @@ ecdb_gui_combo_header_from_drive(Evas_Object *c, const char *name, void *data,
drive = eina_list_nth(em->drives, sel);
ecdb_label_text_set(ret, drive->product);
evas_object_show(ret);
return ret;
}
Evas_Object *
void
ecdb_gui_combo_header_from_speeds(Evas_Object *c, const char *name, void *data,
Evas_Object *obj, int sel)
{
@ -568,13 +566,11 @@ ecdb_gui_combo_header_from_speeds(Evas_Object *c, const char *name, void *data,
drive = data;
if (!drive)
return NULL;
return;
ret = ecdb_label_add(c, name);
snprintf(buf, sizeof(buf), "%d", ecdb_speed_convert(drive, sel));
ecdb_label_text_set(ret, buf);
evas_object_show(ret);
return ret;
}

View File

@ -10,10 +10,10 @@ void ecdb_page_hide_finished(void *data, Evas_Object *o,
const char *source);
void ecdb_gui_controls_disable(const char ** ids, int n);
void ecdb_gui_controls_enable(const char **ids, int n);
Evas_Object *ecdb_gui_combo_header_from_drive(Evas_Object *c, const char *name,
void ecdb_gui_combo_header_from_drive(Evas_Object *c, const char *name,
void *data, Evas_Object *obj,
int sel);
Evas_Object *ecdb_gui_combo_header_from_speeds(Evas_Object *c, const char *name,
void ecdb_gui_combo_header_from_speeds(Evas_Object *c, const char *name,
void *data, Evas_Object *obj,
int sel);

View File

@ -287,6 +287,9 @@ _entry_markup_to_text(const char *mkup)
char *tag_start, *tag_end, *esc_start, *esc_end, *ts;
tag_start = tag_end = esc_start = esc_end = NULL;
if (!mkup)
return NULL;
p = (char *)mkup;
s = p;
for (;;)
@ -459,7 +462,7 @@ struct _Combo_Data
const char *name;
const char *header;
void *data;
Evas_Object * (*create_header)(Evas_Object *, const char *name, void *data,
void (*create_header)(Evas_Object *, const char *name, void *data,
Evas_Object *, int);
};
@ -566,9 +569,16 @@ _combo_clicked(void *data, Evas_Object *obj, void *event_info)
cd->selected = i;
header = edje_object_part_swallow_get(data, "ecdb.header.swallow");
if (header)
{
edje_object_part_unswallow(data, header);
evas_object_del(header);
}
if (cd->create_header)
header = cd->create_header(data, "ecdb.header.swallow", cd->data,
swallow, i);
cd->create_header(data, "ecdb.header.swallow", cd->data, swallow, i);
edje_object_signal_emit(data, "ecdb,combo,header,swallow", "ecdb");
ecdb_combo_collapse(data);
}
@ -767,7 +777,7 @@ ecdb_combo_collapse(Evas_Object *c)
}
void
ecdb_combo_header_create_set(Evas_Object *c, Evas_Object * (*func)
ecdb_combo_header_create_set(Evas_Object *c, void (*func)
(Evas_Object *c, const char *name,
void *data, Evas_Object *clicked, int idx))
{
@ -825,3 +835,41 @@ ecdb_label_text_set(Evas_Object *l, const char *text)
{
edje_object_part_text_set(l, "ecdb.label", text);
}
/************************* Config Inwin **************************************/
Evas_Object *
ecdb_config_inwin_add(Evas_Object *parent, const char *name)
{
Evas_Object *iw;
iw = ecdb_widget_add(parent, name);
edje_object_file_set(iw, em->theme_path, "ecdb/config_inwin");
/*
evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _combo_resize,
iw);
evas_object_event_callback_add(parent, EVAS_CALLBACK_HIDE, _combo_hide, iw);
evas_object_event_callback_add(c, EVAS_CALLBACK_DEL, _combo_del, iw);
*/
return iw;
}
void
ecdb_config_inwin_child_add(Evas_Object *inwin, Evas_Object *child,
int sc, int ec, int sr, int er)
{
if (!inwin)
{
printf("ecdb_config_inwin_child_add: NULL parent!\n");
return;
}
if (!child)
return;
if (!edje_object_part_table_pack(inwin, "ecdb.table", child, sc, sr, ec, er))
{
printf("ecdb_config_inwin_child_add: Couldn't append to table!\n");
}
}

View File

@ -36,7 +36,7 @@ void ecdb_combo_header_set(Evas_Object *c, const char *text);
void ecdb_combo_append(Evas_Object *c, Evas_Object *o);
void ecdb_combo_expand(Evas_Object *c);
void ecdb_combo_collapse(Evas_Object *c);
void ecdb_combo_header_create_set(Evas_Object *c, Evas_Object *
void ecdb_combo_header_create_set(Evas_Object *c, void
(*func)(Evas_Object *c,
const char *name,
void *data,
@ -49,5 +49,9 @@ void ecdb_combo_clear(Evas_Object *c);
Evas_Object *ecdb_label_add(Evas_Object *parent, const char *name);
void ecdb_label_text_set(Evas_Object *l, const char *text);
Evas_Object *ecdb_config_inwin_add(Evas_Object *parent, const char *name);
void ecdb_config_inwin_child_add(Evas_Object *inwin, Evas_Object *child,
int sc, int ec,
int sr, int er);
#endif