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 774460 - No progressbar while importing files from camera
No progressbar while importing files from camera
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
3.22.x
Other Linux
: Normal normal
: 3.22
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-15 09:48 UTC by Maxim
Modified: 2016-12-10 00:09 UTC
See Also:
GNOME target: ---
GNOME version: 3.21/3.22


Attachments
screenshot (65.84 KB, image/png)
2016-11-15 09:48 UTC, Maxim
  Details
file-operations: Fix progress of copies over gvfs (3.87 KB, patch)
2016-11-24 10:17 UTC, Christophe Fergeau
none Details | Review
file-operations: Fix progress of copies over gvfs (2.27 KB, patch)
2016-11-24 10:18 UTC, Christophe Fergeau
none Details | Review
file-operations: Fix progress of copies over gvfs (3.85 KB, patch)
2016-11-28 11:00 UTC, Christophe Fergeau
committed Details | Review

Description Maxim 2016-11-15 09:48:57 UTC
Created attachment 339904 [details]
screenshot

After upgrading from 3.20 to 3.22 I noticed that nautilus not showing progress of import media from my Canon SX50. 

No progress, only n/0 files, no Mb/s speed.

Downgrading from gvfs/gvfs-gphoto 1.30 to 1.28 not resolving a proplem.
Comment 1 Christophe Fergeau 2016-11-24 09:31:00 UTC
I've seen a similar problem when copying from an iphone, I believe it's related to bug #766027 and https://git.gnome.org/browse/nautilus/commit/?id=24dae9e
This expects G_FILE_ATTRIBUTE_ID_FILE to be available, and won't get number of files/bytes to copy if it's not there. The problem is that no gvfs backends seem to provide it (unless there is a fallback somewhere, I only git grep'ed for it in gvfs git repository).
Comment 2 Christophe Fergeau 2016-11-24 10:17:44 UTC
Created attachment 340673 [details] [review]
file-operations: Fix progress of copies over gvfs

commit 24dae9e0a "file-operations: avoid scanning the same files"
added a way to skip files which have already been processed
in scan_dir(). To do that, the code uses G_FILE_ATTRIBUTE_ID_FILE,
which does not seem to be widely implemented by gvfs modules.

When the file has no ID, it will not be accounted for in the SourceInfo
structure used to track copy progress, resulting in progress not being
shown, and Nautilus saying that it's copying 0 files.

This commit changes the logic to use the file URI instead of the file ID
to check if the  file has already been processed.
Comment 3 Christophe Fergeau 2016-11-24 10:18:00 UTC
Created attachment 340674 [details] [review]
file-operations: Fix progress of copies over gvfs

commit 24dae9e0a "file-operations: avoid scanning the same files"
added a way to skip files which have already been processed
in scan_dir(). To do that, the code uses G_FILE_ATTRIBUTE_ID_FILE,
which does not seem to be widely implemented by gvfs modules.

When the file has no ID, it will not be accounted for in the SourceInfo
structure used to track copy progress, resulting in progress not being
shown, and Nautilus saying that it's copying 0 files.

This commit changes the logic to process the file if it has no ID, or if
its ID hasn't been seen yet. An alternative would be to g_file_get_uri()
rather than G_FILE_ATTRIBUTE_ID_FILE to detect already processed files.
Comment 4 Christophe Fergeau 2016-11-24 10:18:32 UTC
Either of these patches fixes the issue for me.
Comment 5 Maxim 2016-11-27 21:15:09 UTC
Builded with patch over 3.22 branch and issue is fixed for me too. Tested with MTP/PTP.
Comment 6 Christophe Fergeau 2016-11-28 11:00:31 UTC
Created attachment 340889 [details] [review]
file-operations: Fix progress of copies over gvfs

commit 24dae9e0a "file-operations: avoid scanning the same files"
added a way to skip files which have already been processed
in scan_dir(). To do that, the code uses G_FILE_ATTRIBUTE_ID_FILE,
which does not seem to be widely implemented by gvfs modules.

When the file has no ID, it will not be accounted for in the SourceInfo
structure used to track copy progress, resulting in progress not being
shown, and Nautilus saying that it's copying 0 files.

This commit changes the logic to use the file URI instead of the file ID
to check if the  file has already been processed.
Comment 7 Christophe Fergeau 2016-11-28 11:02:42 UTC
(In reply to Christophe Fergeau from comment #6)
> Created attachment 340889 [details] [review] [review]
> file-operations: Fix progress of copies over gvfs

Only change from the previous iteration is the use of GAuto*. I haven't been able to test it yet though because of some gvfs/nautilus issues on my machine making it unable to detect my iPhone :)
Comment 8 Carlos Soriano 2016-12-09 23:10:32 UTC
Review of attachment 340889 [details] [review]:

Thanks for the patch! there is a small nitpick I will fix in a upcoming patch (so I can commit already and do a release with your patch in it :) )

::: src/nautilus-file-operations.c
@@ +3178,3 @@
+            file = g_file_enumerator_get_child (enumerator, info);
+            file_uri = g_file_get_uri (file);
+            g_warn_if_fail (file_uri != NULL);

this cannot happen, so the warn is not needed.

@@ +3341,2 @@
+        file_uri = g_file_get_uri (file);
+        g_warn_if_fail (file_uri != NULL);

ditto