Editor - Line highlighting color fix
Needs RevisionPublic

Authored by mvalentino on Sep 14 2018, 11:58 PM.

Details

Reviewers
tcanabrava
cfeck
Group Reviewers
KDE Edu

Diff Detail

Repository
R337 KTurtle
Branch
mvalentino
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 4573
Build 4591: arc lint + arc unit
mvalentino created this revision.Sep 14 2018, 11:58 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptSep 14 2018, 11:58 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
mvalentino requested review of this revision.Sep 14 2018, 11:58 PM
tcanabrava added inline comments.Sep 17 2018, 7:51 AM
src/editor.h
159

Declare the variables when you are going to use them.

160

don't use this->, this is not java.
access the private variables directly.

166–175

Why are you setting the values of errorColor wordColor in a if-branch that you will not use?

171–175

create a lambda so you don't need to pass bgColor.saturation() / value() three times.

tcanabrava requested changes to this revision.Sep 17 2018, 7:53 AM
This revision now requires changes to proceed.Sep 17 2018, 7:53 AM
mvalentino updated this revision to Diff 42944.Oct 5 2018, 8:18 PM
  • Eliminating unnecessary usage of QColor variables for editor highlighting
aacid added a subscriber: aacid.Oct 5 2018, 9:15 PM
aacid added inline comments.
src/editor.h
159

Don't leave old code around commented, if someone ever needs to know what the code was, that's what git history is for.

tcanabrava requested changes to this revision.Oct 12 2018, 3:11 PM

can you address aacid comments?

This revision now requires changes to proceed.Oct 12 2018, 3:11 PM
mvalentino updated this revision to Diff 43487.Oct 12 2018, 5:39 PM
  • Removed old commented code
aacid added inline comments.Oct 12 2018, 8:14 PM
src/editor.h
41

having a comment here is weird, because you haven't actualyl change the line but the comment seems like you have, so you probably want to remove this comment and if needed make sure it is in the commit log?

mvalentino updated this revision to Diff 44035.Oct 21 2018, 5:23 PM
  • Removed misplaced comment
tcanabrava requested changes to this revision.Nov 2 2018, 4:44 PM

Just this small thing and it can go in.

src/editor.h
148

const QColor&

pass the variable via reference, as it will eliminate the copy created between calls.

This revision now requires changes to proceed.Nov 2 2018, 4:44 PM
mvalentino updated this revision to Diff 44879.Nov 5 2018, 1:56 AM
  • Passing argument for getHighlightColor via reference
tcanabrava accepted this revision.Nov 5 2018, 8:39 AM
This revision is now accepted and ready to land.Nov 5 2018, 8:39 AM
cfeck added a subscriber: cfeck.Nov 5 2018, 11:08 AM
cfeck added inline comments.
src/editor.h
152

You need to range-limit the saturation value, otherwise Qt just outputs a qWarning and returns an invalid color.

http://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/painting/qcolor.cpp#n1080

cfeck closed this revision.Nov 5 2018, 11:09 AM
cfeck reopened this revision.
This revision is now accepted and ready to land.Nov 5 2018, 11:09 AM
cfeck requested changes to this revision.Nov 5 2018, 11:09 AM
This revision now requires changes to proceed.Nov 5 2018, 11:09 AM