Review Request: Add smart clean up and buddy document architecture

Martin Heide martin.heide at gmx.net
Wed Mar 16 19:57:28 UTC 2011



> On March 12, 2011, 1:57 p.m., Milian Wolff wrote:
> > please split buddy/cleanup review requests
> > 
> > and I'm missing the code that defines IBuddyDocumentFinder - seems to be not included in the patchset
> > 
> > furthermore I don't see *any* reason for putting the IBuddy stuff into sublime, make it kdevplatform interfaces and put the implementation into shell and use it in the document controller
> > 
> > imo for sublime the only change required is the "open view after view x"
> 
> Dmitry Risenberg wrote:
>     >and I'm missing the code that defines IBuddyDocumentFinder - seems to be not included in the patchset.
>     
>     It actually is, the list of files in patch has a second page.

>please split buddy/cleanup review requests
Done, for the "buddy documents", see https://git.reviewboard.kde.org/r/100874/ . A new diff is uploaded there.

Moved IBuddyDocumentFinder into interfaces. BuddyFinderRegistry exists no more, its functionality is directly integrated in IBuddyDocumentFinder, because the two classes were very tiny.


> On March 12, 2011, 1:57 p.m., Milian Wolff wrote:
> > shell/documentcontroller.cpp, line 434
> > <http://git.reviewboard.kde.org/r/100795/diff/2/?file=10925#file10925line434>
> >
> >     hm you say here buddies are not applicable but there is still code using buddyFinder below?

This portion of code is for the following case: We have the tabs
| *foo.h* | foo.cpp | (foo.h is active).
"Open new tab after current" in uiconfig is activated. When now the user opens bar.cpp, the new tab would be placed between foo.h and foo.cpp, seperating the "buddies". So, when the "buddy document" option is enabled, we handle this case by skipping one tab and placing the new tab after foo.cpp.

Note: The "buddy documents" are only are only accounted for when openDocument() is called, afterwards the user may move the tabs as (s)he wants.


> On March 12, 2011, 1:57 p.m., Milian Wolff wrote:
> > sublime/cleanup.h, line 36
> > <http://git.reviewboard.kde.org/r/100795/diff/2/?file=10939#file10939line36>
> >
> >     this seems unused.
> >     
> >     if it's supposed to be used from plugins or so it requires to be exported and put into a proper standalone icleanupstrategy.h header
> >     
> >     anyways could you please split up the review requests? this seems unrelated to the buddy stuff above and I'd rather review it separately

>this seems unrelated to the buddy stuff above and I'd rather review it separately
They're not completely unrelated, as we used the "buddy" feature to filter the list of tabs that are proposed for closing. (If foo.h is considered as outdated, but foo.cpp was recently used, then foo.h is not proposed for closing)


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/100795/#review1917
-----------------------------------------------------------


On March 10, 2011, 7:25 p.m., Yannick Motta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/100795/
> -----------------------------------------------------------
> 
> (Updated March 10, 2011, 7:25 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Summary
> -------
> 
> Add document buddy architecture :
> Allow kdevelop language plugins to manage related documents (like foo.h and foo.cpp for cpp plugin)
> Language plugins may implement IBuddyDocumentFinder to define the rules (how to know if two documents are buddies).
> Language plugins that implement IBuddyDocumentFinder  must register themselves with BuddyFinderRegistry.
> An option was added to open documents side by side with its buddies.
> 
> Add smart cleanup feature to allow user to easily close outdated tabs related to each tab-bar.
> Outdated tabs are files that are not currently used.
> This feature is configurable, user can choose the time after which smart cleanup considers an unused tab outdated.
> An document is considered active if it is active at least five seconds.
> Last five documents are never outdated. 
> If an outdated document has an active buddy, it is immune to cleanup.
> User must manually start cleanup feature on the context menu of the tab-bar.
> A dialog opens and user can see which documents are considered outdated. User can remove documents from the list.
> If the user clicks "ok", tabs will be close.
> 
> Add an option to hide close buttons on tabs in order to free some space.
> 
> 
> Diffs
> -----
> 
>   interfaces/idocumentcontroller.h d036afa 
>   shell/documentcontroller.h 8dc3706 
>   shell/documentcontroller.cpp bc0a3dd 
>   shell/settings/uiconfig.kcfg 60dccb2 
>   shell/settings/uiconfig.kcfgc 3c02f72 
>   shell/settings/uiconfig.ui 61f4b08 
>   shell/tests/CMakeLists.txt b093565 
>   shell/tests/documentcontrollertest.h PRE-CREATION 
>   shell/tests/documentcontrollertest.cpp PRE-CREATION 
>   shell/tests/shellbuddytest.h PRE-CREATION 
>   shell/tests/shellbuddytest.cpp PRE-CREATION 
>   sublime/CMakeLists.txt f9aaaeb 
>   sublime/area.h df0e2bb 
>   sublime/area.cpp efa8025 
>   sublime/buddyfinderregistry.h PRE-CREATION 
>   sublime/buddyfinderregistry.cpp PRE-CREATION 
>   sublime/cleanup.h PRE-CREATION 
>   sublime/cleanup.cpp PRE-CREATION 
>   sublime/cleanupdialog.h PRE-CREATION 
>   sublime/cleanupdialog.cpp PRE-CREATION 
>   sublime/cleanupdialog.ui PRE-CREATION 
>   sublime/container.h 1633a9f 
>   sublime/container.cpp f858575 
>   sublime/controller.h e8b4794 
>   sublime/controller.cpp a8dd38a 
>   sublime/ibuddydocumentfinder.h PRE-CREATION 
>   sublime/mainwindow.cpp a2d1aab 
>   sublime/tests/CMakeLists.txt 410412b 
>   sublime/tests/areaoperationtest.h 0e0f08e 
>   sublime/tests/areaoperationtest.cpp 28dbeff 
>   sublime/tests/cleanuptest.h PRE-CREATION 
>   sublime/tests/cleanuptest.cpp PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/100795/diff
> 
> 
> Testing
> -------
> 
> We have added two unit tests :
> sublime-cleanuptest
> shell-buddytest
> both pass without error.
> manual test seems also working as expected.
> 
> 
> Screenshots
> -----------
> 
> New ui settings
>   http://git.reviewboard.kde.org/r/100795/s/90/
> Cleanup dialog and hided close buttons
>   http://git.reviewboard.kde.org/r/100795/s/91/
> Tab bar context menu
>   http://git.reviewboard.kde.org/r/100795/s/92/
> 
> 
> Thanks,
> 
> Yannick
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20110316/55b521a1/attachment.html>


More information about the KDevelop-devel mailing list