[Qgis-developer] odd calls to classFactory for python plugins

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri Mar 13 13:43:04 EDT 2009


I've been crashing Qgis a bit lately, and noticed it was producing the
R core dump error message. But none of my enabled plugins were using
R. Odd.

I ran strace and inferred that all my plugin classFactory methods were
being called, even for disabled plugins.

I wrote a simple plugin that printed a message on classFactory
__init__ call and classFactory initGui call.

When not enabled, I saw a message that the classFactory __init__ had
been called. The print didn't happen immediately, it seems to wait for
an event (menu item, canvas redraw).

On enabling the plugin from the manager and OK'ing, I get a
classFactory __init__ and a .initGui as expected.

 Some of us on #irc tracked down plugin loading to a few places, but
we got a bit lost and it's Friday evening... Anyone else want to
figure this out? We don't think classFactory should be called for
non-loaded plugins (even though in this case it must be failing for
some reason since otherwise the initGui method would run --
QgsPythonUtilsImpl::startPlugin runs them both in quick succession.

Barry


More information about the Qgis-developer mailing list