Bug 441047

Summary: "Open Containing Folder" opens wrong location when using "Copy Location to Clipboard" and not saving the screenshot manually.
Product: [Applications] Spectacle Reporter: M. Schulte <mschulte.g>
Component: GeneralAssignee: Boudhayan Gupta <me>
Status: RESOLVED FIXED    
Severity: normal CC: kde, meven29, nate
Priority: NOR    
Version: 21.08.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 21.12

Description M. Schulte 2021-08-16 14:07:00 UTC
SUMMARY
When using the "Copy Location to Clipboard" button (dropdown option of the "Copy Image To Clipboard" button) without manually saving, Spectacle will save the screenshot in a temporary directory and correctly copy the path to that file.

The green bar that pop up to say that the screenshot has been saved contains a button "Open Containing Folder" which will not open the correct path, which should be the temporary directory. Instead the last file that was manually saved using "Save As..." shows up in the file explorer.

STEPS TO REPRODUCE
1. Take a new screenshot, do not save it manually
2. Use "Copy Location to Clipboard"
3. Click "Open Containing Folder"

OBSERVED RESULT
The directory where the last screenshot was manually saved will open.

EXPECTED RESULT
The temporary directory with the freshly created Screenshot should open.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2021-08-20 10:34:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/76
Comment 2 Méven Car 2021-08-23 08:15:40 UTC
Git commit b753cbec8e7cca6f27533e8b7964ff4233241463 by Méven Car, on behalf of Jan Paul Batrina.
Committed on 23/08/2021 at 08:15.
Pushed by meven into branch 'master'.

Copy the correct file path to clipboard

Previously, the path copied was always the temporary
save file path unless the image was autosaved.
Now, ExportManager keeps track of whether the image has
been saved, and that is used for choosing the correct path.

M  +12   -3    src/ExportManager.cpp
M  +2    -0    src/ExportManager.h
M  +10   -1    src/Gui/KSMainWindow.cpp

https://invent.kde.org/graphics/spectacle/commit/b753cbec8e7cca6f27533e8b7964ff4233241463