1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-16 11:19:18 +01:00

Copy+paste the shared pointer closure constructor a couple of times for different numbers of arguments.

This commit is contained in:
David Sansome 2012-03-19 19:37:02 +00:00
parent 46e930f5c9
commit d7a5af07fb

View File

@ -129,16 +129,6 @@ Closure* NewClosure(
QObject* receiver,
const char* slot);
template <typename T>
Closure* NewClosure(
QSharedPointer<T> sender,
const char* signal,
QObject* receiver,
const char* slot) {
Q_ASSERT(sender.data()->metaObject()); // Static check for something QObject-like.
return new SharedClosure(new SharedPointer<T>(sender), signal, receiver, slot);
}
template <typename T>
Closure* NewClosure(
QObject* sender,
@ -193,4 +183,41 @@ Closure* NewClosure(
C_ARG(T0, val0), C_ARG(T1, val1), C_ARG(T2, val2), C_ARG(T3, val3));
}
template <typename TP>
Closure* NewClosure(
QSharedPointer<TP> sender,
const char* signal,
QObject* receiver,
const char* slot) {
Q_ASSERT(sender.data()->metaObject()); // Static check for something QObject-like.
return new SharedClosure(new SharedPointer<TP>(sender), signal, receiver, slot);
}
template <typename TP, typename T0>
Closure* NewClosure(
QSharedPointer<TP> sender,
const char* signal,
QObject* receiver,
const char* slot,
const T0& val0) {
Q_ASSERT(sender.data()->metaObject()); // Static check for something QObject-like.
return new SharedClosure(
new SharedPointer<TP>(sender), signal, receiver, slot,
C_ARG(T0, val0));
}
template <typename TP, typename T0, typename T1>
Closure* NewClosure(
QSharedPointer<TP> sender,
const char* signal,
QObject* receiver,
const char* slot,
const T0& val0,
const T1& val1) {
Q_ASSERT(sender.data()->metaObject()); // Static check for something QObject-like.
return new SharedClosure(
new SharedPointer<TP>(sender), signal, receiver, slot,
C_ARG(T0, val0), C_ARG(T1, val1));
}
#endif // CLOSURE_H