Bug 360161 - Cannot "send to" if current directory is not writeable - should use temporary file location
Summary: Cannot "send to" if current directory is not writeable - should use temporary...
Status: RESOLVED FIXED
Alias: None
Product: ksnapshot
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Aaron J. Seigo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-06 16:08 UTC by Jonathan Marten
Modified: 2016-03-09 16:55 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Marten 2016-03-06 16:08:49 UTC
If KSnapshot is started in a directory which is not writeable by the current user, it is not possible to use any of the "Send to" options to send the screenshot to another application.  Trying to do so gives an error dialogue:

    KSnapshot was unable to save the image to

and messages on stderr:

ksnapshot(12038)/default KIO::SimpleJobPrivate::simpleJobInit: Invalid URL: QUrl("")
ksnapshot(12038)/default KSnapshotObject::saveTo: KSnapshot was unable to save the m_snapshot to QUrl("") type:  "PNG"


Reproducible: Always

Steps to Reproduce:
1.  Start KSnapshot in a directory that does not have write permission.
2.  Click "Send To..." and then "Gewnview"
3.  Observe error message as above.




This is the KSnapshot frameworks version ("ksnapshot 1.0.0"), current Git HEAD = 4c10d80e8.

Suspect that the problem is in KSnapshot::urlToOpen(), where it should use QDir::tempPath() as suggested in the API doc of QTemporaryFile::QTemporaryFile(const QString & templateName).
Comment 1 Jonathan Marten 2016-03-09 16:55:22 UTC
Git commit 2b68201fdd22c592cd16f4c0268009425b09c84f by Jonathan Marten.
Committed on 09/03/2016 at 16:26.
Pushed by marten into branch 'frameworks'.

Save the temporary file in /tmp instead of the current directory

M  +1    -1    ksnapshot.cpp

http://commits.kde.org/ksnapshot/2b68201fdd22c592cd16f4c0268009425b09c84f