[Differential] [Commented On] D2599: Don't delete ETMViewStateSaver manually

dkurz (Denis Kurz) noreply at phabricator.kde.org
Sun Aug 28 19:27:53 BST 2016


dkurz added a comment.


  In https://phabricator.kde.org/D2599#48516, @mlaurent wrote:
  
  > It doesn't work when I implemented it.
  
  
  Sorry, I don't understand what you mean by that. I tested my implementation: In KMail's main widget, I tried various non-empty quick search texts and cleared the line edit again, and the selection state was correctly restored every time. It is not restored to the pre-quicksearch state when I click on one of the folders in the narrowed-down folder list, but I think that's intended behaviour. Please feel free to test it yourself, it works like a charm.
  
  Maybe you hit some upstream bug when you tried to fix it. As I wrote, the api docs state explicitly that we should not keep a persistent pointer to savers on the heap. Also, a grep on the PIM code base reveals that restoring is always done as I suggest in this patch, with the single exception of todoview.cpp in the eventviews module:
  
    $ grep -Rn "new \(Akonadi::\)\?ETMViewStateSaver\>" .
    ./eventviews/src/todo/todoview.cpp:1224:    mTreeStateRestorer = new Akonadi::ETMViewStateSaver();
    ./messagelib/messagelist/src/pane.cpp:1121:                    ETMViewStateSaver *saver = new ETMViewStateSaver;
    ./messagelib/messagelist/src/pane.cpp:1125:                        ETMViewStateSaver *saver = new ETMViewStateSaver;
    ./mailcommon/src/folder/foldertreewidget.cpp:168:        auto saver = new Akonadi::ETMViewStateSaver;
    ./kdepim/kaddressbook/src/mainwidget.cpp:424:        Akonadi::ETMViewStateSaver *saver = new Akonadi::ETMViewStateSaver;
    ./kdepim/kaddressbook/src/mainwidget.cpp:433:        Akonadi::ETMViewStateSaver *saver = new Akonadi::ETMViewStateSaver;
    ./kdepim/kaddressbook/src/mainwidget.cpp:442:        Akonadi::ETMViewStateSaver *saver = new Akonadi::ETMViewStateSaver;
    ./kdepim/kmail/src/kmmainwidget.cpp:354:    ETMViewStateSaver *saver = new ETMViewStateSaver;
    ./kdepim/korganizer/src/akonadicollectionview.cpp:225:        treeStateRestorer = new Akonadi::ETMViewStateSaver(); // not a leak
    ./kdepim-addons/examples/apps/etm_usage/unreadmailsincollectionswidget.cpp:161:    ETMViewStateSaver *restorer = new ETMViewStateSaver;
  
  But maybe I just misunderstood your meaning.

REPOSITORY
  rMAILCOMMON PIM: Common Mail Support

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: dkurz, #kde_pim
Cc: mlaurent, kde-pim, spencerb, dvasin, winterz, smartins, vkrause, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20160828/7cbe9141/attachment.html>


More information about the kde-pim mailing list