After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 327734 - Impossible to delete several items in one time
Impossible to delete several items in one time
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Downloads
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-01-19 17:38 UTC by Baptiste Mille-Mathias
Modified: 2008-09-03 15:41 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Enables multiple selection. (3.06 KB, patch)
2007-12-07 07:13 UTC, Diego Escalante Urrelo (not reading bugmail)
reviewed Details | Review
Updated, without leaks (3.03 KB, patch)
2007-12-08 04:23 UTC, Diego Escalante Urrelo (not reading bugmail)
reviewed Details | Review
bgo_327734_download-selections_20071223 (3.16 KB, patch)
2007-12-23 06:16 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review
bgo_327734_download-selections: uses gtk_tree_model_get (3.46 KB, patch)
2007-12-23 17:31 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review

Description Baptiste Mille-Mathias 2006-01-19 17:38:54 UTC
All is in title.
it's impossible to select all items and to choose "Stop" button.
Comment 1 Baptiste Mille-Mathias 2006-01-19 17:41:46 UTC
it's not all items but several all least. :)
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2006-08-14 09:42:50 UTC
It's impossible to _select_ them, it might be possible to delete them however.
Maybe there's a reason for this (like not being possible to stop more than one element at a time :P).
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2007-12-07 07:13:17 UTC
Created attachment 100500 [details] [review]
Enables multiple selection.

This patch enables multiple selection and canceling multiple downloads, I'm not sure about what to do with pause/resume...
Comment 4 Cosimo Cecchi 2007-12-07 10:25:59 UTC
I would make it possible also for pause/resume to use multiple selection...Is there a reason you are unsure about it?
Comment 5 Diego Escalante Urrelo (not reading bugmail) 2007-12-07 20:09:24 UTC
I'm not sure what to set the label to... if I select 2paused and 1runnning, what should the label say? What should the label do?
Comment 6 Christian Persch 2007-12-07 21:01:14 UTC
+	for (; downloads; downloads = downloads->next)
+	{
+		if (!downloads->data) continue;
+		ephy_download_cancel ((EphyDownload*)downloads->data);
+		downloader_view_remove_download (dv, downloads->data);
+	}
+	
+	g_list_foreach (selected, (GFunc) gtk_tree_path_free, NULL);
+	g_list_free (selected);
+	g_list_free (downloads);

This leaks the downloads list (except for the last node).
Comment 7 Diego Escalante Urrelo (not reading bugmail) 2007-12-08 04:23:37 UTC
Created attachment 100571 [details] [review]
Updated, without leaks

I'm using the good ole l = list method. A quick explanation of how that works did the trick.

Any opinion on the resume/pause thing?
Comment 8 Baptiste Mille-Mathias 2007-12-19 15:23:25 UTC
Christian ?
Comment 9 Christian Persch 2007-12-22 23:12:13 UTC
+		gtk_tree_model_get_value (model, &iter, COL_DOWNLOAD_OBJECT, &val);

I'd just use
gtk_tree_model_get() here, not get_value.

+		downloads = g_list_append (downloads, g_value_get_object (&val));

g_list_prepend please.

+	/* We have to kill the downloads separately (not in the previous for) 
+	 * because if we did, the TreePaths would be -for example- '1' when the 
+	 * first and only iter is '0' (because we removed the previous 0, the old
+	 * 1 is now 0).
+	 */

I'd remove that 'for example' part and only say that it'd change the selection.
Comment 10 Diego Escalante Urrelo (not reading bugmail) 2007-12-23 06:16:40 UTC
Created attachment 101489 [details] [review]
bgo_327734_download-selections_20071223

Makes the comment shorter and uses gtk_tree_model_get instead of gtk_tree_model_get_value.
Comment 11 Christian Persch 2007-12-23 12:23:48 UTC
Wrong patch attached? It's still using get_value.
Comment 12 Diego Escalante Urrelo (not reading bugmail) 2007-12-23 17:31:26 UTC
Created attachment 101512 [details] [review]
bgo_327734_download-selections: uses gtk_tree_model_get

This is the correct one hopefully.
Comment 13 Christian Persch 2007-12-23 17:54:17 UTC
+	for (l = downloads; l; l = l->next)
+	{
+		if (!l->data) continue;
+		ephy_download_cancel ((EphyDownload*) l->data);
+		downloader_view_remove_download (dv, l->data);
+	}

I think you need to g_object_unref (l->data) too. With that fixed & tested, oktc. Thanks!
Comment 14 Diego Escalante Urrelo (not reading bugmail) 2007-12-24 01:32:47 UTC
Ok I tried with unref and everything is still fine. I committed it:

------------------------------------------------------------------------
r7812 | diegoe | 2007-12-23 20:29:11 -0500 (Sun, 23 Dec 2007) | 6 lines

Enable multiple selection in download dialog, now you can cancel more than one
download at a time. Note that this has no effect over the Pause button, only
over Stop.
Bug #327734.


Should we still think about the case for Pause button or shall we just close this as fixed?.
Comment 15 Reinout van Schouwen 2007-12-24 10:00:17 UTC
Speaking from the top of my head:
I think it would be OK to close this if the Pause button simply pauses/resumes _all_ downloads. However I don't think it is OK if the Pause button pauses/resumes a single selected download whereas the Stop button applies to multiple selected downloads. 
Comment 16 Diego Escalante Urrelo (not reading bugmail) 2007-12-24 16:03:42 UTC
Right now:

on single selection:
 - both buttons work on the selected download as always

on multiple selection:
 - stop works on all the selected downloads
 - pause button is insensitive


my doubt is if I should botter thinking about what to do with pause instead of insensitivizing it, should I care?