Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_fileselector.c ewl_misc.c ewl_misc.h ewl_window.c 


Log Message:
Filedialog is now able to traverse to the root directory. Added a debugging
work around for MallocDebug and strdup. Some minor changes to the window
realize code.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_fileselector.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- ewl_fileselector.c  17 Feb 2004 17:53:47 -0000      1.34
+++ ewl_fileselector.c  25 Feb 2004 06:57:28 -0000      1.35
@@ -322,20 +322,15 @@
                        ptr--;
                        *ptr = '\0';
                        ptr = strrchr(path, '/');
-                       if (!ptr) {
-                               *path = '/';
-                               ptr = path + 1;
-                       }
-
+                       ptr++;
                        *ptr = '\0';
-                       snprintf (dir, PATH_MAX, "%s", path);
-               }
-               else {
-                       if (!strcmp (ptr, "/"))
-                               snprintf (dir, PATH_MAX, "/%s", ptr);
-                       else
-                               snprintf (dir, PATH_MAX, "%s", ptr);
+
+                       if (strcmp(path, "/")) {
+                               ptr--;
+                               *ptr = '\0';
+                       }
                }
+               snprintf (dir, PATH_MAX, "%s", path);
        }
 
        IF_FREE(fs->item);
@@ -348,13 +343,20 @@
                void *ev_data, void *user_data)
 {
        Ewl_Fileselector *fs;
+       char *format;
        char path[PATH_MAX];
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
 
        fs = EWL_FILESELECTOR (user_data);
-       snprintf(path, PATH_MAX, "%s/%s", fs->path,
+
+       if (!strcmp(fs->path, "/"))
+               format = "%s%s";
+       else
+               format = "%s/%s";
+
+       snprintf(path, PATH_MAX, format, fs->path,
                 ewl_text_get_text(EWL_TEXT(w)));
 
        ewl_fileselector_directory_adjust (fs, path);
@@ -367,6 +369,7 @@
 {
        char *dir;
        char path[PATH_MAX];
+       char *format;
        Ewl_Fileselector *fs;
        
        DENTER_FUNCTION(DLEVEL_STABLE);
@@ -375,7 +378,12 @@
        fs = EWL_FILESELECTOR (user_data);
 
        dir = ewl_text_get_text(EWL_TEXT(w));
-       snprintf(path, PATH_MAX, "%s/%s", fs->path, dir);
+
+       if (!strcmp(fs->path, "/"))
+               format = "%s%s";
+       else
+               format = "%s/%s";
+       snprintf(path, PATH_MAX, format, fs->path, dir);
 
        IF_FREE(dir);
        ewl_fileselector_directory_adjust (fs, path);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -3 -r1.63 -r1.64
--- ewl_misc.c  23 Feb 2004 05:43:27 -0000      1.63
+++ ewl_misc.c  25 Feb 2004 06:57:28 -0000      1.64
@@ -687,3 +687,14 @@
 
        return 1;
 }
+
+#ifdef DEBUG_MALLOCDEBUG
+char *strdup(const char *str)
+{
+       char *dst = malloc(strlen(str) + 1);
+       if (dst)
+               strcpy(dst, str);
+
+       return dst;
+}
+#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- ewl_misc.h  3 Feb 2004 19:54:02 -0000       1.24
+++ ewl_misc.h  25 Feb 2004 06:57:28 -0000      1.25
@@ -32,4 +32,9 @@
 void            ewl_evas_destroy(Evas *evas);
 void            ewl_evas_object_destroy(Evas_Object *obj);
 
+/* #define DEBUG_MALLOCDEBUG 1 */
+#ifdef DEBUG_MALLOCDEBUG
+char *strdup(const char *str);
+#endif
+
 #endif                         /* __EWL_MISC_H__ */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_window.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- ewl_window.c        24 Feb 2004 04:25:39 -0000      1.72
+++ ewl_window.c        25 Feb 2004 06:57:28 -0000      1.73
@@ -400,17 +400,18 @@
        else
 #endif
 #ifdef HAVE_EVAS_ENGINE_FB
-       else if (!strcmp(render, "fb")) {
+       if (!strcmp(render, "fb")) {
                Evas_Engine_Info_FB *fbinfo;
                fbinfo->info.virtual_terminal = 0;
                fbinfo->info.device_number = 0;
                fbinfo->info.refresh = 0;
-               fbinfo->info.rotation = ee->rotation;
+               fbinfo->info.rotation = 0;
                evas_engine_info_set(evas, (Evas_Engine_Info *)fbinfo);
        }
+       else
 #endif
 #ifdef HAVE_EVAS_ENGINE_SOFTWARE_X11_H
-       {
+       if (!strcmp(render, "software_x11")) {
                Evas_Engine_Info_Software_X11 *sinfo;
 
                sinfo = (Evas_Engine_Info_Software_X11 *)info;
@@ -427,6 +428,9 @@
                sinfo->info.debug = 0;
        }
 #endif
+       else {
+               DRETURN(DLEVEL_STABLE);
+       }
 
        evas_engine_info_set(evas, info);
 




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to