[Differential] [Requested Changes To] D2130: Record number of folders in archive and show in PropertiesDialog

elvisangelaccio (Elvis Angelaccio) noreply at phabricator.kde.org
Sun Jul 10 14:44:35 UTC 2016


elvisangelaccio requested changes to this revision.
elvisangelaccio added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> propertiesdialog.cpp:68
>      m_ui->lblHasComment->setText(archive->hasComment() ?  i18n("yes") : i18n("no"));
> -    m_ui->lblNumberOfFiles->setText(QString::number(archive->numberOfFiles()));
> -    m_ui->lblUnpackedSize->setText(KIO::convertSize(archive->unpackedSize()));
> +    m_ui->lblNumberOfEntries->setText(i18n("%1 files, %2 folders",
> +                                           QString::number(numberOfFiles),

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

> archivemodel.cpp:1018-1050
> +void ArchiveModel::countEntriesAndSize() {
> +    m_numberOfFiles = 0;
> +    m_numberOfFolders = 0;
> +    m_uncompressedSize = 0;
>  
> +    QElapsedTimer timer;
> +    timer.start();

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

  if input == m_rootNode
      // init counter to zero
  
  // do recursion

REPOSITORY
  rARK Ark

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: rthomsen, elvisangelaccio
Cc: kde-utils-devel, tctara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20160710/1334f85d/attachment-0001.html>


More information about the Kde-utils-devel mailing list