D11051: Remembering side navigation panel state

Albert Astals Cid noreply at phabricator.kde.org
Tue Apr 3 21:32:48 UTC 2018


aacid added a comment.


  In D11051#239040 <https://phabricator.kde.org/D11051#239040>, @tobiasdeiminger wrote:
  
  > > 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.
  
  
  The thing is that whether you have the panel open or not is not really document related.
  
  I think what we should do is just save the option when it changes, like we do in Part::slotShowLeftPanel and Part::slotShowBottomBar

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/e1a95029/attachment.html>


More information about the Okular-devel mailing list