From: Enlightenment C. <no...@cv...> - 2006-08-13 21:58:56
|
Enlightenment CVS committal Author : titan Project : e17 Module : apps/e Dir : e17/apps/e/src/bin Modified Files: e_widget_fsel.c Log Message: Formatting =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_widget_fsel.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- e_widget_fsel.c 13 Aug 2006 06:51:33 -0000 1.9 +++ e_widget_fsel.c 13 Aug 2006 21:58:55 -0000 1.10 @@ -385,13 +385,17 @@ if (preview) { - e_widget_frametable_object_append(wd->o_preview_frame, wd->o_preview_preview_table, - 0, 0, 1, 1, 1, 1, 1, 1); - e_widget_frametable_object_append(wd->o_preview_frame, wd->o_preview_table, - 0, 1, 1, 1, 1, 1, 1, 1); - e_widget_table_object_append(wd->o_table2, wd->o_preview_frame, - 2, 1, 1, 1, 1, 1, 1, 1); + e_widget_frametable_object_append(wd->o_preview_frame, + wd->o_preview_preview_table, + 0, 0, 1, 1, 1, 1, 1, 1); + e_widget_frametable_object_append(wd->o_preview_frame, + wd->o_preview_table, + 0, 1, 1, 1, 1, 1, 1, 1); + e_widget_table_object_append(wd->o_table2, + wd->o_preview_frame, + 2, 1, 1, 1, 1, 1, 1, 1); } + e_widget_table_object_append(wd->o_table, wd->o_table2, 0, 0, 1, 1, 1, 1, 1, 1); e_widget_table_object_append(wd->o_table, wd->o_entry, @@ -467,15 +471,18 @@ char size[1024]; dsize = (double)st_size; - if (dsize < 1024) snprintf(size, 1024, "%'.0f B", dsize); + if (dsize < 1024) + snprintf(size, 1024, "%'.0f B", dsize); else { dsize /= 1024.0; - if (dsize < 1024) snprintf(size, 1024, "%'.0f KB", dsize); + if (dsize < 1024) + snprintf(size, 1024, "%'.0f KB", dsize); else { dsize /= 1024.0; - if (dsize < 1024) snprintf(size, 1024, "%'.0f MB", dsize); + if (dsize < 1024) + snprintf(size, 1024, "%'.0f MB", dsize); else { dsize /= 1024.0; @@ -492,12 +499,15 @@ char name[PATH_MAX]; struct passwd *pwd; - if (getuid() == st_uid) snprintf(name, PATH_MAX, "You"); + if (getuid() == st_uid) + snprintf(name, PATH_MAX, "You"); else { pwd = getpwuid(st_uid); - if (pwd) snprintf(name, PATH_MAX, "%s", pwd->pw_name); - else snprintf(name, PATH_MAX, "%-8d", (int)st_uid); + if (pwd) + snprintf(name, PATH_MAX, "%s", pwd->pw_name); + else + snprintf(name, PATH_MAX, "%-8d", (int)st_uid); } return strdup(name); } @@ -518,12 +528,17 @@ int other_write = 0; int i; - if (getuid() == st_uid) owner = 1; - if (getgid() == st_gid) group = 1; + if (getuid() == st_uid) + owner = 1; + if (getgid() == st_gid) + group = 1; perm = (char *)malloc(sizeof(char) * 10); - for (i = 0; i < 9; i++) perm[i] = '-'; + + for (i = 0; i < 9; i++) + perm[i] = '-'; perm[9] = '\0'; + if ((S_IRUSR & st_mode) == S_IRUSR) { perm[0] = 'r'; @@ -534,7 +549,8 @@ perm[1] = 'w'; user_write = 1; } - if ((S_IXUSR & st_mode) == S_IXUSR) perm[2] = 'x'; + if ((S_IXUSR & st_mode) == S_IXUSR) + perm[2] = 'x'; if ((S_IRGRP & st_mode) == S_IRGRP) { @@ -546,7 +562,8 @@ perm[4] = 'w'; group_write = 1; } - if ((S_IXGRP & st_mode) == S_IXGRP) perm[5] = 'x'; + if ((S_IXGRP & st_mode) == S_IXGRP) + perm[5] = 'x'; if ((S_IROTH & st_mode) == S_IROTH) { @@ -558,34 +575,40 @@ perm[6] = 'w'; other_write = 1; } - if ((S_IXOTH & st_mode) == S_IXOTH) perm[8] = 'x'; + if ((S_IXOTH & st_mode) == S_IXOTH) + perm[8] = 'x'; if (owner) { - if ((!user_read) && (!user_write)) snprintf(perms, PATH_MAX, - "Protected"); - else if ((user_read) && (!user_write)) snprintf(perms, PATH_MAX, - "Read Only"); - else if ((user_read) && (user_write)) access = 1; + if ((!user_read) && (!user_write)) + snprintf(perms, PATH_MAX, "Protected"); + else if ((user_read) && (!user_write)) + snprintf(perms, PATH_MAX, "Read Only"); + else if ((user_read) && (user_write)) + access = 1; } else if (group) { - if ((!group_read) && (!group_write)) snprintf(perms, PATH_MAX, - "Forbidden"); - else if ((group_read) && (!group_write)) snprintf(perms, PATH_MAX, - "Read Only"); - else if ((group_read) && (group_write)) access = 1; + if ((!group_read) && (!group_write)) + snprintf(perms, PATH_MAX, "Forbidden"); + else if ((group_read) && (!group_write)) + snprintf(perms, PATH_MAX, "Read Only"); + else if ((group_read) && (group_write)) + access = 1; } else if ((!owner) && (!group)) { - if ((!other_read) && (!other_write)) snprintf(perms, PATH_MAX, - "Forbidden"); - else if ((other_read) && (!other_write)) snprintf(perms, PATH_MAX, - "Read Only"); - else if ((other_read) && (other_write)) access = 1; - } - if (!access) return strdup(perms); - else return strdup("Read-Write"); + if ((!other_read) && (!other_write)) + snprintf(perms, PATH_MAX, "Forbidden"); + else if ((other_read) && (!other_write)) + snprintf(perms, PATH_MAX, "Read Only"); + else if ((other_read) && (other_write)) + access = 1; + } + if (!access) + return strdup(perms); + else + return strdup("Read-Write"); } static char * @@ -598,19 +621,25 @@ ltime = time(NULL); diff = difftime(ltime, st_modtime); - if (diff <= 60) snprintf(modtime, PATH_MAX, "Under a minute ago"); - if (diff > 60) snprintf(modtime, PATH_MAX, "%d minutes ago", ((int)diff/60)); - if (diff >= 3600) snprintf(modtime, PATH_MAX, "%d hours ago", ((int)diff/3600)); - if (diff >= 86400) snprintf(modtime, PATH_MAX, "%d days ago", ((int)diff/86400)); - if (diff >= 604800) snprintf(modtime, PATH_MAX, "%d weeks ago", - ((int)diff/604800)); - if (diff >= 2592000) snprintf(modtime, PATH_MAX, "%d months ago", - ((int)diff/2592000)); - if (diff >= 31526000) snprintf(modtime, PATH_MAX, "%d years ago", - ((int)diff/31526000)); + if (diff <= 60) + snprintf(modtime, PATH_MAX, "Under a minute ago"); + if (diff > 60) + snprintf(modtime, PATH_MAX, "%d minutes ago", ((int)diff/60)); + if (diff >= 3600) + snprintf(modtime, PATH_MAX, "%d hours ago", ((int)diff/3600)); + if (diff >= 86400) + snprintf(modtime, PATH_MAX, "%d days ago", ((int)diff/86400)); + if (diff >= 604800) + snprintf(modtime, PATH_MAX, "%d weeks ago", ((int)diff/604800)); + if (diff >= 2592000) + snprintf(modtime, PATH_MAX, "%d months ago", ((int)diff/2592000)); + if (diff >= 31526000) + snprintf(modtime, PATH_MAX, "%d years ago", ((int)diff/31526000)); - if (modtime) motime = strdup(modtime); - else motime = strdup("unknown"); + if (modtime) + motime = strdup(modtime); + else + motime = strdup("unknown"); return motime; } |