diff --git a/frontend/frontend.pro b/frontend/frontend.pro index 80f9c26..b4fd28a 100644 --- a/frontend/frontend.pro +++ b/frontend/frontend.pro @@ -2,7 +2,7 @@ QT += core gui dbus KWindowSystem xml x11extras greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -VERSION = 1.0.0 +VERSION = 2.2.3 DEFINES += VERSION='\\"$${VERSION}\\"' TARGET = ukui-search TEMPLATE = app diff --git a/libsearch/libsearch.pro b/libsearch/libsearch.pro index f5aefef..fd86553 100644 --- a/libsearch/libsearch.pro +++ b/libsearch/libsearch.pro @@ -1,5 +1,5 @@ QT += core xml widgets dbus concurrent sql -VERSION = 1.1.0 +VERSION = 2.2.3 DEFINES += VERSION='\\"$${VERSION}\\"' TARGET = ukui-search diff --git a/libsearch/plugininterface/search-plugin-iface.h b/libsearch/plugininterface/search-plugin-iface.h index 2d17ced..a340acd 100644 --- a/libsearch/plugininterface/search-plugin-iface.h +++ b/libsearch/plugininterface/search-plugin-iface.h @@ -1,6 +1,7 @@ #ifndef SEARCHPLUGINIFACE_H #define SEARCHPLUGINIFACE_H #define SearchPluginIface_iid "org.ukui.ukui-search.plugin-iface.SearchPluginInterface" +#define SEARCH_PLUGIN_IFACE_VERSION "1.1.0" #include #include diff --git a/libsearch/plugininterface/search-task-plugin-iface.h b/libsearch/plugininterface/search-task-plugin-iface.h index 24ee89f..13d9dc3 100644 --- a/libsearch/plugininterface/search-task-plugin-iface.h +++ b/libsearch/plugininterface/search-task-plugin-iface.h @@ -1,6 +1,7 @@ #ifndef SEARCHTASKPLUGINIFACE_H #define SEARCHTASKPLUGINIFACE_H #define SearchTaskPluginIface_iid "org.ukui.ukui-search.plugin-iface.SearchTaskPluginIface" +#define SEARCH_TASK_PLUGIN_IFACE_VERSION "1.0.0" #include #include diff --git a/libsearch/pluginmanage/plugin-manager.cpp b/libsearch/pluginmanage/plugin-manager.cpp index 37f3411..3bbb0c9 100644 --- a/libsearch/pluginmanage/plugin-manager.cpp +++ b/libsearch/pluginmanage/plugin-manager.cpp @@ -31,9 +31,20 @@ PluginManager::PluginManager(QObject *parent) : QObject(parent) Q_FOREACH(QString fileName, pluginsDir.entryList(QDir::Files)) { QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName)); // version check + QString type = pluginLoader.metaData().value("MetaData").toObject().value("type").toString(); QString version = pluginLoader.metaData().value("MetaData").toObject().value("version").toString(); - if (version != VERSION) { - qWarning() << "Plugin version check failed:" << fileName << "version," << "iface version : " << VERSION; + if(type == "SEARCH_PLUGIN") { + if (version != SEARCH_PLUGIN_IFACE_VERSION) { + qWarning() << "SEARCH_PLUGIN version check failed:" << fileName << "version:" << version << "iface version : " << SEARCH_PLUGIN_IFACE_VERSION; + continue; + } + } else if(type == "SEARCH_TASK_PLUGIN") { + if (version != SEARCH_TASK_PLUGIN_IFACE_VERSION) { + qWarning() << "SEARCH_TASK_PLUGIN_IFACE_VERSION version check failed:" << fileName << "version:" << version << "iface version : " << SEARCH_TASK_PLUGIN_IFACE_VERSION; + continue; + } + } else { + qWarning() << "Unsupport plugin:" << fileName << "type:" << type; continue; }