D18420: Optimize and reduce code in GuiObserver

Alexander Semke noreply at phabricator.kde.org
Thu Jan 24 07:27:46 GMT 2019


asemke added a comment.


  In D18420#398876 <https://phabricator.kde.org/D18420#398876>, @croick wrote:
  
  > I still prefer my solution ;)
  >
  > But I agree, that the enum would be more consistent with the rest of the project. Actually, `AbstractAspect` could have a `type()` function that contains the actual type (like in `AbstractFileFilter`). That would entirely spare the use of a map and string comparisons, but would require touching 20 constructors or so.
  >  What do you think?
  
  
  This would be the best solution I think. We'd maintain this global enum in AbstractAspect.h ("AspectType" maybe to be consistent with FileType in AbstractFileFilter) and use it in the constructors. No map required. But yes, we'd need to touch now some code. Also, every tyme we add a new enum value in AbstractAspect.h we'd need to basically re-compile the whole project since this header file is pulled either directly or indirectly in many places... But let's go for a consistent solution here and benefit from compile time checks. Would you like to do this change as part of this patch?

REPOSITORY
  R262 LabPlot

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

To: croick, #labplot
Cc: asemke, kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20190124/a399a625/attachment.html>


More information about the kde-edu mailing list