D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-04-13 Thread loh tar
loh.tar abandoned this revision.
loh.tar added a comment.


  To relieve the maintainer it's droped now.
  But I still have the feeling there could be something improved at these 
"Read-Only Stuff"

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor, cullmann
Cc: ngraham, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, 
gennad, domson, michaelh, bruns, demsking, sars, dhaumann


D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-04-12 Thread Christoph Cullmann
cullmann added a comment.


  I still think we should stay with status quo, can you drop this request?

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor, cullmann
Cc: ngraham, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, 
gennad, domson, michaelh, bruns, demsking, sars, dhaumann


D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-03-16 Thread Christoph Cullmann
cullmann added a comment.


  I actually would just keep the status quo here ;=)

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor, cullmann
Cc: ngraham, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, 
gennad, domson, michaelh, bruns, demsking, sars, dhaumann


D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-03-10 Thread loh tar
loh.tar added a comment.


  So, then I assume you would be pro this patch.
  
  I notice one behavior that would be against this patch but not pro the 
meaning of "Read Only Mode". When you set this setting and issue a save request 
you get the "Save as" dialog. Such behavior is good in any case. But such 
option, working as the current one, should then be called like, "Don't 
Overwrite File".
  
  When you open as normal user a not writeable file, like /etc/fstab, I would 
somehow expect to see some warning and/or to enter the "Read Only Mode". But 
that's not the case. When you issue a save request you will be promted for 
admin rights, which is good in that example, no doubts.
  
  Then exist the case that an "dangerous/odd" file, e.g. with too long lines, 
will set to "Read Only Mode". So far I remember is that also only be done to 
protect the orig file to be overwritten, but not for some hard needs which 
couldn't be handled by KTextEditor, it's more some odd protection against bad 
edit performance. So here is also a "Don't Overwrite File" setting more needful 
at the long end.
  
  So, have have the feeling "Read Only Mode" should be renamed and this patch 
trashed, and the lock icon patch presumably too :-/

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor, cullmann
Cc: ngraham, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, 
gennad, domson, michaelh, bruns, demsking, sars, dhaumann


D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-03-09 Thread Nathaniel Graham
ngraham added a comment.


  In general I don't think it makes sense to be able to mark an 
already-modified-but-not-yet-saved document as read-only. It's already been 
written to!

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor, cullmann
Cc: ngraham, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, 
gennad, domson, michaelh, bruns, demsking, sars, dhaumann


D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-03-08 Thread loh tar
loh.tar added a comment.


  @ngraham Nate? Your opinion to the question?

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor, cullmann
Cc: ngraham, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, 
gennad, domson, michaelh, bruns, demsking, sars, dhaumann


D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-03-04 Thread loh tar
loh.tar added a subscriber: ngraham.
loh.tar added a comment.


  There is some reason why I came to this idea. ATM is that thought not so 
sharp present :-/
  But it was related to the auto-reload patch and the lock icon in the bar.
  
  @ngraham what do you think in general? Make a read only setting to an already 
modified file sense from the logic point, not because some strange use case? 
  Why not save the file with the changes you had done? Or reload to discard?

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor, cullmann
Cc: ngraham, cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, 
domson, michaelh, bruns, demsking, sars, dhaumann


D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-03-04 Thread Christoph Cullmann
cullmann requested changes to this revision.
cullmann added a comment.
This revision now requires changes to proceed.


  Thought about it bit more, actually like the "I can save even thought not 
modified" I think the "I can set read-only thought modified" is ok and actually 
no bug but a feature.
  I see no merit in forbidding that (and actually would be even confused why 
this is disabled sometimes).

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor, cullmann
Cc: cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, domson, 
michaelh, ngraham, bruns, demsking, sars, dhaumann


D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-03-04 Thread Christoph Cullmann
cullmann added a comment.


  Hmm, two things:
  
  1. implementation wise: don't we have a problem here that the 
connect(document(), &KTextEditor::DocumentPrivate::modifiedChanged, [=] { 
m_toggleWriteLock->setEnabled(!doc()->isModified()); }); will not be 
unconnected if the view dies and we call on an invalid pointer?
  
  2. logic wise: why not allow people to set read only if it was modified? That 
avoids that you type something into the document by accident.

REPOSITORY
  R39 KTextEditor

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

To: loh.tar, #ktexteditor
Cc: cullmann, kwrite-devel, kde-frameworks-devel, #ktexteditor, domson, 
michaelh, ngraham, bruns, demsking, sars, dhaumann


D19511: ViewPrivate: Disable read-only mode action when doc is modified

2019-03-04 Thread loh tar
loh.tar created this revision.
loh.tar added a reviewer: KTextEditor.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
loh.tar requested review of this revision.

REVISION SUMMARY
  It's somehow pointless to activate the read-only mode when the document
  is already modified. However, after an save event becomes the action
  available again.

REPOSITORY
  R39 KTextEditor

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

AFFECTED FILES
  src/view/kateview.cpp

To: loh.tar, #ktexteditor
Cc: kwrite-devel, kde-frameworks-devel, #ktexteditor, domson, michaelh, 
ngraham, bruns, demsking, cullmann, sars, dhaumann