D21409: KWrite: Implement sceleton KTextEditor::Application

Michal Humpula noreply at phabricator.kde.org
Sun May 26 09:44:42 BST 2019


michalhumpula updated this revision to Diff 58675.
michalhumpula added a comment.


  Uh, this is getting more complicated then I though it would be.
  
  So, if I call `QApplication::quit()` from the `KWrite::quit` the ktexteditor doesn't even get a chance to notify user about unsaved changes. For the specific vi-mode usecase I think calling close on active window is perfectly ok.
  
  But... since the KTextEditor::Application object is registered multiple times when KWrite object is created , then this patch creates a mayhem when multiple windows are open. So the only way out I can see is to create the regular KWrite Application as in kate. And that is this update
  
  Good part:
  
  - there are no static properties in KWrite anymore.
  
  Bad part:
  
  - ktexteditor vi-mode close command is unable to handle dummy main window correctly and causes segfault
  
  Ugly:
  
  - in order to implement KTextEditor::Application properly the kwrite would have to track which KWrite is active and all the other stuff.
  
  So apparently this went quickly over my paygrade. No idea where to go from here.

REPOSITORY
  R40 Kate

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D21409?vs=58659&id=58675

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

AFFECTED FILES
  kwrite/CMakeLists.txt
  kwrite/kwrite.cpp
  kwrite/kwrite.h
  kwrite/kwriteapplication.cpp
  kwrite/kwriteapplication.h
  kwrite/main.cpp

To: michalhumpula, cullmann
Cc: loh.tar, dhaumann, kwrite-devel, domson, michaelh, ngraham, demsking, cullmann, sars
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190526/daaf1b87/attachment.html>


More information about the KWrite-Devel mailing list