Commit Graph

3 Commits

Author SHA1 Message Date
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
Jim Broadus a62062127e Fix thread-safety issues when initially loading devices from the database.
When DeviceManager initializes, it creates a thread to load device information
from the database. Part of this process includes use of QPixMap for icons which
produced a warning message:

22:32:53.763 WARN  unknown                          QPixmap: It is not safe to use pixmaps outside the GUI thread

In addition, the device is added to the view using beginInsertRows and
endInsertRows. This could contend with a device added by a lister signaling
PhysicalDeviceAdded.

To solve these problems, this change moves the icon loading and insertion to the
main thread. LoadAllDevices reads the data from the database and creates the
DeviceInfo object, then sends a signal to the main thread. In the signal
handler, the icon is loaded and the device is added to the master list and view.
2019-02-24 00:03:45 -08:00
Jonas Kvinge 7e25a7c7e4 Convert devices manager(model) to QAbstractItemModel (#6260) 2019-01-21 09:06:48 +00:00