From 97047a5f39710b268ec105ffd53c1598a7857df4 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sat, 11 Oct 2014 04:25:47 +0200 Subject: [PATCH] fix plugin loading when installed --- libguh/devicemanager.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libguh/devicemanager.cpp b/libguh/devicemanager.cpp index 9bdc8d1c..3bf15035 100644 --- a/libguh/devicemanager.cpp +++ b/libguh/devicemanager.cpp @@ -514,7 +514,7 @@ void DeviceManager::loadPlugins() { QStringList searchDirs; - searchDirs << QCoreApplication::applicationDirPath() + "/../lib/guh/guh"; + searchDirs << QCoreApplication::applicationDirPath() + "/../lib/guh/plugins"; searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/deviceplugins"; searchDirs << QCoreApplication::applicationDirPath() + "/../../../plugins/deviceplugins"; @@ -522,7 +522,12 @@ void DeviceManager::loadPlugins() QDir dir(path); qDebug() << "Loading plugins from:" << dir.absolutePath(); foreach (const QString &entry, dir.entryList()) { - QFileInfo fi(path + "/" + entry + "/libguh_deviceplugin" + entry + ".so"); + QFileInfo fi; + if (entry.startsWith("libguh_deviceplugin") && entry.endsWith(".so")) { + fi.setFile(path + "/" + entry); + } else { + fi.setFile(path + "/" + entry + "/libguh_deviceplugin" + entry + ".so"); + } if (!fi.exists()) { continue; }