diff options
author | Michele Calgaro <[email protected]> | 2022-03-06 16:56:54 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2022-03-06 17:04:12 +0900 |
commit | dcbcede7239b810507d4f1c86d5f296a15095319 (patch) | |
tree | e640920f62d2ebc9e577c8cfb295fd298e6fe5c7 /kcontrol/hwmanager/deviceiconview.h | |
parent | 65d242a2b895c9c2867522f74c0245b806b6da34 (diff) | |
download | tdebase-dcbcede7239b810507d4f1c86d5f296a15095319.tar.gz tdebase-dcbcede7239b810507d4f1c86d5f296a15095319.zip |
tdehwdevicemanager: fix SEGV caused by removing a device when the Device list
dialog is open. Also make sure to update the device list correctly when
a device is removed.
Signed-off-by: Michele Calgaro <[email protected]>
(cherry picked from commit c9e2911bdb07fe817b75947c6e896552fa64cddf)
Diffstat (limited to 'kcontrol/hwmanager/deviceiconview.h')
-rw-r--r-- | kcontrol/hwmanager/deviceiconview.h | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/kcontrol/hwmanager/deviceiconview.h b/kcontrol/hwmanager/deviceiconview.h index 913c4c9ef..746fb2253 100644 --- a/kcontrol/hwmanager/deviceiconview.h +++ b/kcontrol/hwmanager/deviceiconview.h @@ -32,31 +32,25 @@ class ConfigModuleList; class DeviceIconItem : public TDEListViewItem { public: - DeviceIconItem(TQListViewItem *parent, const TQString& text, const TQPixmap& pm, TDEGenericDevice *d = 0) + DeviceIconItem(TQListViewItem *parent, const TQString& text, const TQPixmap& pm, TQString deviceUid) : TDEListViewItem(parent, text) - , _tag(TQString::null) - , _device(d) + , _deviceUid(deviceUid) { setPixmap(0, pm); } - DeviceIconItem(TQListView *parent, const TQString& text, const TQPixmap& pm, TDEGenericDevice *d = 0) + DeviceIconItem(TQListView *parent, const TQString& text, const TQPixmap& pm, TQString deviceUid) : TDEListViewItem(parent, text) - , _tag(TQString::null) - , _device(d) + , _deviceUid(deviceUid) { setPixmap(0, pm); } - void setDevice(TDEGenericDevice* d) { _device = d; } - void setTag(const TQString& t) { _tag = t; } + void setDevice(TQString deviceUid) { _deviceUid = deviceUid; } - TDEGenericDevice* device() { return _device; } - TQString tag() { return _tag; } - + TDEGenericDevice* device() { return TDEGlobal::hardwareDevices()->findByUniqueID(_deviceUid); } private: - TQString _tag; - TDEGenericDevice *_device; + TQString _deviceUid; // device unique id }; class DeviceIconView : public TDEListView |