Skip to content

Commit

Permalink
Add debug logging to plugin manager
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Nov 28, 2024
1 parent 016cc0e commit 0399baf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/plugins/tpluginmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class tPluginManager {
#ifdef T_OS_UNIX_NOT_MAC
searchPaths.append(QString(SYSTEM_LIBRARY_DIRECTORY).append(QStringLiteral("/%1/plugins").arg(libraryDirectory)));
if (qEnvironmentVariableIsSet("APPDIR")) {
searchPaths.append(QString(qEnvironmentVariable("APPDIR")).append(QStringLiteral("/usr/lib/%1/plugins").arg(libraryDirectory)));
searchPaths.append(qEnvironmentVariable("APPDIR").append(QStringLiteral("/usr/lib/%1/plugins").arg(libraryDirectory)));
}
#elif defined(Q_OS_WIN)
searchPaths.append(qApp->applicationDirPath() + "/../../plugins");
Expand All @@ -48,10 +48,13 @@ class tPluginManager {
QStringList seenPlugins;

for (const QString& searchPath : searchPaths) {
tDebug("tPluginManager") << "Plugin search path " << searchPath;
QDirIterator iterator(searchPath, {"*.so", "*.dll", "*.dylib"}, QDir::NoFilter, QDirIterator::Subdirectories);
while (iterator.hasNext()) {
iterator.next();
if (seenPlugins.contains(iterator.fileName())) continue;

tDebug("tPluginManager") << "Identified plugin at " + iterator.filePath();
QPluginLoader loader(iterator.filePath());
auto reg = tPluginManagerHelper::instance()->registerPlugin(loader.metaData());
if (!reg.uuid.isNull()) {
Expand Down

0 comments on commit 0399baf

Please sign in to comment.