D10865: [1/5] Access readOnly state of FormWidgets dynamically

Albert Astals Cid noreply at phabricator.kde.org
Sat Mar 3 22:45:42 UTC 2018


aacid added a comment.


  BTW next time  please use arc so phabricator shows the context of the diff.

INLINE COMMENTS

> formwidgets.cpp:304
>          m_widget->clearFocus();
> -    m_widget->setVisible( visible );
> +    m_widget->setVisible( visible && !m_ff->isReadOnly() );
>      return hadfocus;

i would really prefer this to be moved to whoever calls setVisiblity, it's kind of weird for setVisiblity to sometimes not do what you ask it to do.

> formwidgets.cpp:310
>  {
> -    m_widget->setEnabled( fill && m_canBeEnabled );
> +    m_widget->setEnabled( fill && !m_ff->isReadOnly() );
>  }

Do we need this at all? the widget won't ge visible when it's readonly, so what do we care if it's enabled or not?

> aheinecke wrote in pageview.cpp:1002
> Without this change the PartTest::testSaveAsUndoStackForms would segfault because the underlying fields are destroyed but setCanBeFilled now accesses them to check for readOnly.

If we remove the use of visiblity as i commented already we can get this back to how it was?

REPOSITORY
  R223 Okular

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

To: aheinecke, #okular
Cc: aacid, michaelweghorn, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180303/16bb523c/attachment.html>


More information about the Okular-devel mailing list