Files
gentoo/dev-embedded/ponyprog/files/ponyprog-3.1.4_p20250501-usbwatcher-qt6.patch
Victor Kustov fb4417aeb3 dev-embedded/ponyprog: add 3.1.4_p20250501
add Qt6-only version with qhexedit2-0.8.x depends

Signed-off-by: Victor Kustov <ktrace@yandex.ru>
Part-of: https://github.com/gentoo/gentoo/pull/41991
Closes: https://github.com/gentoo/gentoo/pull/41991
Signed-off-by: Sam James <sam@gentoo.org>
2025-05-18 14:48:38 +01:00

42 lines
932 B
Diff

See https://github.com/lancos/ponyprog/issues/42
---
diff --git a/SrcPony/usbwatcher.h b/SrcPony/usbwatcher.h
index eeb0163..d7ab2c5 100644
--- a/SrcPony/usbwatcher.h
+++ b/SrcPony/usbwatcher.h
@@ -51,20 +51,22 @@ class USBWatcher : public QObject
void hotplug_notify(bool connected, quint16 vid, quint16 pid)
{
+ VidPid *vObj = new VidPid(vid, pid);
if (connected)
{
- vUSB.append(VidPid(vid, pid));
+ vUSB.append(vObj);
emit notify(true, vid, pid);
}
else
{
- int idx = vUSB.indexOf(VidPid(vid, pid));
+ int idx = vUSB.indexOf(vObj);
if (idx != -1)
{
vUSB.remove(idx);
}
emit notify(false, vid, pid);
}
+ delete vObj;
}
signals:
@@ -76,7 +78,7 @@ class USBWatcher : public QObject
private:
void hotplug_deregister();
- QVector <VidPid> vUSB;
+ QVector <VidPid *> vUSB;
libusb_hotplug_callback_handle cbHandle;
libusb_context *usb_ctx;
QTimer *timer;