forked from hyperion-project/hyperion.ng
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various Fixes/Updates (hyperion-project#1549)
* Update FindWindowsSDK.cmake * cmake support libcec without version * Ensure Light-Ids are strings * Fix type - do not have dbus as requried * Fixing hyperion-project#1544 * Cleanup * CleanupFix hyperion-project#1551 * Consistently return instance number with JSON replies (hyperion-project#1504) * hyperion-remote- Fix extracting reply for configGet request * Qt 6.6 - Fix iterator finds * Fix test_image2ledsmap * Ensure window.currentHyperionInstanceName is set, cleanup system/log clipboard report * Address protobuf cmake warning * Update License * Update ChangeLog * Address CodeQL and clang findings
- Loading branch information
Showing
23 changed files
with
187 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#ifndef WEAKCONNECT_H | ||
#define WEAKCONNECT_H | ||
|
||
#include <type_traits> | ||
|
||
// Qt includes | ||
#include <QObject> | ||
|
||
template <typename Func1, typename Func2, typename std::enable_if_t<std::is_member_pointer<Func2>::value, int> = 0> | ||
static inline QMetaObject::Connection weakConnect(typename QtPrivate::FunctionPointer<Func1>::Object* sender, | ||
Func1 signal, | ||
typename QtPrivate::FunctionPointer<Func2>::Object* receiver, | ||
Func2 slot) | ||
{ | ||
QMetaObject::Connection conn_normal = QObject::connect(sender, signal, receiver, slot); | ||
|
||
QMetaObject::Connection* conn_delete = new QMetaObject::Connection(); | ||
|
||
*conn_delete = QObject::connect(sender, signal, [conn_normal, conn_delete]() { | ||
QObject::disconnect(conn_normal); | ||
QObject::disconnect(*conn_delete); | ||
delete conn_delete; | ||
}); | ||
return conn_normal; | ||
} | ||
|
||
template <typename Func1, typename Func2, typename std::enable_if_t<!std::is_member_pointer<Func2>::value, int> = 0> | ||
static inline QMetaObject::Connection weakConnect(typename QtPrivate::FunctionPointer<Func1>::Object* sender, | ||
Func1 signal, | ||
Func2 slot) | ||
{ | ||
QMetaObject::Connection conn_normal = QObject::connect(sender, signal, slot); | ||
|
||
QMetaObject::Connection* conn_delete = new QMetaObject::Connection(); | ||
|
||
*conn_delete = QObject::connect(sender, signal, [conn_normal, conn_delete]() { | ||
QObject::disconnect(conn_normal); | ||
QObject::disconnect(*conn_delete); | ||
delete conn_delete; | ||
}); | ||
return conn_normal; | ||
} | ||
|
||
template <typename Func1, typename Func2, typename std::enable_if_t<!std::is_member_pointer<Func2>::value, int> = 0> | ||
static inline QMetaObject::Connection weakConnect(typename QtPrivate::FunctionPointer<Func1>::Object* sender, | ||
Func1 signal, | ||
typename QtPrivate::FunctionPointer<Func2>::Object* receiver, | ||
Func2 slot) | ||
{ | ||
Q_UNUSED(receiver); | ||
QMetaObject::Connection conn_normal = QObject::connect(sender, signal, slot); | ||
|
||
QMetaObject::Connection* conn_delete = new QMetaObject::Connection(); | ||
|
||
*conn_delete = QObject::connect(sender, signal, [conn_normal, conn_delete]() { | ||
QObject::disconnect(conn_normal); | ||
QObject::disconnect(*conn_delete); | ||
delete conn_delete; | ||
}); | ||
return conn_normal; | ||
} | ||
|
||
#endif // WEAKCONNECT_H |
Oops, something went wrong.