Bug 311659 - [wish] easy purge/delete of blacklisted preset
Summary: [wish] easy purge/delete of blacklisted preset
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: git master (please specify the git hash!)
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-13 22:51 UTC by David REVOY
Modified: 2012-12-28 16:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David REVOY 2012-12-13 22:51:56 UTC
Hi, 
The wish here  is to have a feature to delete from disk blacklisted preset kept on ~/.kde/share/apps/krita/paintoppresets  
( list of preset contained in ~/.kde/share/apps/krita/kis_paintoppresets.blacklist )

Purpose : to ease packing/sharing of brush for Krita : it's actually hard to choose the good preset to share with other user on the preset folder, as Krita keep all version there , and the newer preset in filename is not necessary the newer version ; so it's a problem.
( screenshot of my folder, with underlines  : http://wstaw.org/m/2012/12/13/2012-12-13_screenshot_003.jpeg )

GUI exemple : 
Main menu :  Edit > Ressources > Clean blacklisted preset on disk
( a warning dialog with more infos can appear and prompt to confirm with a " Yes / Cancel" choice )
Comment 1 Halla Rempt 2012-12-14 11:11:39 UTC
Ack -- there is still quite a bit of work to do on preset management, and I haven't managed to find a volunteer yet :-(. But it's definitely high on the list.
Comment 2 David REVOY 2012-12-14 14:11:27 UTC
No problem and thanks for the fast reply. 

Here I'm able to do a bit of 'bash' as a work-around ( I learn ) ; so I can :

install the tool 'xml-grep' on ubuntu/debian 
sudo apt-get install xml-twig-tools
then do :
xml_grep 'name' kis_paintoppresets.blacklist --text_only 
then it return all the path , so I can copy only the path from my user folder, and place 
rm
in front of each path line  ( I also clean the blacklist with a text editor ).
Comment 3 David REVOY 2012-12-14 14:23:06 UTC
I just found a bit faster, so I paste it here  :

xml_grep 'name' kis_paintoppresets.blacklist --text_only > tempblacklist.txt
( then edit tempblacklist.txt to keep only the path you want to remove, and replace with Kate ~ by /home/username to make links absolute, save )
cat tempblacklist.txt | xargs -d \\n rm
Comment 4 Sven Langkamp 2012-12-15 03:32:07 UTC
Should be pretty straight forward to implement, I can have a look on it after Christmas. I think we just  need a single dialog were you can check which resource types you want to clean up.

Complete resource management (undo deleted resources etc) is a different beast.
Comment 5 Sven Langkamp 2012-12-22 14:39:22 UTC
Git commit 4da201f7d914f9b055ed188418db6076657f39a6 by Sven Langkamp.
Committed on 22/12/2012 at 15:37.
Pushed by langkamp into branch 'master'.

add functionality to remove blacklisted resources

M  +2    -1    krita/krita.rc
M  +9    -0    krita/plugins/paintops/libbrush/kis_brush_server.cpp
M  +3    -0    krita/plugins/paintops/libbrush/kis_brush_server.h
M  +2    -0    krita/ui/CMakeLists.txt
A  +60   -0    krita/ui/dialogs/kis_dlg_blacklist_cleanup.cpp     [License: GPL (v2+)]
C  +10   -36   krita/ui/dialogs/kis_dlg_blacklist_cleanup.h [from: krita/plugins/paintops/libbrush/kis_brush_server.h - 051% similarity]
A  +125  -0    krita/ui/forms/wdgdlgblacklistcleanup.ui
M  +5    -0    krita/ui/kis_resource_server_provider.cpp
M  +4    -0    krita/ui/kis_resource_server_provider.h
M  +12   -0    krita/ui/kis_view2.cpp
M  +1    -0    krita/ui/kis_view2.h
M  +47   -50   libs/widgets/KoResourceServer.h

http://commits.kde.org/calligra/4da201f7d914f9b055ed188418db6076657f39a6
Comment 6 Jean-Nicolas Artaud 2012-12-28 16:55:44 UTC
Git commit aaba63c6f9e0b742abb3590d09c7a178dfd4b148 by Jean-Nicolas Artaud, on behalf of Sven Langkamp.
Committed on 22/12/2012 at 15:37.
Pushed by artaud into branch 'flake-configwidgets-boemann'.

add functionality to remove blacklisted resources

M  +2    -1    krita/krita.rc
M  +9    -0    krita/plugins/paintops/libbrush/kis_brush_server.cpp
M  +3    -0    krita/plugins/paintops/libbrush/kis_brush_server.h
M  +2    -0    krita/ui/CMakeLists.txt
A  +60   -0    krita/ui/dialogs/kis_dlg_blacklist_cleanup.cpp     [License: GPL (v2+)]
C  +10   -36   krita/ui/dialogs/kis_dlg_blacklist_cleanup.h [from: krita/plugins/paintops/libbrush/kis_brush_server.h - 051% similarity]
A  +125  -0    krita/ui/forms/wdgdlgblacklistcleanup.ui
M  +5    -0    krita/ui/kis_resource_server_provider.cpp
M  +4    -0    krita/ui/kis_resource_server_provider.h
M  +12   -0    krita/ui/kis_view2.cpp
M  +1    -0    krita/ui/kis_view2.h
M  +47   -50   libs/widgets/KoResourceServer.h

http://commits.kde.org/calligra/aaba63c6f9e0b742abb3590d09c7a178dfd4b148