Code Simplification / Readability Changes
ClosedPublic

Authored by tcanabrava on Jul 3 2019, 9:22 AM.

Details

Summary

Small changes thru the codebase to improve readability.
One potential crash fixed, and an old file removed.

Test Plan

run ctest. same results as running with master.

Diff Detail

Repository
R871 DrKonqi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
tcanabrava created this revision.Jul 3 2019, 9:22 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 3 2019, 9:22 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
tcanabrava requested review of this revision.Jul 3 2019, 9:22 AM
tcanabrava retitled this revision from Simplify algorithm to draw the stars. to Code Simplification / Readability Changes.Jul 3 2019, 9:24 AM
tcanabrava edited the test plan for this revision. (Show Details)
sitter added a subscriber: sitter.Jul 3 2019, 9:30 AM
sitter added inline comments.
src/backtraceratingwidget.cpp
61–63

Can we switch over m_usefullness instead? Using enums as integers gets me all worked up.

broulik added a subscriber: broulik.Jul 3 2019, 9:32 AM
broulik added inline comments.
src/backtraceratingwidget.h
50

usefulness with one L

src/debugger.cpp
91–93

I find early returns to be more readable. Maybe just remove the explicit } else { statement

src/drkonqi.cpp
84–85

+1

tcanabrava marked an inline comment as done.Jul 3 2019, 9:33 AM
tcanabrava added inline comments.
src/debugger.cpp
91–93

@broulik those changes where made to keep the rest of the file in sync (all of the other functions are using this style)

tcanabrava marked 2 inline comments as done.Jul 3 2019, 9:59 AM
tcanabrava updated this revision to Diff 61056.Jul 3 2019, 10:01 AM
  • Store the number of stars instead of the Enum

I continue to want a switch on the usefulness. If another usefulness gets introduced only a switch will ensure that we get a compiler warning if that new value isn't handled.

tcanabrava updated this revision to Diff 61068.Jul 3 2019, 1:30 PM
  • Store the number of stars instead of the Enum
  • Check enums with switch
sitter accepted this revision.Jul 3 2019, 1:31 PM
This revision is now accepted and ready to land.Jul 3 2019, 1:31 PM
This revision was automatically updated to reflect the committed changes.