D24923: Use more return early

Cyril Rossi noreply at phabricator.kde.org
Thu Oct 24 15:22:25 BST 2019


crossi requested changes to this revision.
crossi added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> networkmodel.cpp:402
>      // Check whether the connection is already in the model to avoid duplicates, but this shouldn't happen
> -    if (!m_list.contains(NetworkItemsList::Connection, connection->path())) {
> -        NetworkModelItem *item = new NetworkModelItem();
> -        item->setConnectionPath(connection->path());
> -        item->setName(settings->id());
> -        item->setTimestamp(settings->timestamp());
> -        item->setType(settings->connectionType());
> -        item->setUuid(settings->uuid());
> -        item->setSlave(settings->isSlave());
> +    if (m_list.contains(NetworkItemsList::Connection, connection->path()))
> +        return;

Code style :  Use curly braces even when the body of a conditional statement contains only one line.

REPOSITORY
  R116 Plasma Network Management Applet

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

To: nicolasfella, jgrulich, crossi
Cc: crossi, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191024/0467a00b/attachment-0001.html>


More information about the Plasma-devel mailing list