Bug 445308 - Document Name is outdated
Summary: Document Name is outdated
Status: RESOLVED INTENTIONAL
Alias: None
Product: krita
Classification: Applications
Component: Scripting (other bugs)
Version First Reported In: 5.0.0-beta2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-11 04:24 UTC by keyth_qcfx2
Modified: 2021-11-11 09:27 UTC (History)
1 user (show)

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 keyth_qcfx2 2021-11-11 04:24:29 UTC
SUMMARY
File Name is outdated when asking Python the documents name.

STEPS TO REPRODUCE
1. Create a new file
2. Save new file as “test_AAA.kra”
3. now save file again as “test_BBB.kra”
4. Close file
5. Open file “test_BBB.kra”
6. Go to: Tools > Scripts > Scripter
7. Run the following code:
"""
import krita
name = Krita.instance().activeDocument().name()
print(str(name))
"""

OBSERVED RESULT
Result file name will always be the first saved name “test_AAA” being outdate regardless of the version of the file.

EXPECTED RESULT
should output "test_BBB" as the file name "test_BBB.kra" indicates.

SOFTWARE/OS VERSIONS
Windows: 10
Qt Version: 5.12
Comment 1 Halla Rempt 2021-11-11 09:27:59 UTC
The image name is not the same thing as the filename, so this is expected. This dates back to when Krita could store multiple images in a single file, but because of compatibility issues, it's pretty hard to refactor this out. Use filename() instead.