summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-06-25 10:12:52 +0200
committerMontel Laurent <[email protected]>2016-06-25 10:13:14 +0200
commitf4959b0fc0c69314480c9aebb6744247245d895b (patch)
treec5d38f45e5e8c3399213eab09675fa8c4332cefb
parent988e288162e22040bf0389da6bae6d93a2ece31c (diff)
Fix potential crash
-rw-r--r--messagecomposer/src/plugineditor/plugineditormanager.cpp7
-rw-r--r--messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp5
-rw-r--r--messageviewer/src/header/headerstylepluginmanager.cpp5
-rw-r--r--messageviewer/src/viewerplugins/viewerpluginmanager.cpp5
-rw-r--r--webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp5
5 files changed, 21 insertions, 6 deletions
diff --git a/messagecomposer/src/plugineditor/plugineditormanager.cpp b/messagecomposer/src/plugineditor/plugineditormanager.cpp
index 98d0f99..2ec6057 100644
--- a/messagecomposer/src/plugineditor/plugineditormanager.cpp
+++ b/messagecomposer/src/plugineditor/plugineditormanager.cpp
@@ -123,8 +123,11 @@ bool PluginEditorManagerPrivate::initializePlugins()
void PluginEditorManagerPrivate::loadPlugin(PluginEditorInfo *item)
{
- item->plugin = KPluginLoader(item->metaData.fileName()).factory()->create<PluginEditor>(q, QVariantList() << item->saveName());
- item->plugin->setOrder(item->order);
+ KPluginLoader pluginLoader(item->metaData.fileName());
+ if (pluginLoader.factory()) {
+ item->plugin = pluginLoader.factory()->create<PluginEditor>(q, QVariantList() << item->saveName());
+ item->plugin->setOrder(item->order);
+ }
}
QVector<PluginEditor *> PluginEditorManagerPrivate::pluginsList() const
diff --git a/messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp b/messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp
index dd8bb5c..33c5ff7 100644
--- a/messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp
+++ b/messagecomposer/src/plugineditorcheckbeforesend/plugineditorcheckbeforesendmanager.cpp
@@ -115,7 +115,10 @@ bool PluginEditorCheckBeforeSendManagerPrivate::initializePlugins()
void PluginEditorCheckBeforeSendManagerPrivate::loadPlugin(PluginEditorCheckBeforeSendInfo *item)
{
- item->plugin = KPluginLoader(item->metaData.fileName()).factory()->create<PluginEditorCheckBeforeSend>(q, QVariantList() << item->saveName());
+ KPluginLoader pluginLoader(item->metaData.fileName());
+ if (pluginLoader.factory()) {
+ item->plugin = pluginLoader.factory()->create<PluginEditorCheckBeforeSend>(q, QVariantList() << item->saveName());
+ }
}
QVector<PluginEditorCheckBeforeSend *> PluginEditorCheckBeforeSendManagerPrivate::pluginsList() const
diff --git a/messageviewer/src/header/headerstylepluginmanager.cpp b/messageviewer/src/header/headerstylepluginmanager.cpp
index 77ff9d8..03ad71f 100644
--- a/messageviewer/src/header/headerstylepluginmanager.cpp
+++ b/messageviewer/src/header/headerstylepluginmanager.cpp
@@ -148,7 +148,10 @@ QVector<MessageViewer::HeaderStylePlugin *> HeaderStylePluginManagerPrivate::plu
void HeaderStylePluginManagerPrivate::loadPlugin(HeaderStylePluginInfo *item)
{
- item->plugin = KPluginLoader(item->metaData.fileName()).factory()->create<MessageViewer::HeaderStylePlugin>(q, QVariantList() << item->saveName());
+ KPluginLoader pluginLoader(item->metaData.fileName());
+ if (pluginLoader.factory()) {
+ item->plugin = pluginLoader.factory()->create<MessageViewer::HeaderStylePlugin>(q, QVariantList() << item->saveName());
+ }
}
HeaderStylePluginManager *HeaderStylePluginManager::self()
diff --git a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
index 5ff0fb8..8a8d77d 100644
--- a/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
+++ b/messageviewer/src/viewerplugins/viewerpluginmanager.cpp
@@ -138,7 +138,10 @@ bool ViewerPluginManagerPrivate::initializePluginList()
void ViewerPluginManagerPrivate::loadPlugin(ViewerPluginInfo *item)
{
- item->plugin = KPluginLoader(item->metaData.fileName()).factory()->create<MessageViewer::ViewerPlugin>(q, QVariantList() << item->saveName());
+ KPluginLoader pluginLoader(item->metaData.fileName());
+ if (pluginLoader.factory()) {
+ item->plugin = pluginLoader.factory()->create<MessageViewer::ViewerPlugin>(q, QVariantList() << item->saveName());
+ }
}
QVector<ViewerPlugin *> ViewerPluginManagerPrivate::pluginsList() const
diff --git a/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp b/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp
index 05ee713..ff54112 100644
--- a/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp
+++ b/webengineviewer/src/urlinterceptor/networkurlinterceptorpluginmanager.cpp
@@ -139,7 +139,10 @@ QVector<WebEngineViewer::NetworkPluginUrlInterceptor *> NetworkUrlInterceptorPlu
void NetworkUrlInterceptorPluginManagerPrivate::loadPlugin(MailNetworkUrlInterceptorPluginInfo *item)
{
- item->plugin = KPluginLoader(item->metaData.fileName()).factory()->create<WebEngineViewer::NetworkPluginUrlInterceptor>(q, QVariantList() << item->saveName());
+ KPluginLoader pluginLoader(item->metaData.fileName());
+ if (pluginLoader.factory()) {
+ item->plugin = pluginLoader.factory()->create<WebEngineViewer::NetworkPluginUrlInterceptor>(q, QVariantList() << item->saveName());
+ }
}
NetworkUrlInterceptorPluginManager *NetworkUrlInterceptorPluginManager::self()