summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Grulich <[email protected]>2017-12-04 20:39:02 +0100
committerJan Grulich <[email protected]>2017-12-04 20:39:02 +0100
commit4049109a29d385ac98683262654e6957d0a755b6 (patch)
treed9add12e83ceae70e68ba3f00737b3d6c07d84b0
parentc59d20abb837f4c70a7d2c389fd2dfe2a5f4b9aa (diff)
We probably want by default show only available connections
On the other hand we might want to have this configurable so users can display previously configured connections
-rw-r--r--libs/models/mobileproxymodel.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/models/mobileproxymodel.cpp b/libs/models/mobileproxymodel.cpp
index 3d5904a..d8e1f07 100644
--- a/libs/models/mobileproxymodel.cpp
+++ b/libs/models/mobileproxymodel.cpp
@@ -48,8 +48,13 @@ bool MobileProxyModel::filterAcceptsRow(int source_row, const QModelIndex& sourc
}
const NetworkManager::ConnectionSettings::ConnectionType type = (NetworkManager::ConnectionSettings::ConnectionType) sourceModel()->data(index, NetworkModel::TypeRole).toUInt();
+ if (type != NetworkManager::ConnectionSettings::Wireless) {
+ return false;
+ }
- return type == NetworkManager::ConnectionSettings::Wireless;
+ // TODO add an option to show already configured connections
+ NetworkModelItem::ItemType itemType = (NetworkModelItem::ItemType)sourceModel()->data(index, NetworkModel::ItemTypeRole).toUInt();
+ return itemType > NetworkModelItem::UnavailableConnection;
}
bool MobileProxyModel::lessThan(const QModelIndex& left, const QModelIndex& right) const