Bug 441047 - "Open Containing Folder" opens wrong location when using "Copy Location to Clipboard" and not saving the screenshot manually.
Summary: "Open Containing Folder" opens wrong location when using "Copy Location to Cl...
Status: RESOLVED FIXED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 21.08.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Boudhayan Gupta
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-16 14:07 UTC by M. Schulte
Modified: 2021-08-23 22:17 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 21.12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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