Commit b07b5249 authored by Thomas Eschenbacher's avatar Thomas Eschenbacher
Browse files

fixed deprecation warning about KPluginFactory

parent 64e40153
......@@ -3,7 +3,7 @@
* introduced Kwave::URLfromUserInput to work around problems with QUrl
misinterpreting file names in cmdline parameters as http:// URLs
* fixed deprecation warnings: use QRecursiveMutex
* fixed deprecation warnings: QRecursiveMutex, KPluginFactory
20.08.01 [2020-08-31]
......
......@@ -28,7 +28,7 @@
Kwave::SelectionTracker::SelectionTracker(Kwave::SignalManager *signal,
sample_index_t offset,
sample_index_t length,
const QVector<unsigned int> *tracks)
const QVector<unsigned int> *tracks)
:m_signal(signal),
m_offset(offset),
m_length((length || !signal) ? length : signal->length()),
......
......@@ -30,6 +30,7 @@
#include <QtGlobal>
#include <QVariantList>
#include <KAboutData>
#include <KConfig>
#include <KConfigGroup>
#include <KLocalizedString>
......@@ -623,17 +624,16 @@ void Kwave::PluginManager::searchPluginModules()
return;
}
KPluginInfo::List plugins = KPluginInfo::fromMetaData(
KPluginLoader::findPlugins(_("kwave"))
);
foreach (const KPluginInfo &i, plugins) {
QString library = i.libraryPath();
QVector<KPluginMetaData> plugins_meta_data =
KPluginMetaData::findPlugins(_("kwave"));
foreach (const KPluginMetaData &i, plugins_meta_data) {
QString library = i.fileName();
QString description = i.name();
QString name = i.pluginName();
QString name = i.pluginId();
QString version_raw = i.version();
QString version;
QString settings;
QString author = i.author();
QString author = i.authors().first().name();
if (version_raw.contains(_(":"))) {
version = version_raw.split(_(":")).at(0);
......@@ -658,10 +658,12 @@ void Kwave::PluginManager::searchPluginModules()
continue;
}
KPluginLoader loader(library);
KPluginFactory* factory = loader.factory();
if (!factory) {
qWarning("plugin '%s': loading failed", DBG(name));
KPluginFactory::Result<KPluginFactory> result =
KPluginFactory::loadFactory(i);
if (!result) {
qWarning("plugin '%s': loading failed: '%s'", DBG(name),
DBG(result.errorString));
continue;
}
......@@ -673,7 +675,7 @@ void Kwave::PluginManager::searchPluginModules()
info.m_author = author;
info.m_description = i18n(description.toUtf8());
info.m_version = settings;
info.m_factory = factory;
info.m_factory = result.plugin;
info.m_use_count = 1;
m_plugin_modules.insert(info.m_name, info);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment