remote_surface: added hold_prev_win_img configuration value to keep saved image files.
authorGwanglim Lee <gl77.lee@samsung.com>
Tue, 27 Jun 2017 15:18:00 +0000 (00:18 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Tue, 4 Jul 2017 02:42:36 +0000 (11:42 +0900)
the default value is disabled, so if you don't change this value, the E always removes
old image files.

Change-Id: Idaef88dbfa137e37f045cdcfbccdacce87cd4e90

src/bin/e_comp_wl_rsm.c
src/bin/e_config.c
src/bin/e_config.h

index 04f9b63f1436809b05b249f4cf08bf2e1f510e52..15dbe12a6802ed1e68d165aed187c7b4f2d2187c 100644 (file)
@@ -889,8 +889,11 @@ _remote_source_destroy(E_Comp_Wl_Remote_Source *source)
    /* is it ok without client's ack ?*/
    if (source->image_path)
      {
-        RSMDBG("delete image %s", NULL, source->common.ec, "SOURCE", source, source->image_path);
-        ecore_file_remove(source->image_path);
+        if (!e_config->hold_prev_win_img)
+          {
+             RSMDBG("IMG del %s", NULL, source->common.ec, "SOURCE", source, source->image_path);
+             ecore_file_remove(source->image_path);
+          }
         eina_stringshare_del(source->image_path);
      }
 
@@ -1038,14 +1041,22 @@ _remote_source_save_done(void *data, Ecore_Thread *th)
         /* remove previous file */
         if ((source->image_path) && (e_util_strcmp(source->image_path, td->image_path)))
           {
-             ecore_file_remove(source->image_path);
+             if (!e_config->hold_prev_win_img)
+               {
+                  RSMDBG("IMG del %s", ec->pixmap, ec, "SOURCE", source, source->image_path);
+                  ecore_file_remove(source->image_path);
+               }
              eina_stringshare_del(source->image_path);
           }
         source->image_path = eina_stringshare_add(td->image_path);
         _remote_source_send_image_update(source);
      }
    else
-     ecore_file_remove(td->image_path);
+     {
+        RSMDBG("IMG not matched. del. src:%s td:%s", ec->pixmap, ec, "SOURCE",
+               source, source->image_path, td->image_path);
+        ecore_file_remove(td->image_path);
+     }
 end:
    if (ec)
      e_object_unref(E_OBJECT(ec));
@@ -1083,8 +1094,14 @@ _remote_source_save_cancel(void *data, Ecore_Thread *th)
         e_comp_wl_buffer_reference(&source->buffer_ref, NULL);
      }
 
-   if (td->image_path)
-     ecore_file_remove(td->image_path);
+   if (!e_config->hold_prev_win_img)
+     {
+        if (td->image_path)
+          {
+             RSMDBG("IMG del %s", NULL, source->common.ec, "SOURCE", source, td->image_path);
+             ecore_file_remove(td->image_path);
+          }
+     }
 
    if (source->deleted)
      {
index c77364b91760f7e82b81d4ebfd7dedcc50f16774..54728cd0ad475b917322be20e8aeced9ae90ca12 100644 (file)
@@ -278,6 +278,7 @@ _e_config_edd_init(Eina_Bool old)
    E_CONFIG_VAL(D, T, conformant_ack_timeout, DOUBLE);
    E_CONFIG_VAL(D, T, calc_vis_without_effect, UCHAR);
    E_CONFIG_VAL(D, T, save_win_buffer, UCHAR);
+   E_CONFIG_VAL(D, T, hold_prev_win_img, UCHAR);
    E_CONFIG_VAL(D, T, indicator_plug_name, STR);
    E_CONFIG_VAL(D, T, launchscreen_without_timer, UCHAR);
    E_CONFIG_VAL(D, T, log_type, INT);
@@ -478,6 +479,7 @@ e_config_load(void)
    E_CONFIG_LIMIT(e_config->conformant_ack_timeout, 3.0, 100.0);
    E_CONFIG_LIMIT(e_config->calc_vis_without_effect, 0, 1);
    E_CONFIG_LIMIT(e_config->save_win_buffer, 0, 1);
+   E_CONFIG_LIMIT(e_config->hold_prev_win_img, 0, 1);
    E_CONFIG_LIMIT(e_config->launchscreen_without_timer, 0, 1);
    E_CONFIG_LIMIT(e_config->log_type, 0, 255);
    E_CONFIG_LIMIT(e_config->rsm_buffer_release_mode, 0, 2);
index 52ec5e8713cd91c5b485782e04bc1a204e1c4813..394c0b44b476702c9bb2838902eddbc6fbed13f2 100644 (file)
@@ -175,6 +175,7 @@ struct _E_Config
    double conformant_ack_timeout;
    Eina_Bool calc_vis_without_effect;
    Eina_Bool save_win_buffer;
+   Eina_Bool hold_prev_win_img;
    const char *indicator_plug_name;
    Eina_Bool launchscreen_without_timer;
    int log_type;