Bug 325684 - filetransfer: shared non-media files get timestamp as name
Summary: filetransfer: shared non-media files get timestamp as name
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Unclassified
Component: android-application (show other bugs)
Version: unspecified
Platform: Android Android 4.x
: NOR normal (vote)
Target Milestone: ---
Assignee: Albert Vaca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-06 00:46 UTC by Mauro Panzeri
Modified: 2013-10-30 00:46 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Here's a patch to manage filename and size when the scheme of the uri is "file://" (5.41 KB, patch)
2013-10-06 01:06 UTC, Mauro Panzeri
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Panzeri 2013-10-06 00:46:41 UTC
non-media files get timestamp as name instead of their real name when they are transferred on apaired device.

Works ok for media files (audio, images...)

Reproducible: Always

Steps to Reproduce:
1. select a file (EG: foo.txt) from the file manager on Android
2. share 
3. select kdeconnect
4. select a paired device (EG: mylaptop)
Actual Results:  
on the desktop mylaptop appear a file named with a unix timestamp instead of foo.txt

Expected Results:  
foo.txt should be created.
Comment 1 Mauro Panzeri 2013-10-06 01:05:14 UTC
The problem resides in the ShareToReceiver.queuedSendUriList method.
When you share a file from a file-manager, the uri you get is "file://...", but the managedQuery function expects to query the media content provider, so managedQuery will return a null cursor.

Here's a patch to manage filename and size when the scheme of the uri is "file://"
Comment 2 Mauro Panzeri 2013-10-06 01:06:32 UTC
Created attachment 82682 [details]
Here's a patch to manage filename and size when the scheme of the uri is "file://"
Comment 3 Albert Vaca 2013-10-30 00:46:16 UTC
Git commit e459d792d01268ab6889fc584cac0520ef78e0e8 by Albert Vaca, on behalf of Mauro Panzeri.
Committed on 14/10/2013 at 16:32.
Pushed by albertvaka into branch 'master'.

"Share to" now retrieves filename for file:// uris too

Querying the ContentProvider only works for content://... uris but when you
share a file from a file-manager, the uri you get has the form file://... and
ContentProvider returns a null cursor.
REVIEW: 113202

M  +47   -27   src/main/java/org/kde/kdeconnect/UserInterface/ShareToReceiver.java

http://commits.kde.org/kdeconnect-android/e459d792d01268ab6889fc584cac0520ef78e0e8