The plugin's code was refactored closer to Krita's usual coding style.
Also fixes saving/loading Python plugin enable flags.
rempt |
Krita |
The plugin's code was refactored closer to Krita's usual coding style.
Also fixes saving/loading Python plugin enable flags.
Lint Skipped |
Unit Tests Skipped |
Maybe the plugins should be enabled instead of disabled by default? Or we could add a default enabled/disabled setting in the .desktop files' metadata.
Also, after enabling some plugins, I get a crash on shutdown, and on restarting the last plugin I enabled isn't loaded:
Exception ignored in: <module 'threading' from '/usr/lib64/python3.4/threading.py'>
Traceback (most recent call last):
File "/usr/lib64/python3.4/threading.py", line 1283, in _shutdown t = _pickSomeNonDaemonThread() File "/usr/lib64/python3.4/threading.py", line 1290, in _pickSomeNonDaemonThread for t in enumerate(): File "/usr/lib64/python3.4/threading.py", line 1260, in enumerate return list(_active.values()) + list(_limbo.values())
KeyError: 'tenscripts'
Then on starting and closing Krita again, I get an assert:
Thread 1 (Thread 0x7f890a982940 (LWP 25921)):
[KCrash Handler]
#6 0x00007f89000b7260 in QObject::thread() const () at /usr/lib64/libQt5Core.so.5
#7 0x00007f89067ac716 in kis_assert_common(char const*, char const*, int, bool, bool) (assertion=assertion@entry=0x7f88a84a9245 "!plugin.m_loaded", file=file@entry=0x7f88a84a9528 "/home/boud/dev/jouni/plugins/extensions/pykrita/plugin/PythonPluginManager.cpp", line=line@entry=374, throwException=throwException@entry=false, isIgnorable=isIgnorable@entry=true) at /home/boud/dev/jouni/libs/global/kis_assert.cpp:66
#8 0x00007f89067acbfd in kis_safe_assert_recoverable(char const*, char const*, int) (assertion=assertion@entry=0x7f88a84a9245 "!plugin.m_loaded", file=file@entry=0x7f88a84a9528 "/home/boud/dev/jouni/plugins/extensions/pykrita/plugin/PythonPluginManager.cpp", line=line@entry=374) at /home/boud/dev/jouni/libs/global/kis_assert.cpp:108
#9 0x00007f88a849ed08 in PythonPluginManager::unloadModule(PythonPlugin&) (this=this@entry=0xa41e760, plugin=...) at /home/boud/dev/jouni/plugins/extensions/pykrita/plugin/PythonPluginManager.cpp:374
#10 0x00007f88a84a2766 in PythonPluginManager::unloadAllModules() (this=this@entry=0xa41e760) at /home/boud/dev/jouni/plugins/extensions/pykrita/plugin/PythonPluginManager.cpp:110
#11 0x00007f88a84a2a84 in PythonPluginManager::~PythonPluginManager() (this=0xa41e760, in_chrg=<optimized out>) at /home/boud/dev/jouni/plugins/extensions/pykrita/plugin/PythonPluginManager.cpp:83
#12 0x00007f88a84a2b09 in PythonPluginManager::~PythonPluginManager() (this=0xa41e760, in_chrg=<optimized out>) at /home/boud/dev/jouni/plugins/extensions/pykrita/plugin/PythonPluginManager.cpp:87
#13 0x00007f88ff21c139 in run_exit_handlers () at /lib64/libc.so.6
#14 0x00007f88ff21c185 in () at /lib64/libc.so.6
#15 0x00007f88ff2056ec in libc_start_main () at /lib64/libc.so.6
#16 0x00000000004065f9 in _start () at ../sysdeps/x86_64/start.S:118
Fix bugs introduced during the refactoring, particularly crashes on shutdown.
Also, enable plugins by default.
Jouni! This needs to be merged to master! Before the 31st!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!