Bug 294041 - bluedevil receive file fails when destination is ~/Documents
Summary: bluedevil receive file fails when destination is ~/Documents
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: bluetooth (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Fiestas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-14 04:35 UTC by Dave Flogeras
Modified: 2012-06-30 13:19 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Flogeras 2012-02-14 04:35:56 UTC
Version:           unspecified (using KDE 4.8.0) 
OS:                Linux

Using libbluedevil 1.9 and bluedevil 1.2.1:

If the default destination for received files is set to "/home/user/Documents", this results in the bluedevilreceiverrc file having no "saveUrl=..." entry and it refuses to receive a file.

I can fix it by setting it to anything but the Documents folder.

Reproducible: Always

Steps to Reproduce:
Set "Save files in" to /home/user/Documents

Actual Results:  
Will not receive files

Expected Results:  
Should receive files

Workaround is to set to anything but /home/user/Documents
Comment 1 Dave Flogeras 2012-02-14 11:58:11 UTC
Yet on another system, set up the same way (same kde/bluedevil versions), this works.  The rc file still has no saveUrl field, but I can successfully receive a file (and it does in fact end up in Documents).

There must be something different about the KDE install that I cannot see. Let me know if there is anything I can do to help debug. I am running Gentoo, so recompiling and patching is not an issue and I am comfortable doing so.
Comment 2 Alex Fiestas 2012-04-28 00:43:47 UTC
Well this seems something wrong in your config or permissions, can you check that folder is r+x at least?
Comment 3 Dave Flogeras 2012-05-01 02:01:59 UTC
Right you are, on the machine that it was failing there was in fact no "Documents" folder at all (shame on me for missing that). That account was created before KDE automatically created "Documents" as part of the standard set of directories for new accounts.

Could you maybe make the configuration dialog show red if the folder does not exist?
Comment 4 Alex Fiestas 2012-06-30 09:23:19 UTC
I'm going to do something like:

1-Check if the directory exists
2-If it doesn't, create it
3-If we can't create it, fallback to ~/Documents
4-if ~/Documents doesn't exists, create it.

Going to implement this today.
Comment 5 Alex Fiestas 2012-06-30 13:19:06 UTC
Git commit 21eb2f540a1e20fb9e52a4141f83f684fd287247 by Alex Fiestas.
Committed on 30/06/2012 at 15:11.
Pushed by afiestas into branch '1.0'.

Check if we have permission to save the files in the destination folder

First we check if the destination folder exists and is writeable.
If it doesn't exists we try to create it.

If we can't use the configure destination folder, we fallback to
DocumentsLocation also checking if it doesn't exists and creating it
en case it does exists.

M  +23   -1    src/daemon/helpers/filereceiver/openobex/server.cpp
M  +1    -0    src/daemon/helpers/filereceiver/openobex/server.h

http://commits.kde.org/bluedevil/21eb2f540a1e20fb9e52a4141f83f684fd287247
Comment 6 Alex Fiestas 2012-06-30 13:19:06 UTC
Git commit 903b8ce122576f9b2740d5c3fa92cc0f7c31c9cf by Alex Fiestas.
Committed on 30/06/2012 at 15:11.
Pushed by afiestas into branch '1.1'.

Check if we have permission to save the files in the destination folder

First we check if the destination folder exists and is writeable.
If it doesn't exists we try to create it.

If we can't use the configure destination folder, we fallback to
DocumentsLocation also checking if it doesn't exists and creating it
en case it does exists.
(cherry picked from commit 21eb2f540a1e20fb9e52a4141f83f684fd287247)

Conflicts:

	src/daemon/helpers/filereceiver/openobex/server.cpp

M  +25   -0    src/daemon/helpers/filereceiver/openobex/server.cpp
M  +1    -0    src/daemon/helpers/filereceiver/openobex/server.h

http://commits.kde.org/bluedevil/903b8ce122576f9b2740d5c3fa92cc0f7c31c9cf