D16882: [KDevelop/Shell] prevent duplicate added contextmenu actions

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Thu Nov 15 14:38:05 GMT 2018


kossebau added a comment.


  In D16882#359595 <https://phabricator.kde.org/D16882#359595>, @rjvbb wrote:
  
  > >   Please, let's find the root causes and fix things at the base instead of adding such
  >
  > "we"
  
  
  (tried to not make this a "you" vs. "others" thing in the language, but yes, your itch only so far here, you have to scratch as a matter of normal software developer life)
  
  > find a fixable bug in some framework there's still no guarantee that no one will ever run KDevelop against a non-fixed version of that framework.
  
  _If_ it is found that the root bug is in KTextEditor, sure.
  
  For now the root is unknown, and there is some chance that it is actually the ctag plugin code which does something hacky to trigger the reported unexpected multiple parallel emissions of the menuAboutToShow signal.
  
  > I'll see if a breakpoint in and backtrace from my added if teaches me anything but I have my doubts (and no other ideas).
  
  I can only urge you to invest into learning how to do debugging the stuff that you work on. It's basic developer tooling. Like a serioius electrical engineer is expected to know how to use a multimeter or oscilloscope for the circuits they are fiddling with.
  
  >>   (even uncommented=unexplained=surprising)
  > 
  > That's easy to fix. See the "todo" comment elsewhere in the same file.
  >  TBH, I didn't add a comment yet because in itself I see nothing wrong in checking if you're dealing with the active view before you start adding things to a contextmenu.
  
  There are lots of things to check usually. But ones does not as one relies on callees fulfilling the explicit and implicit API contracts. And here the API seems to be the emission of the KTextEditor::View::contextMenuAboutToShow signal, that one should only be done once and for the given view where the menu is shown on: "Signal which is emitted immediately prior to showing the current context menu". 
  Adding guard code (thus complexity and stuff to maintain) to protect against contract breakages is only done as last resort.
  KTextEditor and kate ctags plugin are OpenSource. They can (and should) be fixed. Everything else is just adding debts for future code maintainers. Surely many humans are fine with having their fun & easy life now on the costs of future generation.s, but seeing myself still part of the near future kdevelop generation, here my banner script: "Stop creating code to work around bug symptoms ."

REPOSITORY
  R32 KDevelop

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

To: rjvbb, #kdevelop, kossebau
Cc: kossebau, kde-frameworks-devel, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20181115/7233920d/attachment-0001.html>


More information about the KDevelop-devel mailing list