Draft: Fix psd layer info for single layers
Not writing the layer info when only having more than two children for the root layer causes loss of data if the first child is a layer group. Additionally, other layer properties such as name and opacity and more do not get saved.
Removing this conditional check ensures the layers are always saved.
Test Plan
- Create new document, rename the single default layer, for example to "color"
- Ensure said layer has no opacity.
- Save as psd file
- Close document
- Reopen document
- Layer name keeps the new name, in this example "color".
Same applies for creating a layer group and creating several layers inside of it that without this fix would be merged into a single "Background" layer.
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) -
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
I did run the plugins/impex/psd/tests/kis_psd_test
tests, and they supposedly ran all successfully, but given I saw the following warning I doubt they actually ran successfully on my local machine:
QWARN : KisPSDTest::testSavingAllFormats() krita.general: Environment variable "KRITA_UNITTESTS_DATA_DIR" is not set
QWARN : KisPSDTest::testSavingAllFormats() External folder is not present, skipping...
PASS : KisPSDTest::testSavingAllFormats()
Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.