Review Request 129231: [WIP] allow control over adding to "files/open recent" menu and use it in the patchreview plugin to prevent pollution

René J.V. Bertin rjvbertin at gmail.com
Fri Oct 21 14:51:26 UTC 2016


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/129231/
-----------------------------------------------------------

(Updated Oct. 21, 2016, 5:51 p.m.)


Status
------

This change has been marked as submitted.


Review request for KDevelop.


Changes
-------

Submitted with commit 3c559df38551ba0a0654e944ea2b68dd4b85a15d by René J.V. Bertin to branch master.


Bugs: 371210
    http://bugs.kde.org/show_bug.cgi?id=371210


Repository: kdevplatform


Description
-------

I've recently started noticing that my recent files menu got populated with files opened automatically by the patchreview plugin. That can lead to surprises if one of the patches you review opens files changed sufficiently long ago. What's more, the review files themselves, the temporary patch files, also end up in the menu.

The former is a more or less minor aesthetic issue, the latter is something I consider a bug; cf. the linked bug report.

The patch proposed here provides a mechanism to control whether or not files are added to the Files/Open Recent menu. Rather than adding a flag to all *DocumentController methods that might lead to adding a file to that menu (= not only the openDocument methods) I've opted for an approach with a state variable and a setter function that returns the previous state. I've kept `IDocumentController` purely abstract, so the actual implementation including the state member variable is provided by the `DocumentController` class.
I think this approach should also maintain ABI compatibility.

The mechanism is put to use in the patch review plugin to disable updating of the recent files menu in the 2 places where files are opened automatically.

The patch also improves the (somewhat related) maximum number of documents to open feature which I think never worked as intended.


Diffs
-----

  interfaces/idocumentcontroller.h b8a41f0 
  plugins/patchreview/patchreview.cpp 1ddec7f 
  plugins/patchreview/patchreviewtoolview.cpp de52800 
  shell/documentcontroller.h 35c2057 
  shell/documentcontroller.cpp c1e9c4c 

Diff: https://git.reviewboard.kde.org/r/129231/diff/


Testing
-------

With this patch in place the patch review no longer adds all documents it opens to the Files/Open Recent menu, but this concerns only the patchfile itself and the files opened automatically and initially. Any action to open a file by the user or even activate one of the already open files still leads to adding that file to the menu, as one would expect.

Currently tested on OS X only but there is no reason this would work differently elsewhere.


Thanks,

René J.V. Bertin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20161021/11a2464e/attachment.html>


More information about the KDevelop-devel mailing list