upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / gwget / trunk / various-fixes.patch
blob9ec743cf060106c462b3b8787eae1eb9234d10e7
1 diff -Naur gwget-1.0.4.orig/src/gwget-application.c gwget-1.0.4/src/gwget-application.c
2 --- gwget-1.0.4.orig/src/gwget-application.c 2018-01-19 11:03:01.897778000 +0100
3 +++ gwget-1.0.4/src/gwget-application.c 2018-01-19 11:14:58.065852512 +0100
4 @@ -103,8 +103,9 @@
6 gwgetdata = gwget_data_new ((gchar *)url);
8 - gwget_data_add_download(gwgetdata);
9 - gwget_data_start_download(gwgetdata);
10 + if (gwget_data_add_download(gwgetdata)) {
11 + gwget_data_start_download(gwgetdata);
12 + }
14 return TRUE;
16 @@ -126,8 +127,9 @@
17 gwgetdata->dir = gwget_pref.download_dir;
20 - gwget_data_add_download(gwgetdata);
21 - gwget_data_start_download(gwgetdata);
22 + if (gwget_data_add_download(gwgetdata)) {
23 + gwget_data_start_download(gwgetdata);
24 + }
26 return TRUE;
28 diff -Naur gwget-1.0.4.orig/src/gwget_data.c gwget-1.0.4/src/gwget_data.c
29 --- gwget-1.0.4.orig/src/gwget_data.c 2018-01-19 11:03:01.907778000 +0100
30 +++ gwget-1.0.4/src/gwget_data.c 2018-01-19 11:41:09.319442608 +0100
31 @@ -540,7 +540,12 @@
32 if (length == 0) {
33 dir = gwget_pref.download_dir;
37 + length = strlen (dir);
38 + if (length == 0) {
39 + dir = g_get_home_dir();
40 + }
42 /* Add a trailing '/' unless already present */
43 length = strlen (dir);
44 if (dir[length - 1] == '/')
45 @@ -682,7 +687,7 @@
48 /* Add a gwgetdata to the main window */
49 -void
50 +gboolean
51 gwget_data_add_download(GwgetData *gwgetdata)
53 gint response;
54 @@ -692,7 +697,7 @@
55 if (check_url_already_exists(gwgetdata->url)) {
56 run_dialog_information(_("Unable to add this download"),
57 _("This download is already added"));
58 - return;
59 + return FALSE;
62 /* if the url it's not a file drop a dialog to recurse into the url */
63 @@ -728,6 +733,7 @@
64 downloads = g_list_append(downloads,gwgetdata);
65 new_download(gwgetdata);
66 gwget_data_set_state(gwgetdata,DL_NOT_CONNECTED);
67 + return TRUE;
70 void
71 diff -Naur gwget-1.0.4.orig/src/gwget_data.h gwget-1.0.4/src/gwget_data.h
72 --- gwget-1.0.4.orig/src/gwget_data.h 2009-06-16 19:58:06.000000000 +0200
73 +++ gwget-1.0.4/src/gwget_data.h 2018-01-19 11:10:17.784148648 +0100
74 @@ -126,7 +126,7 @@
75 void gwget_data_free(gpointer data);
76 void gwget_data_stop_download(GwgetData *data);
77 void gwget_data_set_filename_from_url(GwgetData *gwgetdata, gchar *url);
78 -void gwget_data_add_download(GwgetData *gwgetdata);
79 +gboolean gwget_data_add_download(GwgetData *gwgetdata);
80 void gwget_data_exec(GwgetData *gwgetdata);
81 void gwget_data_set_menus (GwgetData *gwgetdata);
82 void gwget_data_set_popupmenu (GwgetData *gwgetdata);
83 diff -Naur gwget-1.0.4.orig/src/main.c gwget-1.0.4/src/main.c
84 --- gwget-1.0.4.orig/src/main.c 2018-01-19 11:03:01.897778000 +0100
85 +++ gwget-1.0.4/src/main.c 2018-01-19 11:11:27.529567168 +0100
86 @@ -194,8 +194,9 @@
87 if (destination_dir) {
88 gwgetdata->dir = destination_dir;
90 - gwget_data_add_download(gwgetdata);
91 - gwget_data_start_download(gwgetdata);
92 + if (gwget_data_add_download(gwgetdata)) {
93 + gwget_data_start_download(gwgetdata);
94 + }
95 g_object_unref (file);
98 diff -Naur gwget-1.0.4.orig/src/new_window.c gwget-1.0.4/src/new_window.c
99 --- gwget-1.0.4.orig/src/new_window.c 2018-01-19 11:03:01.911112000 +0100
100 +++ gwget-1.0.4/src/new_window.c 2018-01-19 11:30:04.102904944 +0100
101 @@ -58,22 +58,14 @@
103 if (strcmp(url,"")) {
104 save_in=g_strdup(gtk_entry_get_text (GTK_ENTRY(save_in_entry)));
106 - if (!strcmp(save_in,"") && gwget_pref.download_dir) {
107 - save_in=g_strdup(gwget_pref.download_dir);
110 - if (!strcmp(save_in,"") && !gwget_pref.download_dir) {
111 - save_in=g_strdup(g_get_home_dir());
114 save_in_list = g_strdup(save_in);
115 if (g_list_find_custom(save_in_paths, save_in, (GCompareFunc) strcmp)==NULL) {
116 save_in_paths = g_list_prepend (save_in_paths, save_in_list);
118 gwgetdata = gwget_data_create (url, save_in);
119 - gwget_data_add_download(gwgetdata);
120 - gwget_data_start_download(gwgetdata);
121 + if (gwget_data_add_download(gwgetdata)) {
122 + gwget_data_start_download(gwgetdata);
124 gtk_widget_hide(window);
125 g_free(save_in);