Don't try to initialize the devices model with an empty list
This commit is contained in:
parent
fb9143a2aa
commit
bb97cc19b6
1 changed files with 4 additions and 0 deletions
|
@ -146,6 +146,10 @@ void DevicesModel::receivedDeviceList(QDBusPendingCallWatcher* watcher)
|
||||||
|
|
||||||
Q_ASSERT(m_deviceList.isEmpty());
|
Q_ASSERT(m_deviceList.isEmpty());
|
||||||
const QStringList deviceIds = pendingDeviceIds.value();
|
const QStringList deviceIds = pendingDeviceIds.value();
|
||||||
|
|
||||||
|
if (deviceIds.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
beginInsertRows(QModelIndex(), 0, deviceIds.count()-1);
|
beginInsertRows(QModelIndex(), 0, deviceIds.count()-1);
|
||||||
Q_FOREACH(const QString& id, deviceIds) {
|
Q_FOREACH(const QString& id, deviceIds) {
|
||||||
m_deviceList.append(new DeviceDbusInterface(id, this));
|
m_deviceList.append(new DeviceDbusInterface(id, this));
|
||||||
|
|
Loading…
Reference in a new issue