1. 25 Sep, 2020 1 commit
  2. 19 Jun, 2019 1 commit
  3. 01 Jun, 2019 1 commit
  4. 18 Sep, 2018 1 commit
  5. 19 Mar, 2017 2 commits
  6. 29 Dec, 2016 2 commits
    • Elvis Angelaccio's avatar
      Add Archive::hasMultipleTopLevelEntries() method · b8879008
      Elvis Angelaccio authored
      An archive has more than one top-level entry when it's neither
      single-file nor single-folder.
    • Elvis Angelaccio's avatar
      Add isSingleFile property · 7ce9802d
      Elvis Angelaccio authored
      An archive is single-file if contains only one file. The Archive class
      only holds its numberOfEntries() but it doesn't know if they are files
      or folders. However, if there is only one entry and isSingleFolder() is
      false, that entry must be a file.
      This is ensured by the expanded loadtest.
  7. 22 Dec, 2016 1 commit
  8. 02 Dec, 2016 1 commit
  9. 08 Nov, 2016 1 commit
    • Ragnar Thomsen's avatar
      Implement support for setting encryption method · 03939219
      Ragnar Thomsen authored
      Needed infrastructure changes were done in ArchiveFormat, CliProperties
      and other classes. A combobox was added to CreateDialog which enables
      setting the encryption method.
      Currently, only the Zip format when using cli7z supports multiple
      encryption methods. For other formats that support only one encryption
      method, the method is shown in the combobox.
      This diff also enables detection of encryption method when opening
      archives which is then shown in PropertiesDialog. To this end a new
      signal was added to ReadOnlyArchiveInterface (encryptionMethodFound).
      The similar compressionMethodFound signal was modified to only take one
      string instead of QStringList.
      Differential Revision: D3303
  10. 07 Nov, 2016 2 commits
  11. 04 Nov, 2016 1 commit
    • Ragnar Thomsen's avatar
      Refactor CliInterface · 1074bf07
      Ragnar Thomsen authored
      CliInterface is refactored to be more simple. A new class CliProperties
      is added which holds all the commands, switches and regex's for the cli
      executables. Alot of code is moved from CliInterface to the new class.
      Two new member variables are added to ReadOnlyArchiveInterface of types
      QMimeType and KPluginMetaData. These are passed to CliProperties which
      it uses to call ArchiveFormat::fromMetadata() so it can check archive
      format properties.
      The KPluginMetaData is passed from Archive to ReadOnlyArchiveInterface
      as the second item in the args QVariantList.
      CompressionMethods provided in the plugin json files was changed from a
      QStringList to a QVariantMap so it can hold pairs of values: One user-
      visible string and one value for the cli-switch.
      Differential Revision: D3235
  12. 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
      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
      ReadOnlyArchiveInterface::addFiles() got an additional argument of type
      uint that holds the number of entries to be added.
      Differential Revision: D3072
  13. 15 Oct, 2016 2 commits
    • Elvis Angelaccio's avatar
      Drop testhelper code in movetest · 38e1b6a1
      Elvis Angelaccio authored
      Instead, manually define what we actually want as expected result.
      This brings the number of failures down to only four.
    • Elvis Angelaccio's avatar
      Turn extraction/compression options into classes · 89a7b5bb
      Elvis Angelaccio authored
      Currently CompressionOptions and ExtractionOprions are both QHash typedefs,
      which means they are the same thing for the compiler.
      Currently we even pass CompressionOptions objects where ExtractionOptions objects are expected.
      Both types are changed into proper classes, so that the compiler can
      detect this class of bugs.
      While at it:
      - The default value for the `PreservePaths` option was false, now is true because it's
        the more common case.
      - The `RemoveRootNode` option was redundant, it was only used together with the
        `DragAndDrop` one.
      - The `FollowExtractionDialogSettings` was only set but never read, so we can drop it.
      Differential Revision: D3039
      Task: T2137
  14. 11 Oct, 2016 1 commit
  15. 09 Oct, 2016 1 commit
    • Ragnar Thomsen's avatar
      Detect compression method · 50a9f590
      Ragnar Thomsen authored
      A new property was added to Archive to store detected compression
      method(s). Currently, it's only displayed in PropertiesDialog, but the
      plan is to also use it to select a sane default compression method when
      adding files to an existing archive. Code was added to all plugins for
      detecting the compression method(s) when opening an archive and a signal
      added to ReadOnlyArchiveInterface to set the property.
      Many archive types support multiple compression methods in same archive,
      so the property is a QStringList.
      Differential Revision: D2987
  16. 02 Oct, 2016 1 commit
    • 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
      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
      Differential Revision: D2811
  17. 15 Aug, 2016 1 commit
  18. 09 Aug, 2016 1 commit
  19. 01 Aug, 2016 2 commits
  20. 29 Jul, 2016 1 commit
    • Ragnar Thomsen's avatar
      Add testcases for multivolume rar and 7z archives to ArchiveTest · 33928e42
      Ragnar Thomsen authored
      We test two additional properties in testProperties: isMultiVolume and
      numberOfVolumes. These properties are only correct after listing an
      archive so we now call listIfNotListed() in isMultiVolume(). This change
      required isMultiVolume() and isReadOnly() to be made non-const.
      The testcases revealed a bug in Archive::completeBaseName(), where the
      basename was not generated correctly for multi-volume archives. This is
      also fixed now.
      Differential Revision: D2291
  21. 23 Jul, 2016 3 commits
    • Ragnar Thomsen's avatar
      Fix handling of drag'n'drop adding files to archives · d56aabf4
      Ragnar Thomsen authored
      Multi-volume archives are set to read-only (only when non-empty) in
      Archive class. This is needed because rar and 7z don't support modifying
      such archives.
      Also, a KMessageWidget is now shown when user drags files to a read-only
      archive or an encrypted archive when password is unknown.
      Unfortunately, we cant set encrypted archives with unknown password to
      read-only, because we still want to support deleting files from them.
      Differential Revision: D2274
    • Elvis Angelaccio's avatar
      Fix endless loop of ListJobs · 23424950
      Elvis Angelaccio authored
      There is a race condition when ListJob emits the result signal.
      Both ArchiveModel::slotLoadingFinished() and Archive::onListFinished() are connected
      to this signal. But the former triggers a chain of calls that ends up calling
      properties of Archive that are set by the concurrent Archive::onListFinished().
      An example is Archive::encryptionType() called by Part::updateActions().
      This results in an endless chain of ListJob instances.
      This patch is only a temporary workaround for the upcoming 16.08 stable
      release, since there is no time to test and merge a proper fix (see T3300)
      Differential Revision: D2272
      Task: T3296
    • Elvis Angelaccio's avatar
      GIT_SILENT Initialize variable · 673066f7
      Elvis Angelaccio authored
  22. 21 Jul, 2016 1 commit
    • Ragnar Thomsen's avatar
      Add multi-volume support · bf6425d1
      Ragnar Thomsen authored
      Support for creating multi-volume rar, 7z and zip archives was
      implemented. A QDoubleSpinBox was added to CompressionOptionsWidget
      which allows setting the volume size in megabytes between 0.1 to 1000.
      The size in megabytes is converted by CompressionOptionsWidget to
      kilobytes because 7z doesn't support volume sizes with decimals.
      Creating a multi-volume archive changes the archive name
      (name.part1.rar, name.7z.001, name.zip.001) so we need to re-open the
      archive (the first volume) after adding files.
      We only support adding files once, so add/delete actions are disabled in
      Part if archive is multi-volume and non-empty.
      FEATURE: 124180
      FIXED-IN: 16.08.0
      Differential Revision: D2194
  23. 19 Jul, 2016 1 commit
    • Ragnar Thomsen's avatar
      Disable adding files to existing password-protected non-he archives · 32832943
      Ragnar Thomsen authored
      We don't know the password after opening a non-header-encrypted
      password-protected archive. If adding files to such an archive the newly
      added files will be unencrypted with no warning to the user and the
      resulting archive will be a mixture of encrypted/unencrypted files.
      This commit disables adding files to such archives and gives an
      explanation in the tooltip for the add files action.
      Differential Revision: D2196
  24. 17 Jul, 2016 1 commit
  25. 16 Jul, 2016 2 commits
    • Ragnar Thomsen's avatar
      Detect multi-volume archives and show info in PropertiesDialog · 0f4ae19b
      Ragnar Thomsen authored
      Two variables were added to ReadOnlyArchiveInterface: A boolean
      describing whether the archive is multi-volume and an int used for
      storing number of volumes. Two corresponding Q_PROPERTY's were added to
      Archive which fetch the info from ReadOnlyArchiveInterface.
      The detection of multi-volume archives was fixed in cli7z.
      The information is displayed in PropertiesDialog and will be used when
      implementing support for creating multi-volume archives.
    • Ragnar Thomsen's avatar
      Implement a custom AddDialog · 07269ec7
      Ragnar Thomsen authored
      This diff implements an AddDialog class that is used instead of
      QFileDialogs for adding files/folders to an archive. Now both folders
      and files are added to an archive with a single action in Part, instead
      of two separate actions (Add File/Add Folder).
      AddDialog has a button which opens a new dialog that allows setting
      advanced compression settings (currently only compression level). Since
      compression options are used both when creating a new archive and adding
      files to an existing archive, a new class called
      CompressionOptionsWidget was created which is used by both AddDialog and
      Differential Revision: D2120
  26. 10 Jul, 2016 1 commit
    • Ragnar Thomsen's avatar
      Add number of folders to PropertiesDialog and fix bugs · d78e151c
      Ragnar Thomsen authored
      The number of folders is now also shown in PropertiesDialog. There was a
      bug where number of files/folders and total uncompressed size didn't get
      updated after adding/deleting files from archive. This is now fixed by
      counting the files/folders and uncompressed size in
      BUG: 363368
      FIXED-IN: 16.08.0
      Differential Revision: D2130
  27. 21 Jun, 2016 1 commit
  28. 10 Jun, 2016 1 commit
    • Elvis Angelaccio's avatar
      Add new jobs to preview/open a file · 41b25127
      Elvis Angelaccio authored
      The goal of task T916 is to stop disabling the Part UI while extracting an
      entry. To do so, we need first to make sure that no race condition would occur
      if extracting two or more entries in parallel.
      A race condition might occur in Part::slotOpenExtractedEntry(), where
      m_openFileMode is a global member that could be accessed concurrently between
      different threads. We can stop using this variable if we introduce dedicated
      jobs for preview/opening of files. This way we can simply do a dynamic_cast on
      the local job variable, to check whether the user wants to open or open-with
      the file.
      Preview is totally unrelated so it can be moved into a different slot. We can
      also make sure that the PreviewJob deletes the temporary directory upon
      Differential Revision: D1749
  29. 05 Jun, 2016 1 commit
    • Elvis Angelaccio's avatar
      Fix opening of files whose mimetype inherits from a supported mimetype · 8b9cd300
      Elvis Angelaccio authored
      Before 16.04 Ark used to be able to open files whose mimetype is not directly
      registered with Ark, but inherits from a mimetype that is supported by Ark.
      Examples are .odt and .epub files that both inherits from application/zip.
      Since we don't use anymore KMimeTypeTrader (since 16.04), we need to manually
      do this check while loading our plugins.
      BUG: 363717
      FIXED-IN: 16.04.2
      Differential Revision: D1725
  30. 02 Jun, 2016 1 commit
    • Elvis Angelaccio's avatar
      Cache the detected archive mimetype · 65895fc6
      Elvis Angelaccio authored
      Archive::mimeType() is frequently called (i.e. every time that in the view the selected
      entry changes), so this saves some computation and reduces the amount of noisy
      debug output.
  31. 06 May, 2016 1 commit
    • Elvis Angelaccio's avatar
      Make jobs parent-less · 268ad34f
      Elvis Angelaccio authored
      KJobs autodelete themselves using deleteLater(), when they are done.
      So there is no reason to have them as children of Archive.
      This fixes a crash when canceling a ListJob with header-encrypted archives
      (see task T2225).
      Differential Revision: D1525
  32. 03 May, 2016 1 commit
    • Ragnar Thomsen's avatar
      Add basic test functionality · 13d70a48
      Ragnar Thomsen authored
      Add a TestJob and associated action in Part. Test functionality is
      enabled in plugin json files, currently for clizip, clirar and cli7z.
      Test results are displayed simply as success/failure in a KMessageBox.
      Testing password-protected archives will currently result in an
      errorbox, due to these archives potentially having different passwords
      for each file and hence multiple password prompts might pop up.
      Libarchive does not support testing archives.
      FEATURE: 140492
      FIXED-IN: 16.08.0
      Differential Revision: D1516