Bug 390612 - kget directory not writable
Summary: kget directory not writable
Status: RESOLVED FIXED
Alias: None
Product: kget
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KGet authors
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-17 15:07 UTC by Thomas McNicholas
Modified: 2018-03-05 14:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 17.12.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas McNicholas 2018-02-17 15:07:54 UTC
When attempting to download a file with a link from the clipboard it states that 'Directory is not writable' but Kget will download that same file to that same location on the system with the manual download option without issue.

KGet version: 2.95.0
KDE Plasma: 5.12.1, KDE Frameworks: 5.43.0, Qt: 5.10.1, Kernel: 4.15.3-2
Comment 1 Wolfgang Bauer 2018-02-19 11:57:38 UTC
(In reply to Thomas McNicholas from comment #0)
> When attempting to download a file with a link from the clipboard it states
> that 'Directory is not writable'

Hm, it works fine here when middle-clicking on the systray icon at least...
I suppose you mean "Auto-Paste Mode"? (with this I do get the mentioned error)

If not, please post exact steps to reproduce it.
Comment 2 Thomas McNicholas 2018-02-19 12:32:08 UTC
In Firefox; copy link location, up pops the Save As dialog, click Save, Error - KGet 'Directory is not writable'

Works fine as new download.

The following is of doing that task on kget while in terminal.

$ kget
QObject::connect: Cannot connect (null)::saveYourself() to MainWindow::slotSaveMyself()
QWidget::insertAction: Attempt to insert null action
QWidget::insertAction: Attempt to insert null action
kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find ""
kf5.kio.core: Refilling KProtocolInfoFactory cache in the hope to find ""
kf5.kio.core: KSambaShare: Could not find smb.conf!
^C
Comment 3 Wolfgang Bauer 2018-02-19 13:46:37 UTC
(In reply to Thomas McNicholas from comment #2)
> In Firefox; copy link location, up pops the Save As dialog, click Save,
By default, nothing (kget related) happens at all in this case. ;-)

Must indeed be the "Auto-Paste" setting then though, i.e. the option "Monitor Clipboard For Files to Download" in "Integration".

I found the problem already and will submit a fix in the next days.
Comment 4 Thomas McNicholas 2018-02-19 13:50:28 UTC
Cool, thanks.
Comment 5 Wolfgang Bauer 2018-03-05 14:33:10 UTC
Git commit ed694ff5f5c8418a93d59bae6b68e11b9816c1f3 by Wolfgang Bauer.
Committed on 05/03/2018 at 14:28.
Pushed by wbauer into branch 'Applications/17.12'.

Fix destDir handling in KGet::addTransfer()

destDir is supposed to be a local path, so treat it as such and use
QUrl::fromLocalFile() to convert it to QUrl.
And use QUrl::path() to get the directory as QString, QUrl::toString()
returns an Url including "file://".

Also, adjust KGet::redownloadTransfer() this change, it should actually
pass a path as destDir (without "file://"), and avoid an unnecessary
QUrl->QString->QUrl conversion for the src whilst at it.

This fixes spurious "Directory is not writable" errors when trying to
add a download via the clipboard "Auto-Paste" feature or DBUS.
FIXED-IN: 17.12.3

M  +8    -9    core/kget.cpp

https://commits.kde.org/kget/ed694ff5f5c8418a93d59bae6b68e11b9816c1f3