Changeset 172437 in webkit
- Timestamp:
- Aug 12, 2014 1:22:05 AM (10 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r172430 r172437 1 2014-08-12 Shivakumar JM <shiva.jm@samsung.com> 2 3 [EFL][WK2] Minibrowser: Enhance the application to use download directory selector. 4 https://bugs.webkit.org/show_bug.cgi?id=135791 5 6 Reviewed by Gyuyoung Kim. 7 8 Currently Minibrowser stores the downloaded files to /tmp directory, add support so that destination folder can be selected by the 9 user. 10 11 * MiniBrowser/efl/main.c: 12 (on_download_request): 13 1 14 2014-08-11 Grzegorz Czajkowski <g.czajkowski@samsung.com> 2 15 -
trunk/Tools/MiniBrowser/efl/main.c
r171906 r172437 655 655 { 656 656 Ewk_Download_Job *download = (Ewk_Download_Job *)event_info; 657 658 // FIXME: The destination folder should be selected by the user but we set it to '/tmp' for now. 657 Browser_Window *window = (Browser_Window *)user_data; 658 659 659 Eina_Strbuf *destination_path = eina_strbuf_new(); 660 661 const char *home_path = getenv("HOME"); 662 Eina_Stringshare *save_file_path = show_file_entry_dialog(window, "DOWNLOAD", home_path ? home_path : "/tmp"); 663 664 if (save_file_path) 665 eina_strbuf_append_printf(destination_path, "%s", save_file_path); 666 else 667 eina_strbuf_append(destination_path, "/tmp"); 660 668 661 669 const char *suggested_name = ewk_download_job_suggested_filename_get(download); 662 670 if (suggested_name && *suggested_name) 663 eina_strbuf_append_printf(destination_path, "/ tmp/%s", suggested_name);671 eina_strbuf_append_printf(destination_path, "/%s", suggested_name); 664 672 else { 665 673 // Generate a unique file name since no name was suggested. 666 char unique_path[] = "/tmp/downloaded-file.XXXXXX"; 667 if (mkstemp(unique_path) == -1) { 674 eina_strbuf_append(destination_path, "/downloaded-file.XXXXXX"); 675 char *url = NULL; 676 url = eina_strbuf_string_steal(destination_path); 677 if (mkstemp(url) == -1) { 668 678 info("ERROR: Could not generate a unique file name."); 669 679 return; 670 680 } 671 eina_strbuf_append(destination_path, u nique_path);681 eina_strbuf_append(destination_path, url); 672 682 } 673 683 … … 675 685 info("Downloading: %s", eina_strbuf_string_get(destination_path)); 676 686 eina_strbuf_free(destination_path); 687 eina_stringshare_del(save_file_path); 677 688 } 678 689
Note: See TracChangeset
for help on using the changeset viewer.