Bug 382080

Summary: Exporting the second file in a row doesn't suggest a correct file name
Product: [Applications] krita Reporter: Dmitry Kazakov <dimula73>
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: halla
Priority: NOR    
Version First Reported In: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Dmitry Kazakov 2017-07-06 22:12:05 UTC
1) Open file AAA.kra
2) Press File->Export. Krita suggests to export it as AAA.kra (which is correct)
3) Export it as AAA.png
4) In the same Krita run open file BBB.kra
5) Press File->Export

Now Krita suggests to Export it as AAA.png again! I would expect Krita to suggest saving it as BBB.png

That happens because in KisMainWindow::saveDocument() we save both lastExportUrl and lastExportMimeType, and reuse them after the first save. I would expect it to save mime type only.

WISHGROUP: Small Usability Fixes
Comment 1 Halla Rempt 2017-07-07 08:40:16 UTC
Not quite. lastExportUrl is used to make sure the export goes to the last used directory, but since KoFileDialog is hopelessly confused it also sets the filename.
Comment 2 Halla Rempt 2017-07-07 12:22:30 UTC
Git commit 7dcfbbdcb1a2b5fdc5f7c6f237c6c55eca86cc83 by Boudewijn Rempt.
Committed on 07/07/2017 at 12:22.
Pushed by rempt into branch 'master'.

Be smarter about remembering the last used save location
Related: bug 353433

M  +1    -1    libs/impex/ColorModelCheck.h
M  +3    -0    libs/koplugin/KisMimeDatabase.cpp
M  +48   -44   libs/ui/KisMainWindow.cpp
M  +17   -16   libs/widgetutils/KoFileDialog.cpp
M  +1    -1    libs/widgetutils/KoFileDialog.h

https://commits.kde.org/krita/7dcfbbdcb1a2b5fdc5f7c6f237c6c55eca86cc83