Code cleanup on the Profile Settings

Authored by tcanabrava on Jun 14 2018, 12:13 PM.

Description

Code cleanup on the Profile Settings

Summary:
Favor manual list creator over for loop for small list

Three items, create them manually, cleaner and less
computationally expensive.

Btw - this is ugly, both ways. I blame QStandardItemModel.

Simplify Logic

Use auto when types are explicit

Simplify Logic: use ternary when it improves readability

Stack when heap's uneeded.

There's absolutely no point on creating a QPointer
and manually deleting the item later. Just create
the variable on the stack

Auto when type's explicit

Reviewers: Konsole, hindenburg

Reviewed By: Konsole, hindenburg

Subscribers: konsole-devel

Tags: Konsole

Differential Revision: https://phabricator.kde.org/D13532

Details

Committed
tcanabravaJun 17 2018, 2:34 PM
Reviewer
Konsole
Differential Revision
D13532: Code cleanup on the Profile Settings
Parents
R319:a9669bc3dbca: Code cleanup on the Profile Settings
R319:49e328f2ed27: Clean setFoundMatch
Branches
Unknown
Tags
Unknown

Merged Changes

CommitAuthorDetailsCommitted
a9669bc3dbcaD13532tcanabrava
Code cleanup on the Profile Settings 
Jun 17 2018
45cd5000d07ctcanabrava
Stack when heap's uneeded. 
Jun 17 2018
2ef126106640tcanabrava
Simplify Logic: use ternary when it improves readability 
Jun 17 2018
788d3d59018dtcanabrava
Use auto when types are explicit 
Jun 17 2018
aa80b577cd9atcanabrava
Simplify Logic 
Jun 17 2018
e782691e7021tcanabrava
Favor manual list creator over for loop for small list 
Jun 17 2018
1462bb095d72tcanabrava
Use Initializer list instead of temporaries 
Jun 17 2018