[Webkit-unassigned] [Bug 98334] [EFL][WK2] Fix destination path when download with suggested filename on the Minibrowser

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 3 23:38:47 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=98334





--- Comment #7 from Christophe Dumez <christophe.dumez at intel.com>  2012-10-03 23:39:11 PST ---
(From update of attachment 167038)
View in context: https://bugs.webkit.org/attachment.cgi?id=167038&action=review

> Tools/MiniBrowser/efl/main.c:203
> +    Ewk_Download_Job* download = (Ewk_Download_Job*)event_info;

Star on wrong side

> Tools/MiniBrowser/efl/main.c:204
> +    const char* suggested_name =  ewk_download_job_suggested_filename_get(download);

Star on wrong side + extra space after = sign

> Tools/MiniBrowser/efl/main.c:206
> +        // FIX ME: The destination folder should be a specific folder user selected, but now set to '/tmp' temporary.

// FIXME: The destination folder should be selected by the user but we set it to '/tmp' for now.

> Tools/MiniBrowser/efl/main.c:207
> +        char* destination_path = malloc(strlen(suggested_name) + 6);

It would be nice to use eina string buffer for this:
http://docs.enlightenment.org/auto/eina/group__Eina__String__Buffer__Group.html

Note that destination_path does not seem to be freed currently.

> Tools/MiniBrowser/efl/main.c:209
> +            sprintf(destination_path, "/tmp/%s", suggested_name);

snprintf would have been safer but I prefer we use eina string buffer anyway.

> Tools/MiniBrowser/efl/main.c:210
> +            ewk_download_job_destination_set(download, destination_path);

It would be nice to print something on stdout like:
"Downloading to /tmp/xxxxxxx..."

> Tools/MiniBrowser/efl/main.c:212
> +    }

else case? If the download does not have a suggested name, we should probably download it anyway. Maybe generate a unique file name?

> Tools/MiniBrowser/efl/main.c:254
> +    evas_object_smart_callback_add(app->browser, "download,request", on_download_request, app);

How about listening for "download,finished" and "download,failed" as well in order to print something on stdout?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list