Record number of folders in archive and show in PropertiesDialog
ClosedPublic

Authored by rthomsen on Jul 10 2016, 10:54 AM.

Details

Reviewers
elvisangelaccio
Summary

This will also be used in AddToArchiveTest.

To fix updating of number of files/folders and uncompressed size when adding/deleting entries, a function (countEntriesAndSize()) was added in ArchiveModel that counts the files/folders and total uncompressed size by traversing the model. This function is called before opening PropertiesDialog.

Fixes bug 363368.

Test Plan

Open archives of various types and check that the number of folders in PropertiesDialog is correct.

Diff Detail

Repository
R36 Ark
Lint
Lint Skipped
Unit
Unit Tests Skipped
rthomsen updated this revision to Diff 5057.Jul 10 2016, 10:54 AM
rthomsen retitled this revision from to Record number of folders in archive and show in PropertiesDialog.
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 10 2016, 10:54 AM
rthomsen updated this revision to Diff 5059.Jul 10 2016, 1:08 PM

Fix bug where number of files/folders are not updated when adding/deleting files.

rthomsen updated this revision to Diff 5060.Jul 10 2016, 2:08 PM
  • Fix the uncompressed size not updating when adding/deleting entries.
  • Add a timer.
rthomsen updated this object.Jul 10 2016, 2:23 PM
elvisangelaccio requested changes to this revision.Jul 10 2016, 2:44 PM
elvisangelaccio edited edge metadata.
elvisangelaccio added inline comments.
kerfuffle/propertiesdialog.cpp
68

This should propertly handle singular/plural form. You can use i18np() as described here: https://api.kde.org/frameworks/ki18n/html/prg_guide.html

part/archivemodel.cpp
1018–1050

Wouldn't be possible to merge these two functions?
Pseudo-code:

if input == m_rootNode
    // init counter to zero

// do recursion
This revision now requires changes to proceed.Jul 10 2016, 2:44 PM
rthomsen updated this revision to Diff 5061.Jul 10 2016, 3:31 PM
rthomsen edited edge metadata.

Implement Elvis' suggestionsa and add a comment.

rthomsen marked 2 inline comments as done.Jul 10 2016, 3:32 PM
elvisangelaccio accepted this revision.Jul 10 2016, 3:56 PM
elvisangelaccio edited edge metadata.

Nice work!

This revision is now accepted and ready to land.Jul 10 2016, 3:56 PM