core/reloader: trigger onPostReload if launched post-reload

This is similar to the check in Reloadable, and fixes a number of hard
to debug issues with Process, IpcHandler, NotificationServer, and
GlobalShortcut not working depending on where you put them in a QML file.
This commit is contained in:
outfoxxed 2025-07-04 15:58:41 -07:00
parent 0e6518a706
commit 9708d8212a
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
8 changed files with 36 additions and 38 deletions

View file

@ -154,9 +154,7 @@ class IpcHandlerRegistry;
/// #### Properties
/// Properties of an IpcHanlder can be read using `qs ipc prop get` as long as they are
/// of an IPC compatible type. See the table above for compatible types.
class IpcHandler
: public QObject
, public PostReloadHook {
class IpcHandler: public PostReloadHook {
Q_OBJECT;
/// If the handler should be able to receive calls. Defaults to true.
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged);
@ -166,7 +164,7 @@ class IpcHandler
QML_ELEMENT;
public:
explicit IpcHandler(QObject* parent = nullptr): QObject(parent) {};
explicit IpcHandler(QObject* parent = nullptr): PostReloadHook(parent) {};
~IpcHandler() override;
Q_DISABLE_COPY_MOVE(IpcHandler);