Reset comment widget when opening an archive.
ClosedPublic

Authored by rthomsen on Jul 7 2016, 4:53 PM.

Details

Summary

When creating a new archive from an Ark instance where an archive with comment already is opened, the comment widget from the previous archive remains open. This is now fixed by clearing and hiding the QPlaintTextEdit in start of Part::openFile().

Part::slotCommentChanged() gets called when calling QPlainTextEdit::clear(), so to avoid a segfault we need to check for a invalid m_model.archive() and in that case return.

Test Plan
  1. Open any archive with a comment.
  2. Create a new archive from Archive menu.
  3. Verify that the comment field from the previous archive disappears.

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rthomsen updated this revision to Diff 5008.Jul 7 2016, 4:53 PM
rthomsen retitled this revision from to Reset comment widget when opening an archive..
rthomsen updated this object.
rthomsen edited the test plan for this revision. (Show Details)
rthomsen added a reviewer: elvisangelaccio.
rthomsen set the repository for this revision to R36 Ark.
rthomsen added a project: Ark.
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptJul 7 2016, 4:53 PM
elvisangelaccio accepted this revision.Jul 7 2016, 5:29 PM
elvisangelaccio edited edge metadata.

Works fine!

This revision is now accepted and ready to land.Jul 7 2016, 5:29 PM
This revision was automatically updated to reflect the committed changes.