/***************************************************************************
- * Copyright (C) 2005-2014 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include <QAction>
#include <QDebug>
+#include <QMetaMethod>
#include "actioncollection.h"
unlistAction(action);
}
-#if QT_VERSION >= 0x050000
-void ActionCollection::connectNotify(const QMetaMethod &method)
-#else
-void ActionCollection::connectNotify(const char *signal)
-#endif
+void ActionCollection::connectNotify(const QMetaMethod &signal)
{
if (_connectHovered && _connectTriggered)
return;
-#if QT_VERSION >= 0x050000
- QByteArray signal = method.methodSignature();
-#endif
-
- if (QMetaObject::normalizedSignature(SIGNAL(actionHovered(QAction *))) == signal) {
+ if (QMetaMethod::fromSignal(&ActionCollection::actionHovered) == signal) {
if (!_connectHovered) {
_connectHovered = true;
foreach(QAction* action, actions())
connect(action, SIGNAL(hovered()), SLOT(slotActionHovered()));
}
}
- else if (QMetaObject::normalizedSignature(SIGNAL(actionTriggered(QAction *))) == signal) {
+ else if (QMetaMethod::fromSignal(&ActionCollection::actionTriggered) == signal) {
if (!_connectTriggered) {
_connectTriggered = true;
foreach(QAction* action, actions())
}
}
-#if QT_VERSION >= 0x050000
- QObject::connectNotify(method);
-#else
QObject::connectNotify(signal);
-#endif
}