D11051: Remembering side navigation panel state

Tobias Deiminger noreply at phabricator.kde.org
Tue Apr 3 10:39:03 UTC 2018


tobiasdeiminger added a comment.


  > One thing that may fix it is changing
  > 
  >   m_sidebar = new Sidebar( parentWidget );
  > 
  > to
  > 
  >   m_sidebar = new Sidebar();
  > 
  > in part.cpp, this micht change the part/child relationships and get yourself of this problem. can you give it a quick try?
  
  Seems like sidebar becomes a (grand-)child of Shells QTabWidget, no matter what you set as parent widget in Sidebar Ctor. This is because of ##setWidget( m_sidebar )## in Part::Part(), and  ##m_tabWidget->addTab( firstPart->widget(), QString() )## in Shell::Shell(). Then C++ Dtor order lets Shell::~Shell (cleans up child widgets, including sidebar) be called earlier than Part::~Part.
  
  > Should we stick to it or should we consider saving the stats in the Sidebar::~Sidebar()?
  
  Would it be an option to save sidebar state in ##Part::closeUrl()##?
  It is called early enough by Shell Dtor. For me it fixes the segfault, and "closeUrl" sounds like a reasonable action to cause document related state saving.

REPOSITORY
  R223 Okular

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

To: dileepsankhla, #okular, aacid
Cc: tobiasdeiminger, aacid, sander, #okular, michaelweghorn, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180403/3352200f/attachment.html>


More information about the Okular-devel mailing list