| Summary: | Cannot Drag/Drop Screenshot Due To Subfolder in Filename | ||
|---|---|---|---|
| Product: | [Applications] Spectacle | Reporter: | Dubfiance <tdgalland> |
| Component: | General | Assignee: | Boudhayan Gupta <me> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | bugseforuns, f.baumg, kde, nate |
| Priority: | NOR | ||
| Version First Reported In: | 19.12.2 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://commits.kde.org/spectacle/464dde9677f4270c5d2ecfddf45c192a33493efe | Version Fixed/Implemented In: | 20.04.0 |
| Sentry Crash Report: | |||
| Attachments: |
patch for creating subdirs in tmp dir
correct patch for creating subdirs in tmp dir |
||
|
Description
Dubfiance
2020-02-15 21:24:22 UTC
I have the same Problem. I've also configured Subfolders based on date.
My save filename is set to to "%Y/%M/screen-%2d".
Ran spectacle in strace and saw it try to open a file in /tmp without mkdir-ing the subfolders first, thus failing.
openat(AT_FDCWD, "/tmp/Spectacle.MIzolT/2020/02/screen-01.png", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = -1 ENOENT (No such file or directory)
The temporary dir exists, the subfolders do not:
% tree /tmp/Spectacle.MIzolT
/tmp/Spectacle.MIzolT
0 directories, 0 files
After that I ran
mkdir -p /tmp/Spectacle.MIzolT/2020/02/
and tried again, no error occurred then and the screenshot was saved correctly:
% tree /tmp/Spectacle.MIzolT
/tmp/Spectacle.MIzolT
└── 2020
└── 02
└── screen-01.png
2 directories, 1 file
So spectacle should do either of:
1. Create the subdirs if they do not exist, as it does when savong normally
2. Strip the subdirs when saving temporarily
VERSION INFORMATION
% spectacle --version
spectacle 19.12.2
Operating System: Arch Linux
KDE Plasma Version: 5.18.2
KDE Frameworks Version: 5.67.0
Qt Version: 5.15.0
Kernel Version: 5.5.6-arch1-1
Created attachment 127406 [details]
patch for creating subdirs in tmp dir
I've been using this patch for a while now with 0.03.90 and 0.03.80.
Worked fine for me, but I'm not sure if that's the way to properly do it.
localSave() uses similar code, though.
Created attachment 127407 [details]
correct patch for creating subdirs in tmp dir
Sorry, wrong patch file, this is the correct one.
Thanks for the patch! Can you submit it using https://phabricator.kde.org? See https://community.kde.org/Get_Involved/Issue_Reporting#Submit_patches_using_Phabricator.2C_not_the_issue_tracker oh, I thought that was for dev's only not for "casual patch posting". Sorry. Will try submitting to phabricator soon. Did I do it right? https://phabricator.kde.org/D28702 You did! Let's continue there. Git commit 464dde9677f4270c5d2ecfddf45c192a33493efe by Nate Graham, on behalf of Franz Baumgärtner. Committed on 13/04/2020 at 01:33. Pushed by ngraham into branch 'release/20.04'. Fix inability to Drag+Drop screenshot due to subfolder in filename Summary: Fixes the mentioned bug by creating all necessary subdirectories. Test Plan: 1. Set save Filename in Spectacle to one including one or more `/`, thus including subdirectories. Example: `%Y/%M/screen-%2d` 2. Take a screenshot 3. Start dragging the preview Reviewers: #spectacle, davidre, ngraham Reviewed By: #spectacle, davidre, ngraham Subscribers: ngraham, davidre, #spectacle Tags: #spectacle Differential Revision: https://phabricator.kde.org/D28702 M +2 -1 src/ExportManager.cpp https://commits.kde.org/spectacle/464dde9677f4270c5d2ecfddf45c192a33493efe |