[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kpeople] src/widgets: Fix warnings
From: Aleix Pol <aleixpol () kde ! org>
Date: 2016-02-29 23:42:39
Message-ID: E1aaXSZ-0005YI-24 () scm ! kde ! org
[Download RAW message or body]
Git commit 4b2c66f19a53c7fef765a1420d74c84f724f995c by Aleix Pol.
Committed on 29/02/2016 at 23:36.
Pushed by apol into branch 'master'.
Fix warnings
Fix deprecated API usage.
Check value to see if it's null.
REVIEW: 127210
M +6 -1 src/widgets/actions.cpp
http://commits.kde.org/kpeople/4b2c66f19a53c7fef765a1420d74c84f724f995c
diff --git a/src/widgets/actions.cpp b/src/widgets/actions.cpp
index 5ac56a2..dfe7e7e 100644
--- a/src/widgets/actions.cpp
+++ b/src/widgets/actions.cpp
@@ -18,6 +18,7 @@
#include "actions.h"
#include <QAction>
+#include <QDebug>
#include <KPluginLoader>
#include <KPluginFactory>
#include <KPluginMetaData>
@@ -35,7 +36,11 @@ static QList<AbstractPersonAction *> actionsPlugins()
Q_FOREACH (const KPluginMetaData &service, personPluginList) {
KPluginLoader loader(service.fileName());
KPluginFactory *factory = loader.factory();
- AbstractPersonAction *plugin = \
qobject_cast<AbstractPersonAction*>(factory->create()); + if (!factory) {
+ qWarning() << "Couldn't create the factory for" << service.name() << \
"at" << service.fileName(); + continue;
+ }
+ AbstractPersonAction *plugin = factory->create<AbstractPersonAction>();
if (plugin) {
// qDebug() << "found plugin" << service->name();
actionPlugins << plugin;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic