Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Krita Krita
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Bugzilla
    • Bugzilla
  • Merge requests 54
    • Merge requests 54
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • Graphics
  • KritaKrita
  • Merge requests
  • !1284

Remove resource file after import if it cannot be loaded

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Agata Cacko requested to merge tymond/krita:tiar/remove_imported_incorrect_resources into master Jan 06, 2022
  • Overview 8
  • Commits 2
  • Pipelines 6
  • Changes 1

Before this commit, if the user tried to import a resource file that is incorrect (cannot be loaded for any reason), Krita would still leave the incorrect file in the resource folder. While it could potentially have some uses (for example the user is importing a resource file that works with a different version of Krita, or with different plugins), usually it's unneeded and the file imported is indeed in incorrect file format etc.

This commit ensures that if the freshly imported resource file cannot be loaded, it is removed.

BUG:446279

https://bugs.kde.org/show_bug.cgi?id=446279

Test Plan

  1. Create a file called pattern.png~ (can be an image file or not)
  2. Import it before my MR.
  3. See that it's in the /patterns/ folder despite Krita saying that the import failed (because Krita can't read that file)
  4. Remove that file
  5. Switch to the MR version
  6. Import the file
  7. See that it's nowhere to be seen in /patterns/

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.
Edited Jan 08, 2022 by Agata Cacko
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: tiar/remove_imported_incorrect_resources