enlightenment-cvs@lists.sourceforge.net wrote:
Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
e_int_config_background.c e_thumb.c e_winlist.c

Log Message:


sharpies patch.

(strlen(buf) == 0) == BAD :)

((!buf) || (!buf[0])) == GOOD !



===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_config_background.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- e_int_config_background.c   14 Jan 2006 16:05:35 -0000      1.17
+++ e_int_config_background.c   15 Jan 2006 07:11:02 -0000      1.18
@@ -101,7 +101,9 @@
        e_bg_del(cfbg->container, cfbg->zone, cfbg->desk_x, cfbg->desk_y);
      }
    if (e_config->desktop_default_background) 
evas_stringshare_del(e_config->desktop_default_background);
-   e_config->desktop_default_background = evas_stringshare_add(cfdata->file);
+   if (strlen(cfdata->file) == 0) e_config->desktop_default_background = NULL;
+   else
+     e_config->desktop_default_background = evas_stringshare_add(cfdata->file);
    e_bg_update();
    e_config_save_queue();
    if (cfdata->current_file) free(cfdata->current_file);
@@ -115,9 +117,22 @@
    E_Config_Dialog_Data *cfdata;
cfdata = data;
-   e_widget_image_object_set
-     (cfdata->cfd->data,
-      e_thumb_evas_object_get(cfdata->file, cfdata->cfd->dia->win->evas, 200, 
160, 1));
+   if (strlen(cfdata->file) == 0)
+     {
+       Evas_Object *bg;
+       
+       bg = edje_object_add(cfdata->cfd->dia->win->evas);
+       e_theme_edje_object_set(bg, "base/theme/background", 
"desktop/background");
+       e_widget_image_object_set(cfdata->cfd->data, bg);
+     }
+   else
+     {
+       e_widget_image_object_set
+         (cfdata->cfd->data,
+          e_thumb_evas_object_get(cfdata->file,
+                                  cfdata->cfd->dia->win->evas,
+                                  160, 120, 1));
+     }
if (cfdata->current_file) { if (!strcmp(cfdata->file, cfdata->current_file)) @@ -181,7 +196,9 @@
        e_bg_del(z->container->num, -1, -1, -1);
        e_bg_del(z->container->num, z->num, -1, -1);
        if (e_config->desktop_default_background) 
evas_stringshare_del(e_config->desktop_default_background);
-       e_config->desktop_default_background = 
evas_stringshare_add(cfdata->file);
+       if (strlen(cfdata->file) == 0) e_config->desktop_default_background = 
NULL;
+       else
+         e_config->desktop_default_background = 
evas_stringshare_add(cfdata->file);
        e_bg_update();
        e_config_save_queue();
        break;
@@ -190,7 +207,8 @@
        e_bg_del(-1, z->num, x, y);
        e_bg_del(z->container->num, -1, x, y);
        e_bg_del(z->container->num, z->num, x, y);
-       e_bg_add(z->container->num, z->num, x, y, cfdata->file);
+       if (strlen(cfdata->file) != 0)
+         e_bg_add(z->container->num, z->num, x, y, cfdata->file);
        e_bg_update();
         e_config_save_queue();
        break;
@@ -202,7 +220,8 @@
             cfbg = e_config->desktop_backgrounds->data;
             e_bg_del(cfbg->container, cfbg->zone, cfbg->desk_x, cfbg->desk_y);
          }
-       e_bg_add(-1, -1, -1, -1, cfdata->file);
+       if (strlen(cfdata->file) != 0)
+         e_bg_add(-1, -1, -1, -1, cfdata->file);
        e_bg_update();
         e_config_save_queue();
        break;
@@ -269,6 +288,7 @@
    char *homedir;
    E_Zone *z;
    int iw, ih, pw, ph;
+   Evas_Object *oi;
homedir = e_user_homedir_get();
    if (homedir)
@@ -292,6 +312,14 @@
        ph = 120;
        pw = ((double)z->w * ph) / (double)z->h;
      }
+
+   oi = evas_object_rectangle_add(evas);
+   evas_object_color_set(oi, 0, 0, 0, 0);
+   e_widget_ilist_append(il, oi, _("Theme Background"),
+                        _e_config_bg_cb_standard, cfd->cfdata, "");
+ + if ((!e_config->desktop_default_background))
+     e_widget_ilist_selected_set(il, 0);
if (ecore_file_is_dir(buf))
      {
@@ -302,7 +330,8 @@
          {
             char *bgfile;
             char fullbg[PATH_MAX];
-            int i = 0;
+            Evas_Object *o, *otmp;
+            int i = 1;
while ((bgfile = ecore_list_next(bgs)))
               {
@@ -326,7 +355,7 @@
                            bg = edje_object_add(evas);
                            edje_object_file_set(bg, 
e_config->desktop_default_background, "desktop/background");
                            im = e_widget_image_add_from_object(evas, bg, pw, 
ph);
-                           e_widget_image_object_set(im, 
e_thumb_evas_object_get(fullbg, evas, 200, 160, 1));
+                           e_widget_image_object_set(im, 
e_thumb_evas_object_get(fullbg, evas, 160, 120, 1));
                         }
                       free(noext);
                       i++;
@@ -339,8 +368,6 @@
if (im == NULL)
      {
-       /* FIXME: this is broken as the edje extends outside at the start
-        * for some reason */
        bg = edje_object_add(evas);
        e_theme_edje_object_set(bg, "base/theme/background", 
"desktop/background");
        im = e_widget_image_add_from_object(evas, bg, pw, ph);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_thumb.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- e_thumb.c   13 Jan 2006 06:38:43 -0000      1.22
+++ e_thumb.c   15 Jan 2006 07:11:02 -0000      1.23
@@ -201,7 +201,7 @@
      return 1;
thumb = e_thumb_file_get(file);
-   if (ecore_file_exists(thumb))
+   if ((thumb) && (ecore_file_exists(thumb)))
      {
        free(thumb);
        return 1;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_winlist.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- e_winlist.c 7 Jan 2006 10:39:45 -0000       1.39
+++ e_winlist.c 15 Jan 2006 07:11:02 -0000      1.40
@@ -555,16 +555,16 @@
            (e_config->winlist_warp_while_selecting))
{ warp_to_x = ww->border->x + (ww->border->w / 2); - if (warp_to_x < 1)
-              warp_to_x = (ww->border->x + ww->border->w) / 2;
-            else if (warp_to_x > (ww->border->zone->w - 1))
- warp_to_x = ww->border->x + ((ww->border->zone->w - ww->border->x) / 2); + if (warp_to_x < (ww->border->zone->x + 1))
+              warp_to_x = ww->border->zone->x + ((ww->border->x + ww->border->w - 
ww->border->zone->x) / 2);
+            else if (warp_to_x >= (ww->border->zone->x + ww->border->zone->w - 
1))
+ warp_to_x = (ww->border->zone->x + ww->border->zone->w + ww->border->x) / 2; warp_to_y = ww->border->y + (ww->border->h / 2);
-            if (warp_to_y < 1)
-              warp_to_y = (ww->border->y + ww->border->h) / 2;
-            else if (warp_to_y > (ww->border->zone->h - 1))
- warp_to_y = ww->border->y + ((ww->border->zone->h - ww->border->y) / 2); + if (warp_to_y < (ww->border->zone->y + 1))
+              warp_to_y = ww->border->zone->y + ((ww->border->y + ww->border->h - 
ww->border->zone->y) / 2);
+            else if (warp_to_y >= (ww->border->zone->y + ww->border->zone->h - 
1))
+ warp_to_y = (ww->border->zone->y + ww->border->zone->h + ww->border->y) / 2; }
        if (e_config->winlist_warp_while_selecting)
          {




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to