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

sh_zam <sh...@sdf.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://invent.kde.org/grap
                   |                            |hics/krita/commit/cc8f304a7
                   |                            |da266b909d70104ce0d9de7aee7
                   |                            |f3b8

--- Comment #10 from sh_zam <sh...@sdf.org> ---
Git commit cc8f304a7da266b909d70104ce0d9de7aee7f3b8 by Sharaf Zaman.
Committed on 09/08/2022 at 06:06.
Pushed by szaman into branch 'master'.

Make Krita's canvas input profile migrate-able from version 5 to 6

The porting (PROFILE_VERSION - 1) to PROFILE_VERSION works as something
like this, with entry point being loadProfile():

1. We fill two lists, `profileEntries`: one with profiles with profile version
being
PROFILE_VERSION, `profileEntriesToMigrate`: one with profiles with version
being (PROFILE_VERSION - 1).

2. We go through the list we want to migrate and check if there is a
corresponding version of it in `profileEntries` and that has to exist in
user-local directory (not in install location -- which is the profile
version we ship).

        a. If there doesn't exist one, we migrate the profile entry. And
        remove it from `profileEntriesToMigrate`.
        b. If there exists one (which isn't in user-local), we don't
        migrate.

3. Once we get what we have to migrate and what we don't. We invoke
`KisInputProfileMigrator` to migrate the entries and because it will
change how you want to carry out migration, it is an abstract class.

       a. Currently we invoke `KisInputProfileMigrator5To6`, which
       handles the migration where we have need to import only the new
       touch shortcuts.

4. Once we've migrated, we copy the old file to same directory with
version number suffix added to the filename -- this old file is what
will be loaded by the old version of Krita if it ever is opened.

5. That's all, at this point we can save the new profile at the location
where the old version was.
Related: bug 455846

M  +1    -1    krita/data/input/kritadefault.profile
M  +1    -1    krita/data/input/painttoolsaicompatible.profile
M  +1    -1    krita/data/input/photoshopcompatible.profile
M  +1    -0    libs/ui/CMakeLists.txt
A  +105  -0    libs/ui/input/KisInputProfileMigrator.cpp     [License:
LGPL(v2.0+)]
A  +65   -0    libs/ui/input/KisInputProfileMigrator.h     [License:
LGPL(v2.0+)]
M  +109  -53   libs/ui/input/kis_input_profile_manager.cpp
M  +7    -0    libs/ui/input/kis_input_profile_manager.h

https://invent.kde.org/graphics/krita/commit/cc8f304a7da266b909d70104ce0d9de7aee7f3b8

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to