Create helper function for plugin loading
Open, Needs TriagePublic

Description

Currently we have the same KPluginLoader code all over the place with varying degrees of error handling.

To consolidate this create a helper that take a file path, a parent, args and a template parameter and returns an instantiated object or an error.

Working draft is at https://invent.kde.org/frameworks/kcoreaddons/-/commit/c4f60cf24e2dcef7e798ec9d5c815d532c1ba6c8

Open question is what return type to use, see T14312

alex added a subscriber: alex.May 29 2021, 4:04 PM

Notes from KF6 weekly: A custom struct is seen as the best solution. This has an error type enum, error string and plugin instance member.

We need the enum to differentiate what kind of error was encountered and if that should be handled by the app. The error string contains a string which can be displayed to the user.

alex claimed this task.May 29 2021, 4:42 PM
This comment was removed by alex.