Bug 439704 - Rename the resource when putting it inside a bundle
Summary: Rename the resource when putting it inside a bundle
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: git master (please specify the git hash!)
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-09 22:47 UTC by Tiar
Modified: 2021-07-27 09:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tiar 2021-07-09 22:47:15 UTC
SUMMARY
When making a bundle, Krita should look at the "Name" of the resource and when putting the resource inside the bundle, it should rename its filename to be Name.suffix (with standard ' ' <-> '_').

It would ease some of the artists worries about weird resources names, probably.

Desired effect:
1) Before: "Old_Name.kpp" with Name "New_Name" -> "New_Name.kpp"
2) Before: "Name (1).kpp" with Name "Name" -> "Name.kpp"
3) Before: "Name.0001.kpp" with Name "Name" -> "Name.kpp"

Why?
1) Artists were complaining about filenames that don't match their expectations. It wouldn't be feasible to change the way we treat resources in the resource folder now, but it would be good to have pretty names inside an exported bundle.
2) It would allow PNG patterns to have correct names, I guess?
3) Names "Name (\d\d\d)" are copies of the resource, no point in repeating them, I guess.
4) It will both resolve some and cause some name-filename issues (created: like preset A renamed to B, then a preset B created, then the user wants to import both; solved: preset A renamed to B, then a preset A created, user wants to import both). I feel like nicer solution would be more desirable.

There is no danger that I see of "losing" any information because we don't care about versioning of the resource on the bundle creator's system anyway.

SOFTWARE/OS VERSIONS
git hash: 13f04ca236
Comment 1 Halla Rempt 2021-07-27 09:45:48 UTC
Git commit 551417acaa98eeb96f3e23e331d026b3f52a2ad8 by Halla Rempt.
Committed on 27/07/2021 at 09:44.
Pushed by rempt into branch 'master'.

On adding a resource to the bundle, use the name, not the filename

The filename can include versioning information or be confusingly
different from the name, so use the name.

M  +1    -1    plugins/extensions/resourcemanager/dlg_create_bundle.cpp

https://invent.kde.org/graphics/krita/commit/551417acaa98eeb96f3e23e331d026b3f52a2ad8