summaryrefslogtreecommitdiff
path: root/src/lib/ecore_file
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:09 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:10 -0500
commit6326e18b3fb2a4757f8ffa22be5d55a75da23049 (patch)
tree31d586b52638aa0d0b1c759869a8e3368c9daf5d /src/lib/ecore_file
parent7924660d54500285d3844bfa384394c683825cd9 (diff)
efl.file: improve api a bit
Summary: the previous implementation/api had a number of issues: * "file" property contained both "file" and "key" values - also performed file loading operation * "load_error" property which was specific to image objects * no methods for controlling file loading/unloading this patch attempts the following changes: * split "file" property into "file" and "key" properties - also remove "key" from existing "mmap" property * remove "load_error" * directly return error codes from operations * add "load" and "unload" methods for directly controlling load state * add implicit file loading if file/mmap is set during construction * rewrite all efl.file implementations to move file loading into load() method * rewrite all usage of efl.file api based on these changes * add C extension functions to mimic previous behavior ref T7577 Reviewers: segfaultxavi, bu5hm4n, cedric Reviewed By: segfaultxavi Subscribers: vitor.sousa, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7577 Differential Revision: https://phab.enlightenment.org/D8018
Diffstat (limited to 'src/lib/ecore_file')
-rw-r--r--src/lib/ecore_file/ecore_file_download.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/ecore_file/ecore_file_download.c b/src/lib/ecore_file/ecore_file_download.c
index 54666693d2..4b65c51ee6 100644
--- a/src/lib/ecore_file/ecore_file_download.c
+++ b/src/lib/ecore_file/ecore_file_download.c
@@ -66,7 +66,7 @@ _ecore_file_download_copier_done(void *data, const Efl_Event *event EINA_UNUSED)
66 Efl_Net_Http_Status status = efl_net_dialer_http_response_status_get(job->input); 66 Efl_Net_Http_Status status = efl_net_dialer_http_response_status_get(job->input);
67 const char *file; 67 const char *file;
68 68
69 efl_file_get(job->output, &file, NULL); 69 file = efl_file_get(job->output);
70 70
71 DBG("Finished downloading %s (status=%d) -> %s", 71 DBG("Finished downloading %s (status=%d) -> %s",
72 efl_net_dialer_address_dial_get(job->input), 72 efl_net_dialer_address_dial_get(job->input),
@@ -92,7 +92,7 @@ _ecore_file_download_copier_error(void *data, const Efl_Event *event)
92 Eina_Error *perr = event->info; 92 Eina_Error *perr = event->info;
93 const char *file; 93 const char *file;
94 94
95 efl_file_get(job->output, &file, NULL); 95 file = efl_file_get(job->output);
96 96
97 WRN("Failed downloading %s (status=%d) -> %s: %s", 97 WRN("Failed downloading %s (status=%d) -> %s: %s",
98 efl_net_dialer_address_dial_get(job->input), 98 efl_net_dialer_address_dial_get(job->input),
@@ -127,7 +127,7 @@ _ecore_file_download_copier_progress(void *data, const Efl_Event *event EINA_UNU
127 127
128 if (!job->progress_cb) return; 128 if (!job->progress_cb) return;
129 129
130 efl_file_get(job->output, &file, NULL); 130 file = efl_file_get(job->output);
131 efl_net_dialer_http_progress_download_get(job->input, &dn, &dt); 131 efl_net_dialer_http_progress_download_get(job->input, &dn, &dt);
132 efl_net_dialer_http_progress_upload_get(job->input, &un, &ut); 132 efl_net_dialer_http_progress_upload_get(job->input, &un, &ut);
133 ret = job->progress_cb((void *)job->data, file, dt, dn, ut, un); 133 ret = job->progress_cb((void *)job->data, file, dt, dn, ut, un);
@@ -227,7 +227,7 @@ ecore_file_download_full(const char *url,
227 EINA_SAFETY_ON_NULL_GOTO(job->input, error_input); 227 EINA_SAFETY_ON_NULL_GOTO(job->input, error_input);
228 228
229 job->output = efl_add(EFL_IO_FILE_CLASS, loop, 229 job->output = efl_add(EFL_IO_FILE_CLASS, loop,
230 efl_file_set(efl_added, dst, NULL), 230 efl_file_set(efl_added, dst),
231 efl_io_file_flags_set(efl_added, O_WRONLY | O_CREAT), 231 efl_io_file_flags_set(efl_added, O_WRONLY | O_CREAT),
232 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE), 232 efl_io_closer_close_on_exec_set(efl_added, EINA_TRUE),
233 efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE), 233 efl_io_closer_close_on_invalidate_set(efl_added, EINA_TRUE),
@@ -309,7 +309,7 @@ ecore_file_download_abort(Ecore_File_Download_Job *job)
309 return; 309 return;
310 } 310 }
311 311
312 efl_file_get(job->output, &file, NULL); 312 file = efl_file_get(job->output);
313 DBG("Aborting download %s -> %s", 313 DBG("Aborting download %s -> %s",
314 efl_net_dialer_address_dial_get(job->input), 314 efl_net_dialer_address_dial_get(job->input),
315 file); 315 file);