1. 23 Apr, 2016 1 commit
  2. 16 Apr, 2016 1 commit
    • Elvis Angelaccio's avatar
      Move GlobalWorkDir logic to AddJob::doWork() · 4320f587
      Elvis Angelaccio authored
      When adding files, we now change the working dir to GlobalWorkDir at the AddJob level.
      This way is easier to restore the old working dir, and we also merge
      some duplicated code between cliinterface and libarchiveplugin.
      
      Differential Revision: D1369
      4320f587
  3. 09 Apr, 2016 1 commit
    • Ragnar Thomsen's avatar
      Implement GUI to set compression level for new archives · f222a505
      Ragnar Thomsen authored
      Three new int's were added to plugin json files specifying minimum,
      maximum and default compression level for each readwrite mimetype. A new
      KCollapsibleGroupBox with a QSlider was added to CreateDialog to allow
      setting the compression level.
      
      FEATURE: 148702
      FIXED-IN: 16.08
      Differential Revision: D1364
      f222a505
  4. 07 Apr, 2016 1 commit
  5. 06 Apr, 2016 1 commit
    • Elvis Angelaccio's avatar
      Run CliInterface from the main thread · a537c5ee
      Elvis Angelaccio authored
      CLI-based plugins run their jobs in another process, so we can avoid to also
      run them in another thread. This also fixes a race condition with the unit
      tests.
      
      Differential Revision: D1229
      a537c5ee
  6. 30 Mar, 2016 2 commits
  7. 23 Mar, 2016 3 commits
  8. 22 Mar, 2016 1 commit
    • Elvis Angelaccio's avatar
      cliinterface: refactor the replacement of ExtractArgs · e01cfb41
      Elvis Angelaccio authored
      The old algorithm used to edit the list of ExtractArgs by using indexes.
      This was a mess and there was a bug in the replacement of PasswordSwitch.
      
      We now create an empty list, which we populate while iterating over
      the list of ExtractArgs. The replacement of each switch is performed in a
      dedicated function, to simplify the implementation.
      
      Unit tests are added, though only for clirar (for now).
      
      Differential Revision: D1190
      e01cfb41
  9. 20 Mar, 2016 1 commit
    • Ragnar Thomsen's avatar
      Handle "no space left" messages from cliplugins · 7f65f911
      Ragnar Thomsen authored
      Previously, Ark didn't handle "no space left" error messages from the
      cliplugins. This resulted in either the gui being "busy" continously
      (clizip), or that the user didn't get any indication that there was a
      problem extracting the archive (cli7z and clirar).
      
      This commit adds a pattern (DiskFullPatterns) for catching these errors.
      An errorbox is then displayed to the user. Some of the programs used in
      the cliplugins, such as 7z v9.38, doesn't output a specific message,
      but then a generic "Extraction failed" message is displayed instead.
      
      BUG: 206383, 206385
      FIXED-IN: 16.04.0
      
      Differential Revision: D455
      7f65f911
  10. 10 Mar, 2016 1 commit
    • Elvis Angelaccio's avatar
      cliunarchiver: fix extraction of empty folders · 3735ee8d
      Elvis Angelaccio authored
      When we move the extracted files from the temp dir to the final destination,
      we were skipping all the directories. Now we skip a directory only if we are
      not preserving paths or if the directory is not empty. An empty directory needs
      to be moved explicitly, while a non-empty one will be implicitly created by
      QDir::mkpath() when moving their children files.
      
      This fixes the related unit test.
      3735ee8d
  11. 09 Mar, 2016 1 commit
  12. 05 Mar, 2016 1 commit
    • Elvis Angelaccio's avatar
      Create temporary directories on disk and not in RAM · 8fd9487d
      Elvis Angelaccio authored
      Currently CliInterface::copyFiles() creates a temporary directory in /tmp,
      upon extraction of one or more selected files.
      
      This does not scale well on systems where /tmp is mounted in RAM,
      if the RAM is low or if the archive has huge files.
      
      With this patch we create the temporary directory on disk.
      We only need to be sure that the temp dir is created on the same disk where the final destination is
      (otherwise we write each (possibly huge) file twice).
      
      Differential Revision: D720
      8fd9487d
  13. 01 Mar, 2016 1 commit
    • Elvis Angelaccio's avatar
      Introduce (disabled) cliunarchiver plugin · 2d115b19
      Elvis Angelaccio authored
      This commit is obtained with 'git merge --squash feature/unarchiver'.
      We also disable the plugin for now, waiting for some more tests before the
      incoming Applications/16.04 feature freeze.
      
      Task: T1595
      2d115b19
  14. 29 Feb, 2016 2 commits
    • Elvis Angelaccio's avatar
      Fix regressions with extraction of selected entries · 952c82da
      Elvis Angelaccio authored
      Backport of c401afeb from master.
      
      BUG: 359628
      FIXED-IN: 15.12.3
      952c82da
    • Elvis Angelaccio's avatar
      CliInterface: use temp dir only for drag-and-drop extractions · c401afeb
      Elvis Angelaccio authored
      Currently Ark uses a temporary extraction directory when a cliplugin extracts
      only some selected files (i.e. when the CliInterface::copyFiles() functions gets a non-empty list of files).
      
      This is wrong. This was meant for drag-and-drop extractions only,
      where the fileRootNodePair struct is used (in CliInterface::moveToFinalDest) to remove the root node from the dropped
      entries. If the user performs a normal extraction via the extraction dialog,
      the current behavior introduce some unintended regressions (see commit
      7d1dafa9).
      
      The proper way to fix this is to explicitly tell the plugin when we want to
      perform a drag-and-drop extraction, in which case the temp dir will be used.
      
      CCBUG: 359628
      c401afeb
  15. 21 Feb, 2016 1 commit
  16. 20 Jan, 2016 1 commit
  17. 18 Nov, 2015 1 commit
  18. 16 Nov, 2015 1 commit
  19. 27 Oct, 2015 1 commit
  20. 26 Oct, 2015 1 commit
    • Ragnar Thomsen's avatar
      Add support for overwrite prompt of p7zip v15.09. · ff4b1345
      Ragnar Thomsen authored
      The overwrite prompt changed from p7zip version 9.38.1 to 15.09. Add
      support for the new prompt. FileExistsExpression had to be changed
      from QString to QStringList.
      
      Also, got rid of unneeded CliInterface::checkForFileExistsMessage().
      Just use CliInterface::checkForErrorMessage() instead.
      ff4b1345
  21. 15 Oct, 2015 1 commit
    • Ragnar Thomsen's avatar
      Use ecm_qt_declare_logging_category() cmake macro · 5e04e640
      Ragnar Thomsen authored
      This macro was introduced in ECM 5.14.0 and generates logging category
      declarations. This removes the necessity of Q_LOGGING_CATEGORY calls in
      cpp files. A header with Q_DECLARE_LOGGING_CATEGORY is automatically
      generated, so the old logging.h file can be removed.
      
      Also the identifier is now ARK everywhere, so all qCDebug() should be
      qCDebug(ARK).
      
      This bumps the required dep version for ECM to 5.14.0.
      5e04e640
  22. 04 Oct, 2015 2 commits
    • Ragnar Thomsen's avatar
      Improve handling of corrupt archives by CliPlugins · 170115f1
      Ragnar Thomsen authored
      A new parameter was added to the Kerfuffle::CliInterfaceParameters enum
      (called CorruptArchivePatterns), containing a list of regexps matching
      output from CliPlugins when a corrupt archive is listed.
      
      Due to the CliInterface not being able to launch a KMessageBox itself, a
      query (LoadCorruptQuery) was added which launches a
      KMessageBox::warningYesNo asking the user if he wants to try to load the
      corrupt archive. This is useful because some files might still be
      recoverable.
      
      If the user answers no, loading of the archive is cancelled.
      
      If the user answers yes the archive is loaded as usual, but to prevent
      the user from trying to add/delete files from the corrupt archive (which
      is likely to fail), the archive is set to readonly. This necessitated a
      new private member in ReadOnlyArchiveInterface (m_isCorrupt) and
      getter/setter functions. The setter function is used in
      CliInterface::HandleLine, while the getter function is used in
      ReadWriteArchiveInterface::isReadOnly().
      
      BUG: 261073
      BUG: 352949
      FIXED-IN: 15.12.0
      REVIEW: 125363
      170115f1
    • Ragnar Thomsen's avatar
      Fix header encryption in cli7z · d3286f07
      Ragnar Thomsen authored
      7z gives an error when using the header encryptions switch (-mhe=on|off)
      with archive types that don't support header encryption such as zip.
      This results in Ark failing to create new zip archives with cli7z.
      
      This is now fixed by setting $EncryptHeaderSwitch to empty when header
      encryption is off, instead of -mhe=off.
      
      This patch also fixes CreateDialog::isHeaderEncryptionChecked() to only
      return true if encryptHeaderCheckBox is both enabled and checked,
      instead of just checked.
      
      REVIEW: 125507
      d3286f07
  23. 03 Oct, 2015 1 commit
    • Ragnar Thomsen's avatar
      Enable loading alternative plugins and add executable check · 2d000a07
      Ragnar Thomsen authored
      Plugin loading code is reworked so Ark attempts other plugins, if
      highest priority plugin fails. For CliPlugins, Ark now also searches for
      executables (as specified in ParameterList in the individual plugin) in
      standard path after the plugin has been loaded and if they are not found
      moves on to next plugin in priority list. Read-write plugins require all
      four types of executables to be found (ListProgram, ExtractProgram,
      AddProgram and DeleteProgram), while read-only plugins require only
      ListProgram and ExtractProgram.
      
      This paves the way for setting cli7z priority higher than clizip to
      improve unicode support for zip archives. If p7zip is not installed by
      distributions, Ark will now automatically fall back to using the more
      widely installed  clizip.
      
      CCBUG: 221021
      2d000a07
  24. 23 Sep, 2015 1 commit
    • Ragnar Thomsen's avatar
      Add CliInterface::resetParsing() · bf487092
      Ragnar Thomsen authored
      This function is overridden in the individual CliPlugins and resets
      parsing variables, such as ParseState, m_comment, etc. This is needed
      because an archive can be listed several times without the plugin being
      reloaded, e.g. after adding files. This can result in e.g. comments
      being appended to themselves or parsing being started in the wrong
      ParseState.
      resetParsing() is called in CliInterface::list(), before running the
      list process.
      bf487092
  25. 21 Sep, 2015 1 commit
    • Ragnar Thomsen's avatar
      Fix drag'n'drop extraction with CLI-plugins · 7c025dd5
      Ragnar Thomsen authored
      This fixes drag'n'drop extraction of selected entries from Ark to e.g.
      Dolphin for archives handled by CLI-plugins. Previously, the entries
      would be extracted with full path, which is not what the user expects
      and not how the libarchive-plugin handles tar-based archives. This was
      due to CLI-plugins not supporting individual root nodes (i.e. removing
      a part of the path from entry to be extracted). This is now circumvented
      by extracting to a QTemporaryDir, removing the root node from the path,
      and finally moving the files to their final destination. The moving to
      final destination is done in a new member function in CliInterface
      (moveToFinalDest). This function checks if the destination file exists
      and prompts the user for action if that is the case.
      
      The finished signal() is now emitted from copyFiles()/addFiles()/
      deleteFiles()/list(), instead of from processFinished().
      
      BUG: 208384
      FIXED-IN: 15.08.2
      REVIEW: 125293
      7c025dd5
  26. 14 Sep, 2015 1 commit
  27. 10 Sep, 2015 1 commit
    • Ragnar Thomsen's avatar
      Fix drag'n'drop extraction of multiple selected archive entries · 2072d0d4
      Ragnar Thomsen authored
      This commit implements multi-selection drag'n'drop extraction. This is
      used when dragging multiple files from Ark to e.g. Dolphin for
      extraction. It's based partially on work done by Raphael in
      the multiple-dnd-selection git branch.
      
      Dragged files are extracted without path. Dragged folders are extracted
      without path, but with all folders/files beneath them
      extracted with relative path (i.e. path beneath the selected folder).
      
      A struct called FileRootNodePair is added to Kerfuffle::Archive, which
      contains two strings (the filename with path and a root node).
      A FileRootNodePair is passed for each entry to be extracted in a
      QVariantList to ArchiveModel::extractFiles(), which creates the
      ExtractJob. All children of folders are added to the QVariantList. The
      QVariantList is in turn passed to CliPlugin::copyFiles and hence
      LibArchiveInterface::copyFiles(). The latter is modified to remove the
      specific rootnode from each file when extracting.
      
      The CLI plugins, e.g. clizip and clirar, still extract with full path,
      due to not supporting individual RootNodes. However, this is a separate
      issue and should be fixed separately.
      
      BUG: 187152
      FIXED-IN: 15.08.1
      REVIEW: 124018
      2072d0d4
  28. 08 Sep, 2015 1 commit
    • Ragnar Thomsen's avatar
      Add support for overwrite prompt of unrar 5 · fba2a220
      Ragnar Thomsen authored
      The overwrite prompt changed in unrar 5 compared to unrar 3 and 4. This
      commit adds support for the unrar 5 prompt. Unrar 5 has a multi-line
      overwrite prompt, i.e. the last line of the overwrite prompt does not
      contain the name of the existing file, which is needed by the
      OverwriteQuery to display the filename to the user. This was solved by
      storing the filename in a member variable m_storedFileName, so it is
      available when the last line of the overwrite prompt is reached. To
      capture the filename, a new parameter, FileExistsFileName, was added to
      the CliInterfaceParameters enum.
      
      7z also has a multi-line overwrite prompt, so previously the filename
      was not displayed in the OverwriteQuery dialog. This is now fixed.
      
      BUG: 349131
      FIXED-IN: 15.08.1
      REVIEW: 124111
      fba2a220
  29. 22 Aug, 2015 1 commit
  30. 22 Jul, 2015 1 commit
    • Elvis Angelaccio's avatar
      Create password-protected archives with Ark · 402bbe84
      Elvis Angelaccio authored
      This feature allows Ark to create a password-protected archive from
      scratch.
      The 7z and rar plugins support both header encryption and entries-only
      encryption, while the zip one supports only the latter.
      
      An encrypted archive can be created through the CreateDialog (within Ark) or
      through the AddDialog (from e.g. Dolphin).
      
      REVIEW: 120204
      FEATURE: 253694
      FIXED-IN: 15.08
      GUI:
      402bbe84
  31. 12 Jul, 2015 1 commit
    • Raphael Kubo da Costa's avatar
      Uncomment out several qCDebug() calls. · f9328bce
      Raphael Kubo da Costa authored
      There is no point in keeping dead code in the tree. In this case,
      however, instead of getting rid of it it makes more sense to just
      uncomment out most calls: most of them were commented out during the
      port to KF5 in commits such as efe61f23 ("Port to qDebug") and
      58b55d1a ("--kdelibs4support, extraction fixes").
      
      A couple of comments were actually removed because they were also
      commented out in the KDE4 code.
      f9328bce
  32. 04 Jun, 2015 1 commit
    • Ragnar Thomsen's avatar
      Implement a cancelled() signal to fix cancellation of password dialogs · 8dd0b02a
      Ragnar Thomsen authored
      Implement a cancelled() signal in ReadOnlyArchiveInterface. This signal
      is emitted in CliInterface when the user cancels a password dialog. The
      signal is connected to a slot in Job which sets KJob::error to
      KJob::KilledJobError.
      
      The callers (Part and BatchExtract) are modified to do nothing if the
      error code is KJob::KilledJobError when running ListJobs/ExtractJobs/
      AddJobs/DeleteJobs. This fixes an issue where the user cancels the
      "Enter password" dialog and the UI keeps being blocked and/or error
      messageboxes appear.
      
      BUG: 267670
      FIXED-IN: 15.07.80
      REVIEW: 123967
      8dd0b02a
  33. 31 May, 2015 1 commit
  34. 30 May, 2015 2 commits
    • Ragnar Thomsen's avatar
      Implement a cancelled() signal for CliInterface · ee006cb6
      Ragnar Thomsen authored
      Add a cancelled() signal for ReadOnlyArchiveInterface and implement it
      for CliInterface. Previously, when the user tried to preview a file in a
      password-protected zip archive and then cancelled the password dialog,
      the ExtractJob would not be given a finished() signal and SetReadyGui()
      would not be triggered in the KPart leading to the UI appearing to be
      loading indefinitely. Now, finished() is called for the ExtractJob when
      the password dialog is cancelled but cancelled() is used to signal to
      the KPart not to open a viewer in this case.
      ee006cb6
    • Ragnar Thomsen's avatar
      Fix password never being asked again after a wrong one has been entered · 8492cc21
      Ragnar Thomsen authored
      Previously, if the user entered a wrong password for a password-
      protected archive, Ark would remember that a wrong password had been
      entered and had to be closed down to allow entering the password again.
      
      This commit fixes this issue by presenting the "Enter password" dialog
      again when the user attempts some action that requires access to the
      password-protected files.
      BUG: 297820
      FIXED-IN: 15.07.80
      REVIEW: 123358
      8492cc21