diff options
author | Nick Dedekind <nicholas.dedekind@gmail.com> | 2013-08-26 14:19:38 +0000 |
---|---|---|
committer | Tarmac <> | 2013-08-26 14:19:38 +0000 |
commit | aaa82529fb8d8601e47ae27b60814c744f1f75a3 (patch) | |
tree | 1c3a8404f9d1d3e4439a63e1d8b204aadc99799c /libqmenumodel/src/menunode.cpp | |
parent | 50563a1ab243436c8c8fa86f88ef4a4b25b9a107 (diff) | |
parent | db47d077dcd9ee6761de828c9194d3fa2331f9ea (diff) | |
download | qmenumodel-aaa82529fb8d8601e47ae27b60814c744f1f75a3.tar.gz qmenumodel-aaa82529fb8d8601e47ae27b60814c744f1f75a3.tar.bz2 qmenumodel-aaa82529fb8d8601e47ae27b60814c744f1f75a3.zip |
Adds qt event spawning to direct glib main loop callbacks. Fixes: https://bugs.launchpad.net/bugs/1183065, https://bugs.launchpad.net/bugs/1206991.
Approved by Lars Uebernickel, PS Jenkins bot.
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(); } |