diff --git a/libs/declarative/connectionicon.cpp b/libs/declarative/connectionicon.cpp --- a/libs/declarative/connectionicon.cpp +++ b/libs/declarative/connectionicon.cpp @@ -313,7 +313,10 @@ } NetworkManager::ActiveConnection::Ptr connection = NetworkManager::activatingConnection(); - if (!connection) { + + // Set icon based on the current primary connection if the activating connection is virtual + // since we're not setting icons for virtual connections + if (!connection || (connection && UiUtils::isConnectionTypeVirtual(connection->type()))) { connection = NetworkManager::primaryConnection(); } diff --git a/libs/uiutils.h b/libs/uiutils.h --- a/libs/uiutils.h +++ b/libs/uiutils.h @@ -71,6 +71,12 @@ */ static bool isConnectionTypeSupported(NetworkManager::ConnectionSettings::ConnectionType type); + /** + * @return true if the connection is virtual. + * @param type Type of the network connection + */ + static bool isConnectionTypeVirtual(NetworkManager::ConnectionSettings::ConnectionType type); + /** * @return a human-readable description for the network interface type for use as label * @param type the type of the network interface diff --git a/libs/uiutils.cpp b/libs/uiutils.cpp --- a/libs/uiutils.cpp +++ b/libs/uiutils.cpp @@ -131,6 +131,19 @@ return true; } +bool UiUtils::isConnectionTypeVirtual(NetworkManager::ConnectionSettings::ConnectionType type) +{ + if (type == NetworkManager::ConnectionSettings::Bond || + type == NetworkManager::ConnectionSettings::Bridge || + type == NetworkManager::ConnectionSettings::Infiniband || + type == NetworkManager::ConnectionSettings::Team || + type == NetworkManager::ConnectionSettings::Vlan) { + return true; + } + + return false; +} + QString UiUtils::interfaceTypeLabel(const NetworkManager::Device::Type type, const NetworkManager::Device::Ptr iface) { QString deviceText;