summaryrefslogtreecommitdiffstats
path: root/kcontrol/hwmanager/deviceiconview.h
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2022-03-06 16:56:54 +0900
committerMichele Calgaro <[email protected]>2022-03-06 16:56:54 +0900
commitc9e2911bdb07fe817b75947c6e896552fa64cddf (patch)
treef41a5fbacc32dc514de2cb07b131040887d5a230 /kcontrol/hwmanager/deviceiconview.h
parentc8b66185bef7250219dd712a91e1956d63e99f34 (diff)
downloadtdebase-c9e2911bdb07fe817b75947c6e896552fa64cddf.tar.gz
tdebase-c9e2911bdb07fe817b75947c6e896552fa64cddf.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]>
Diffstat (limited to 'kcontrol/hwmanager/deviceiconview.h')
-rw-r--r--kcontrol/hwmanager/deviceiconview.h20
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