forked from enlightenment/enlightenment
parent
48f2c282ff
commit
0ee490dd03
|
@ -285,7 +285,7 @@ e_app_empty_new(const char *path)
|
|||
|
||||
a = E_OBJECT_ALLOC(E_App, E_APP_TYPE, _e_app_free);
|
||||
a->image = NULL;
|
||||
if(path)
|
||||
if (path)
|
||||
a->path = strdup(path);
|
||||
return a;
|
||||
}
|
||||
|
@ -1007,10 +1007,9 @@ e_app_fields_save(E_App *a)
|
|||
unsigned char tmp[1];
|
||||
int img;
|
||||
|
||||
if(!a->path)
|
||||
return;
|
||||
if (!a->path) return;
|
||||
|
||||
if(!ecore_file_exists(a->path))
|
||||
if (!ecore_file_exists(a->path))
|
||||
{
|
||||
_e_app_new_save(a);
|
||||
img = 0;
|
||||
|
@ -1027,53 +1026,56 @@ e_app_fields_save(E_App *a)
|
|||
ef = eet_open(a->path, EET_FILE_MODE_READ_WRITE);
|
||||
if (!ef) return;
|
||||
|
||||
if(a->name)
|
||||
if (a->name)
|
||||
{
|
||||
/*if (lang) snprintf(buf, sizeof(buf), "app/info/name[%s]", lang);
|
||||
else */snprintf(buf, sizeof(buf), "app/info/name");
|
||||
else */
|
||||
snprintf(buf, sizeof(buf), "app/info/name");
|
||||
eet_write(ef, buf, a->name, strlen(a->name), 0);
|
||||
}
|
||||
|
||||
if(a->generic)
|
||||
if (a->generic)
|
||||
{
|
||||
/*if (lang) snprintf(buf, sizeof(buf), "app/info/generic[%s]", lang);
|
||||
else */snprintf(buf, sizeof(buf), "app/info/generic");
|
||||
else */
|
||||
snprintf(buf, sizeof(buf), "app/info/generic");
|
||||
eet_write(ef, buf, a->generic, strlen(a->generic), 0);
|
||||
}
|
||||
|
||||
if(a->comment)
|
||||
if (a->comment)
|
||||
{
|
||||
/*if (lang) snprintf(buf, sizeof(buf), "app/info/comment[%s]", lang);
|
||||
else*/ snprintf(buf, sizeof(buf), "app/info/comment");
|
||||
else*/
|
||||
snprintf(buf, sizeof(buf), "app/info/comment");
|
||||
eet_write(ef, buf, a->comment, strlen(a->comment), 0);
|
||||
}
|
||||
|
||||
if(a->exe)
|
||||
if (a->exe)
|
||||
eet_write(ef, "app/info/exe", a->exe, strlen(a->exe), 0);
|
||||
if(a->win_name)
|
||||
if (a->win_name)
|
||||
eet_write(ef, "app/window/name", a->win_name, strlen(a->win_name), 0);
|
||||
if(a->win_class)
|
||||
if (a->win_class)
|
||||
eet_write(ef, "app/window/class", a->win_class, strlen(a->win_class), 0);
|
||||
if(a->win_title)
|
||||
if (a->win_title)
|
||||
eet_write(ef, "app/window/title", a->win_title, strlen(a->win_title), 0);
|
||||
if(a->win_role)
|
||||
if (a->win_role)
|
||||
eet_write(ef, "app/window/role", a->win_role, strlen(a->win_role), 0);
|
||||
if(a->icon_class)
|
||||
if (a->icon_class)
|
||||
eet_write(ef, "app/icon/class", a->icon_class, strlen(a->icon_class), 0);
|
||||
|
||||
if(a->startup_notify)
|
||||
if (a->startup_notify)
|
||||
tmp[0] = 1;
|
||||
else
|
||||
tmp[0] = 0;
|
||||
eet_write(ef, "app/info/startup_notify", tmp, 1, 0);
|
||||
|
||||
if(a->wait_exit)
|
||||
if (a->wait_exit)
|
||||
tmp[0] = 1;
|
||||
else
|
||||
tmp[0] = 0;
|
||||
eet_write(ef, "app/info/wait_exit", tmp, 1, 0);
|
||||
|
||||
if(a->image && img)
|
||||
if ((a->image) && (img))
|
||||
{
|
||||
int alpha;
|
||||
Ecore_Evas *buf;
|
||||
|
@ -1102,7 +1104,6 @@ e_app_fields_save(E_App *a)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
eet_close(ef);
|
||||
}
|
||||
|
||||
|
@ -1219,12 +1220,12 @@ _e_app_new_save(E_App *a)
|
|||
char *start, *end, *imgdir;
|
||||
int i;
|
||||
|
||||
if(!a->path)
|
||||
return 0;
|
||||
if (!a->path) return 0;
|
||||
|
||||
strcpy(tmpn, "/tmp/eapp_edit_cc.edc-tmp-XXXXXX");
|
||||
fd = mkstemp(tmpn);
|
||||
if (fd < 0) {
|
||||
if (fd < 0)
|
||||
{
|
||||
fprintf(stderr, "Unable to create tmp file: %s\n", strerror(errno));
|
||||
return 0;
|
||||
}
|
||||
|
@ -1239,7 +1240,7 @@ _e_app_new_save(E_App *a)
|
|||
|
||||
i = 0;
|
||||
|
||||
if(a->image)
|
||||
if (a->image)
|
||||
{
|
||||
start = strchr(a->image, '/');
|
||||
end = strrchr(a->image ,'/');
|
||||
|
@ -1266,7 +1267,7 @@ _e_app_new_save(E_App *a)
|
|||
if (imgdir) snprintf(ipart, sizeof(ipart), "-id %s", imgdir);
|
||||
else ipart[0] = '\0';
|
||||
|
||||
if(a->image)
|
||||
if (a->image)
|
||||
fprintf(out, EAP_EDC_TMPL, a->image, "48", "48", a->image);
|
||||
else
|
||||
fprintf(out, EAP_EDC_TMPL_EMPTY);
|
||||
|
@ -1275,7 +1276,8 @@ _e_app_new_save(E_App *a)
|
|||
snprintf(cmd, sizeof(cmd), "edje_cc -v %s %s %s", ipart, tmpn, a->path);
|
||||
ret = system(cmd);
|
||||
|
||||
if (ret < 0) {
|
||||
if (ret < 0)
|
||||
{
|
||||
fprintf(stderr, "Unable to execute edje_cc on tmp file: %s\n",
|
||||
strerror(errno));
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue