1. 25 Sep, 2020 1 commit
  2. 14 Mar, 2020 1 commit
    • Nicolas Fella's avatar
      Lazily load file entry icons · 2c684ecd
      Nicolas Fella authored
      Summary:
      Building the icons datastructure is the most significant bottleneck when opening large archives. Knowing all the icons at loading time is unnecessary since most elements won't be visible anyway.
      This patch moves the icon storing into the Entry class where it is lazily determined the first time it is accessed. This improves the initial archive loading time significantly.
      
      Test Plan: It's hard to give exact numbers, but my main test archive (the Android NDK) went from ~3 seconds to load to "pretty much instant"
      
      Reviewers: #ark, elvisangelaccio
      
      Reviewed By: #ark, elvisangelaccio
      
      Subscribers: broulik, kde-utils-devel
      
      Tags: #ark
      
      Differential Revision: https://phabricator.kde.org/D26357
      2c684ecd
  3. 03 Mar, 2020 1 commit
  4. 02 Jan, 2020 3 commits
    • Nicolas Fella's avatar
      Optimize ArchiveModel::cleanFileName · 8e436fad
      Nicolas Fella authored
      Summary: Creating the QRegularExpression is expensive and cleanFileName is called for each entry. By not re-creating the regex we gain a significant archive load time improvement
      
      Test Plan:
      {F7786657}
      
      Left is before, right is after. Note the red block on the left that isn't present on the right
      
      Reviewers: #ark, elvisangelaccio
      
      Reviewed By: #ark, elvisangelaccio
      
      Subscribers: elvisangelaccio, kde-utils-devel
      
      Tags: #ark
      
      Differential Revision: https://phabricator.kde.org/D25565
      8e436fad
    • Nicolas Fella's avatar
      Revert "Optimize ArchiveModel::cleanFileName" · 15c9cc6b
      Nicolas Fella authored
      Landed the wrong branch
      
      This reverts commit b9e0da8c.
      15c9cc6b
    • Nicolas Fella's avatar
      Optimize ArchiveModel::cleanFileName · b9e0da8c
      Nicolas Fella authored
      Summary: Creating the QRegularExpression is expensive and cleanFileName is called for each entry. By not re-creating the regex we gain a significant archive load time improvement
      
      Test Plan:
      {F7786657}
      
      Left is before, right is after. Note the red block on the left that isn't present on the right
      
      Reviewers: #ark, elvisangelaccio
      
      Reviewed By: #ark, elvisangelaccio
      
      Subscribers: elvisangelaccio, kde-utils-devel
      
      Tags: #ark
      
      Differential Revision: https://phabricator.kde.org/D25565
      b9e0da8c
  5. 15 Dec, 2019 1 commit
  6. 03 Dec, 2019 1 commit
  7. 18 Nov, 2019 1 commit
    • Nicolas Fella's avatar
      Don't covert icons to pixmaps multiple times · 81828188
      Nicolas Fella authored
      Summary: We don't need to convert the icon which is loaded by name to a pixmap here. The conversion happens later in the DecorationRole data() call.
      
      Test Plan:
      Open archive. Icons in the file list appear and are properly sized.
      Trigger overwrite dialog. Icons appear and are properly sized.
      
      Verified performance improvement with hotspot (see highlighted entries)
      
      before:
      {F7770370}
      
      after:
      {F7770371}
      
      Reviewers: #ark, elvisangelaccio
      
      Reviewed By: #ark, elvisangelaccio
      
      Subscribers: elvisangelaccio, kde-utils-devel
      
      Tags: #ark
      
      Differential Revision: https://phabricator.kde.org/D25377
      81828188
  8. 20 Oct, 2019 1 commit
  9. 24 Sep, 2019 1 commit
  10. 28 Jul, 2019 1 commit
    • Natsumi Higa's avatar
      Display BLAKE2 file checksums for RAR files · afdf8f26
      Natsumi Higa authored
      Summary: When creating a RAR 5.0 archive, BLAKE2sp can be used instead of CRC32 for file checksums. This diff adds an entry for BLAKE2 file checksum.
      
      Test Plan:
      Attached is a RAR 5.0 archive using BLAKE2sp file checksums.
      
      {F6875541}
      
      Reviewers: #ark, elvisangelaccio
      
      Subscribers: #ark, kde-utils-devel
      
      Tags: #ark
      
      Differential Revision: https://phabricator.kde.org/D21637
      afdf8f26
  11. 19 Jun, 2019 1 commit
  12. 01 Jun, 2019 1 commit
  13. 12 May, 2019 1 commit
    • Ragnar Thomsen's avatar
      Get columns to show from first file entry · 3ad7526b
      Ragnar Thomsen authored
      Currently, we use the first entry in an archive to determine which
      columns to show. If the first entry happens to be a directory, then all
      relevant columns might not be shown.
      
      Make sure we always check the first file entry for columns to
      show.
      
      BUG: 406135
      FIXED-IN: 19.04.2
      Differential Revision: D20683
      3ad7526b
  14. 20 Sep, 2018 1 commit
  15. 17 Jul, 2018 1 commit
    • Elvis Angelaccio's avatar
      Stop ignoring compression options when dropping files · 20c6faa5
      Elvis Angelaccio authored
      Compression options set by CreateDialog were only taken into account
      when adding files through the AddDialog, but not when adding files by
      dropping them from Dolphin.
      
      We fix this issue by moving the init of compression options in a new
      dedicated function, which we can call also when dropping files.
      
      While at it, this change allows us to simplify the `droppedFiles()`
      signal emitted by ArchiveModel.
      
      BUG: 396579
      FIXED-IN: 18.07.80
      20c6faa5
  16. 02 Jul, 2018 1 commit
  17. 22 Oct, 2017 1 commit
  18. 19 Mar, 2017 2 commits
  19. 13 Feb, 2017 1 commit
    • Elvis Angelaccio's avatar
      Fix archivemodel columns with singlefile archives · c1a72a8e
      Elvis Angelaccio authored
      ArchiveModel was setting 0 as Size with singlefile archives,
      because the singlefile plugin doesn't report the uncompressed size.
      
      This patch removes the Size column if the size property is 0 but the
      compressedSize one is higher than 0, which cannot happen.
      As compressedSize for singlefile entries, we just set the size of the
      archive.
      
      BUG: 376225
      FIXED-IN: 16.12.3
      
      Differential Revision: D4536
      c1a72a8e
  20. 22 Dec, 2016 1 commit
    • Elvis Angelaccio's avatar
      Simplify count of children in entries · 4f238829
      Elvis Angelaccio authored
      childrenCount() was called only after we already retrieved the entry
      from the index. This means that this function has nothing to do with the
      model and can be moved to Archive::Entry.
      4f238829
  21. 19 Dec, 2016 1 commit
    • Ragnar Thomsen's avatar
      Fix sorting in QTreeView · 206a5eee
      Ragnar Thomsen authored
      Commit 7781d6ef broke sorting in the sense that folders are no
      longer sorted before files. This is due to KRecursiveFilterProxyModel's
      implementation of sort() being used instead of ArchiveModel's.
      
      We now subclass KRecursiveFilterProxyModel into ArchiveFilterSortModel
      so we can re-implement lessThan() and move the relevant code from
      ArchiveModel::sort().
      
      Differential Revision: D3742
      206a5eee
  22. 02 Dec, 2016 2 commits
  23. 08 Nov, 2016 1 commit
    • Elvis Angelaccio's avatar
      archivemodel: drop global static map · e03d534d
      Elvis Angelaccio authored
      Make it a class member instead. This is now possible since we no longer
      have the ArchiveModelSorter class. While at it, use directly QByteArray
      instead of converting from QString.
      
      Differential Revision: D3272
      e03d534d
  24. 07 Nov, 2016 1 commit
  25. 05 Nov, 2016 2 commits
  26. 17 Oct, 2016 1 commit
    • Ragnar Thomsen's avatar
      Show progress in percentage for all job types in LibarchivePlugin · ef1753b4
      Ragnar Thomsen authored
      Progress is now also shown in percentage for Addjob, CopyJob, DeleteJob
      and MoveJob for archives handled by LibarchivePlugin. This was a bit
      tricky due to libarchive always iterating the whole archive and means
      that the plugin needs to know the total number of existing archive
      entries.
      
      A new member variable m_numberOfEntries was added to
      ReadOnlyArchiveInterface, which holds the total number of entries in the
      archive. The variable is kept up-to-date by incrementing/decrementing it
      whenever the entry and entryRemoved signals are emitted by a plugin.
      This necessitated a slight rework of the handling of MoveJob and CopyJob
      by LibarchivePlugin because these emitted entry when iterating over the
      old entries. The new approach should also be more efficient.
      
      The two Archive members m_numberOfFiles and m_numberOfFolders were
      removed.
      
      ReadOnlyArchiveInterface::addFiles() got an additional argument of type
      uint that holds the number of entries to be added.
      
      Differential Revision: D3072
      ef1753b4
  27. 12 Oct, 2016 1 commit
    • Elvis Angelaccio's avatar
      Fix crash when moving files with clizip · 377dfcfe
      Elvis Angelaccio authored
      Entry objects are created by the plugins, so it is wrong to delete them from other
      places. If the plugins run in the main thread, we can just set a parent
      to the entries. Otherwise (in the libarchive case) we need to manually
      delete them.
      
      Closes T3988
      
      Differential Revision: D3027
      377dfcfe
  28. 11 Oct, 2016 3 commits
  29. 06 Oct, 2016 1 commit
    • Ragnar Thomsen's avatar
      Process entries while listing archives · 491f1f78
      Ragnar Thomsen authored
      When listing archives Ark currently waits until the LoadJob is done to
      process the entries. This causes a lag (>7 seconds for large archives on
      fast systems) after the LoadJob has completed until the ArchiveView is
      ready.
      
      This diff causes ArchiveModel to start processing entries while the
      LoadJob is running. This results in the view being ready <1 second after
      LoadJob completes.
      
      Differential Revision: D2948
      491f1f78
  30. 02 Oct, 2016 3 commits
    • Ragnar Thomsen's avatar
      Remove Comment property from Archive::Entry · 7bba06c6
      Ragnar Thomsen authored
      This property was meant for storing file-specific comments as supported
      by e.g. the zip format. However, it was not used by any of the plugins.
      7bba06c6
    • Ragnar Thomsen's avatar
      Cleanup and optimization in ArchiveModel and Archive::Entry · 4d9be9fd
      Ragnar Thomsen authored
      Syntax and comment cleanup.
      
      Optimize Archive::Entry: Remove one unneeded QString member variable.
      Saves a few megabytes of memory when opening large archives.
      4d9be9fd
    • Elvis Angelaccio's avatar
      Refactor archive loading · 88acd303
      Elvis Angelaccio authored
      Ark currently loads an archive by using `Archive *Archive::create()` first
      and then `ListJob *archive->list()`. If an archive property is read
      *before* list() is called, the archive is listed in the background with
      listIfNotListed().
      This design is responsible for a lot or problems (see T1877, T3296 and T330).
      
      This commit refactors ListJob in a new LoadJob class. Is not possible
      anymore to create an archive and then list() it. Instead, a LoadJob is
      started first and then the archive can be retrieved at the end of the
      job.
      
      Differential Revision: D2811
      88acd303
  31. 01 Oct, 2016 1 commit
    • Ragnar Thomsen's avatar
      Fix drag-and-drop extraction of parentless files · bb9ede75
      Ragnar Thomsen authored
      In some archives parent folders of some files might not be part of the
      archive themselves, i.e. the archive does not contain separate entries
      for them. In this case ArchiveModel creates ArchiveDirNodes for the
      folders. However, the FileName and InternalID properties of these
      folders do not get a trailing slash. This results in faulty root nodes
      leading to e.g. broken drag-n-drop extraction of files within these
      folders.
      
      This diff simply appends a traling slash to the properties in
      ArchiveModel::parentFor().
      
      BUG: 367549
      FIXED-IN: 16.08.2
      Differential Revision: D2909
      bb9ede75