some improvements for developing plugins
This commit is contained in:
parent
7e68f5cac2
commit
4355be5b4b
22
doc/test-plugin.qdoc
Normal file
22
doc/test-plugin.qdoc
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*!
|
||||||
|
\page test-plugin.html
|
||||||
|
\title Testing your plugin
|
||||||
|
\brief This page describes how to test your plugin that you've just created
|
||||||
|
|
||||||
|
In order to make guhd load your plugin, you have 2 options. Either install it into the system or make guhd load it from your plugin build directory.
|
||||||
|
|
||||||
|
To install the plugin into the system, run
|
||||||
|
\code
|
||||||
|
$ make install
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
To make guhd load the plugin from the plugins build directory, run guhd with an environment variable exported
|
||||||
|
\code
|
||||||
|
$ GUH_PLUGINS_DIR=/path/to/plugin/ guhd
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
In order to easier debug things, it is advised to enable debug output for the device manager and your plugin. E.g.
|
||||||
|
\code
|
||||||
|
$ GUH_PLUGINS_DIR=/path/to/plugin guhd -d DeviceManager,YourPlugin
|
||||||
|
\endcode
|
||||||
|
*/
|
||||||
@ -7,6 +7,7 @@
|
|||||||
\li \l{Getting started}
|
\li \l{Getting started}
|
||||||
\li \l{The plugin JSON File}
|
\li \l{The plugin JSON File}
|
||||||
\li \l{CreateMethods and SetupMethods}
|
\li \l{CreateMethods and SetupMethods}
|
||||||
|
\li \l{Testing your plugin}
|
||||||
\li \l{Tutorials}
|
\li \l{Tutorials}
|
||||||
\list
|
\list
|
||||||
\li \l{Tutorial 1 - The "Minimal" plugin}
|
\li \l{Tutorial 1 - The "Minimal" plugin}
|
||||||
|
|||||||
@ -257,6 +257,10 @@ DeviceManager::~DeviceManager()
|
|||||||
QStringList DeviceManager::pluginSearchDirs()
|
QStringList DeviceManager::pluginSearchDirs()
|
||||||
{
|
{
|
||||||
QStringList searchDirs;
|
QStringList searchDirs;
|
||||||
|
QByteArray envPath = qgetenv("GUH_PLUGINS_PATH");
|
||||||
|
if (!envPath.isEmpty()) {
|
||||||
|
searchDirs << envPath;
|
||||||
|
}
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../lib/guh/plugins";
|
searchDirs << QCoreApplication::applicationDirPath() + "/../lib/guh/plugins";
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
|
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/deviceplugins";
|
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/deviceplugins";
|
||||||
@ -1025,7 +1029,7 @@ void DeviceManager::loadPlugins()
|
|||||||
loader.setLoadHints(QLibrary::ResolveAllSymbolsHint);
|
loader.setLoadHints(QLibrary::ResolveAllSymbolsHint);
|
||||||
|
|
||||||
if (!loader.load()) {
|
if (!loader.load()) {
|
||||||
qCWarning(dcDeviceManager) << "Could not load plugin data of" << entry;
|
qCWarning(dcDeviceManager) << "Could not load plugin data of" << entry << "\n" << loader.errorString();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user