mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
PyFalkon: Fix build with clang
BUG: 407734 FIXED-IN: 3.2.0
This commit is contained in:
parent
fb09c266a7
commit
2098d69ad1
|
@ -415,18 +415,26 @@ Plugins::Plugin Plugins::loadSharedLibraryPlugin(const QString &name)
|
|||
|
||||
Plugins::Plugin Plugins::loadPythonPlugin(const QString &name)
|
||||
{
|
||||
Plugin out;
|
||||
|
||||
if (!m_pythonPlugin) {
|
||||
qWarning() << "Python support plugin is not loaded";
|
||||
return Plugin();
|
||||
return out;
|
||||
}
|
||||
|
||||
auto f = (Plugin(*)(const QString &)) m_pythonPlugin->resolve("pyfalkon_load_plugin");
|
||||
auto f = (Plugin*(*)(const QString &)) m_pythonPlugin->resolve("pyfalkon_load_plugin");
|
||||
if (!f) {
|
||||
qWarning() << "Failed to resolve" << "pyfalkon_load_plugin";
|
||||
return Plugin();
|
||||
return out;
|
||||
}
|
||||
|
||||
return f(name);
|
||||
Plugin *p = f(name);
|
||||
if (p) {
|
||||
out = *p;
|
||||
delete p;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
bool Plugins::initPlugin(PluginInterface::InitState state, Plugin *plugin)
|
||||
|
|
|
@ -82,7 +82,7 @@ void pyfalkon_register_plugin(PluginInterface *plugin)
|
|||
pluginInterface = plugin;
|
||||
}
|
||||
|
||||
Plugins::Plugin pyfalkon_load_plugin(const QString &name)
|
||||
Plugins::Plugin *pyfalkon_load_plugin(const QString &name)
|
||||
{
|
||||
QString fullPath;
|
||||
if (QFileInfo(name).isAbsolute()) {
|
||||
|
@ -91,15 +91,15 @@ Plugins::Plugin pyfalkon_load_plugin(const QString &name)
|
|||
fullPath = DataPaths::locate(DataPaths::Plugins, name);
|
||||
if (fullPath.isEmpty()) {
|
||||
qWarning() << "Python plugin" << name << "not found";
|
||||
return Plugins::Plugin();
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Plugins::Plugin plugin;
|
||||
plugin.type = Plugins::Plugin::PythonPlugin;
|
||||
plugin.pluginId = QSL("python:%1").arg(QFileInfo(name).fileName());
|
||||
plugin.pluginPath = fullPath;
|
||||
plugin.pluginSpec = Plugins::createSpec(DesktopFile(fullPath + QSL("/metadata.desktop")));
|
||||
Plugins::Plugin *plugin = new Plugins::Plugin;
|
||||
plugin->type = Plugins::Plugin::PythonPlugin;
|
||||
plugin->pluginId = QSL("python:%1").arg(QFileInfo(name).fileName());
|
||||
plugin->pluginPath = fullPath;
|
||||
plugin->pluginSpec = Plugins::createSpec(DesktopFile(fullPath + QSL("/metadata.desktop")));
|
||||
return plugin;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,5 +21,5 @@
|
|||
|
||||
void pyfalkon_register_plugin(PluginInterface *plugin);
|
||||
|
||||
extern "C" Q_DECL_EXPORT Plugins::Plugin pyfalkon_load_plugin(const QString &name);
|
||||
extern "C" Q_DECL_EXPORT Plugins::Plugin *pyfalkon_load_plugin(const QString &name);
|
||||
extern "C" Q_DECL_EXPORT void pyfalkon_init_plugin(Plugins::Plugin *plugin);
|
||||
|
|
Loading…
Reference in New Issue
Block a user