Fix minor code issues

This commit is contained in:
Jonas Kvinge
2019-09-15 20:27:32 +02:00
parent 83e10aac27
commit 2d67279180
147 changed files with 644 additions and 329 deletions

View File

@@ -35,6 +35,7 @@ DeviceStateFilterModel::DeviceStateFilterModel(QObject *parent, DeviceManager::S
connect(this, SIGNAL(rowsInserted(QModelIndex, int, int)), this, SLOT(ProxyRowCountChanged(QModelIndex, int, int)));
connect(this, SIGNAL(rowsRemoved(QModelIndex, int, int)), this, SLOT(ProxyRowCountChanged(QModelIndex, int, int)));
connect(this, SIGNAL(modelReset()), this, SLOT(ProxyRowCountChanged()));
}
bool DeviceStateFilterModel::filterAcceptsRow(int row, const QModelIndex&) const {
@@ -46,12 +47,19 @@ void DeviceStateFilterModel::ProxyRowCountChanged() {
}
void DeviceStateFilterModel::ProxyRowCountChanged(QModelIndex index, int first, int last) {
Q_UNUSED(index);
Q_UNUSED(first);
Q_UNUSED(last);
emit IsEmptyChanged(rowCount() == 0);
}
void DeviceStateFilterModel::setSourceModel(QAbstractItemModel *sourceModel) {
QSortFilterProxyModel::setSourceModel(sourceModel);
setDynamicSortFilter(true);
setSortCaseSensitivity(Qt::CaseInsensitive);
sort(0);
}