D7167: Ignore default mark in icon border for single selectable mark

Dominik Haumann noreply at phabricator.kde.org
Mon Sep 18 16:49:12 UTC 2017


dhaumann requested changes to this revision.
dhaumann added a comment.
This revision now requires changes to proceed.


  I think the patch makes sense, but I would prefer using a Qt function qPopulationCount to count the bits instead of doing own bitmask magic. Could you provide an updated patch?

INLINE COMMENTS

> kateviewhelpers.cpp:2145
> +                    const uint singleMark = // is the default or the only editable mark
> +                        (editBits & (editBits - 1)) ? // true if number of editable marks > 1
> +                            editBits & config->defaultMarkType() :

I would prefer using qPopulationCounte (see http://doc.qt.io/qt-5/qtalgorithms.html#qPopulationCount):

  // is the default or the only editable mark
  const uint singleMark = (qPopulationCount(editBits) > 1)
      ? editBits & config->defaultMarkType() : editBits;

REPOSITORY
  R39 KTextEditor

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

To: croick, #ktexteditor, dhaumann
Cc: dhaumann, kwrite-devel, #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20170918/a2028ca6/attachment-0001.html>


More information about the KWrite-Devel mailing list