Properly iterate over devices

This commit is contained in:
Aleix Pol 2016-11-23 19:00:20 +01:00
parent 6aa41a6ab9
commit 7b87af16df

View file

@ -61,9 +61,8 @@ int main(int argc, char** argv)
systray.setVisible(true); systray.setVisible(true);
QObject::connect(&model, &DevicesModel::rowsInserted, &model, [&menu, &model](const QModelIndex& /*parent*/, int first, int last) { QObject::connect(&model, &DevicesModel::rowsInserted, &model, [&menu, &model](const QModelIndex& /*parent*/, int first, int last) {
qDebug() << "wooooo" << first << last;
for (int i=first; i<=last; ++i) { for (int i=first; i<=last; ++i) {
DeviceDbusInterface* device = model.getDevice(first); DeviceDbusInterface* device = model.getDevice(i);
auto indicator = new DeviceIndicator(device); auto indicator = new DeviceIndicator(device);
QObject::connect(device, &DeviceDbusInterface::destroyed, indicator, &QObject::deleteLater); QObject::connect(device, &DeviceDbusInterface::destroyed, indicator, &QObject::deleteLater);