diff options
Diffstat (limited to 'libqmenumodel/src/menunode.cpp')
-rw-r--r-- | libqmenumodel/src/menunode.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/libqmenumodel/src/menunode.cpp b/libqmenumodel/src/menunode.cpp index ed9a984..f244f40 100644 --- a/libqmenumodel/src/menunode.cpp +++ b/libqmenumodel/src/menunode.cpp @@ -18,9 +18,11 @@ */ #include "menunode.h" +#include "qmenumodelevents.h" #include <QMetaMethod> #include <QDebug> +#include <QCoreApplication> MenuNode::MenuNode(const QString &linkType, GMenuModel *model, MenuNode *parent, int pos, QObject *listener) : m_model(model), @@ -242,15 +244,8 @@ void MenuNode::onItemsChanged(GMenuModel *model, gint position, gint removed, gi self->m_currentOpAdded = added; self->m_currentOpRemoved = removed; - const QMetaObject *mobj = self->m_listener->metaObject(); - if (!mobj->invokeMethod(self->m_listener, - "onItemsChanged", - Q_ARG(MenuNode*, self), - Q_ARG(int, position), - Q_ARG(int, removed), - Q_ARG(int, added))) - { - qWarning() << "Slot 'onItemsChanged(MenuNode*, int, int, int)' not found in" << self->m_listener; - } + MenuNodeItemChangeEvent mnice(self, position, added, removed); + QCoreApplication::sendEvent(self->m_listener, &mnice); + self->commitOperation(); } |