Merge branch 'ukss-dev' into 'ukss-dev'
增加了一些插件加载时的调试日志。 See merge request kylin-desktop/ukui-search!276
This commit is contained in:
commit
724da5684b
|
@ -30,9 +30,17 @@ PluginManager::PluginManager(QObject *parent) : QObject(parent)
|
||||||
|
|
||||||
Q_FOREACH(QString fileName, pluginsDir.entryList(QDir::Files)) {
|
Q_FOREACH(QString fileName, pluginsDir.entryList(QDir::Files)) {
|
||||||
QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
|
QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
|
||||||
|
if(pluginLoader.isLoaded()) {
|
||||||
// version check
|
// version check
|
||||||
if (pluginLoader.metaData().value("MetaData").toObject().value("version").toString() != VERSION)
|
QString version = pluginLoader.metaData().value("MetaData").toObject().value("version").toString();
|
||||||
|
if (version != VERSION) {
|
||||||
|
qWarning() << "Plugin version check failed:" << fileName << "version," << "iface version : " << VERSION;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
qWarning() << "Fail to load fileName";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
QObject *plugin = pluginLoader.instance();
|
QObject *plugin = pluginLoader.instance();
|
||||||
if (!plugin)
|
if (!plugin)
|
||||||
|
|
|
@ -28,6 +28,7 @@ bool SearchPluginManager::registerPlugin(UkuiSearch::SearchPluginIface *plugin)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_map[plugin->name()] = plugin;
|
m_map[plugin->name()] = plugin;
|
||||||
|
qDebug() << "register search plugin: " << plugin->name();
|
||||||
m_plugin_order[m_plugin_order.size()] = plugin->name();//按注册顺序绑定优先级
|
m_plugin_order[m_plugin_order.size()] = plugin->name();//按注册顺序绑定优先级
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ QT += core gui dbus
|
||||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
|
|
||||||
TARGET = ukui-search-service
|
TARGET = ukui-search-app-data-service
|
||||||
VERSION = 1.0.0
|
VERSION = 1.0.0
|
||||||
DEFINES += VERSION='\\"$${VERSION}\\"'
|
DEFINES += VERSION='\\"$${VERSION}\\"'
|
||||||
CONFIG += c++11 link_pkgconfig no_keywords lrelease
|
CONFIG += c++11 link_pkgconfig no_keywords lrelease
|
||||||
|
|
Loading…
Reference in New Issue