Add support for static platformtheme plugins
AbandonedPublic

Authored by masonm on Feb 5 2020, 2:05 AM.

Details

Reviewers
mart
Group Reviewers
VDG
Kirigami
Summary

PlatformTheme::qmlAttachedProperties is currently not looking for static KirigamiPluginFactory plugins. This change will search for static plugins before searching shared objects.

Test Plan

Register a custom, static KirigamiPluginFactory plugin using Q_IMPORT_PLUGIN and verify the attached properties work as expected.

Diff Detail

Repository
R169 Kirigami
Lint
Lint Skipped
Unit
Unit Tests Skipped
masonm created this revision.Feb 5 2020, 2:05 AM
Restricted Application added a subscriber: plasma-devel. ยท View Herald TranscriptFeb 5 2020, 2:05 AM
masonm requested review of this revision.Feb 5 2020, 2:05 AM
masonm planned changes to this revision.Feb 5 2020, 7:39 PM

I think there's issues with this. I had assumed it is fine to load static plugins regardless of from where, but in my testing there are issues so I think this needs to be an "either or" scenario instead of allowing static/dynamic plugins to intermix.

This should be a simple matter then of using:

#if KIRIGAMI_BUILD_TYPE_STATIC
        for (QObject* staticPlugin : QPluginLoader::staticInstances()) {
            KirigamiPluginFactory *factory = qobject_cast<KirigamiPluginFactory *>(staticPlugin);
            if (factory) {
                PlatformThemePrivate::s_pluginFactory = factory;
                return factory->createPlatformTheme(object);
            }
        }
#elif QT_CONFIG(library)
    ...
#endif
masonm abandoned this revision.Feb 7 2020, 7:35 PM