D18689: plasma-nm Connection Icon not showing correct icon when using a bridge

Jan Grulich noreply at phabricator.kde.org
Mon Feb 4 07:02:10 GMT 2019


jgrulich added a comment.


  That sounds like a bug in NetworkManager, because ActivatingConnection should be the one which will become PrimaryConnection, that's what the documentation says, that's the reason why we use it. If it's a NM bug, we still need a workaround.
  
  In your code, you can simplify it with:
  
    if (connection && !UiUtils::isConnectionTypeSupported(connection->type()) {
        connection = NetworkManager::primaryConnection();
    }
  
  Problem is that isConnectionTypeSupported() will return true if you have virtual connections enabled. We should maybe add additional method to to UiUtils to identify virtual connections (this new one can be then used inside isConnectionTypeSupported())
  
  I would suggest.
  
    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;
    }
  
  With this you can simply use
  
    if (connection && isConnectionTypeVirtual(connection->type()) {
        connection = NetworkManager::primaryConnection;
    }

REPOSITORY
  R116 Plasma Network Management Applet

REVISION DETAIL
  https://phabricator.kde.org/D18689

To: rthomas, jgrulich, #plasma
Cc: plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190204/c3247c33/attachment-0001.html>


More information about the Plasma-devel mailing list