diff options
author | 2019-02-26 23:39:45 -0800 | |
---|---|---|
committer | 2019-05-17 14:47:11 +0000 | |
commit | eee406e36e73484ebf945d4f4c5be78a3a55657a (patch) | |
tree | fe8cfb88392e529fe97149ee9c20465fd85f844f /network | |
parent | d204a0371a5d97b6be70389ca34f8cec3e6e0d21 (diff) |
libqtappfw: network: sort WiFI model by SSIDguppy_7.0.4guppy_7.0.3guppy/7.0.4guppy/7.0.37.0.47.0.3guppy
To allow ease of scrolling through WiFi discovery list by sorting
on SSID.
Bug-AGL: SPEC-2359
Change-Id: I1a8c369b4215177b93e6c584fd50f12d091de7d4
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'network')
-rw-r--r-- | network/network.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/network/network.cpp b/network/network.cpp index dc5fa5f..496638f 100644 --- a/network/network.cpp +++ b/network/network.cpp @@ -15,6 +15,7 @@ */ #include <QMetaEnum> +#include <QSortFilterProxyModel> #include <QtQml/QQmlEngine> #include <vcard/vcard.h> @@ -37,7 +38,12 @@ Network::Network (QUrl &url, QQmlContext *context, QObject * parent) : m_mloop = new MessageEngine(url); m_wifi = new WifiNetworkModel(); - context->setContextProperty("WifiNetworkModel", m_wifi); + QSortFilterProxyModel *m_model = new QSortFilterProxyModel(); + m_model->setSourceModel(m_wifi); + m_model->setSortRole(WifiNetworkModel::WifiNetworkRoles::SsidRole); + m_model->setSortCaseSensitivity(Qt::CaseInsensitive); + m_model->sort(0); + context->setContextProperty("WifiNetworkModel", m_model); QObject::connect(m_mloop, &MessageEngine::connected, this, &Network::onConnected); QObject::connect(m_mloop, &MessageEngine::disconnected, this, &Network::onDisconnected); |