1. 19 Jul, 2016 1 commit
    • Ragnar Thomsen's avatar
      Fix testing encrypted archives for integrity · e1e62711
      Ragnar Thomsen authored
      Enable testing of encrypted archives by passing the password switch to
      the cli programs. When we don't know the password we disable the Test
      action with an explanation in the tooltip.
      Differential Revision: D2227
  2. 01 Jun, 2016 2 commits
    • Elvis Angelaccio's avatar
      Remove RootNodeSwitch leftovers · 4da52b6a
      Elvis Angelaccio authored
      This should have been part of commit 27e5167b.
    • Elvis Angelaccio's avatar
      Drop RootNode extraction option · 27e5167b
      Elvis Angelaccio authored
      We never set this option and because of this there is a lot of unused code (e.g. all the `RootNodeSwitch` stuff).
      Digging in the history, the last time that this option was set was in commit 10bc72f4.
      This means that this option is fully superseded by `fileNodeRootPair` and we can safely discard all this unused code.
      Closes T1942
      Differential Revision: D1704
  3. 03 May, 2016 4 commits
    • Elvis Angelaccio's avatar
      Fix Delete action on header-encrypted archives · 7addb6b7
      Elvis Angelaccio authored
      Forward-port of cdcd6c13.
    • Elvis Angelaccio's avatar
      Fix Delete action on header-encrypted archives · cdcd6c13
      Elvis Angelaccio authored
      Ark was ignoring the password prompt, resulting in an endless DeleteJob.
      This is simply fixed by using the PasswordSwitch, like in other jobs.
    • Elvis Angelaccio's avatar
      cliinterface: rename failOperation() to killProcess() · ac2dbbac
      Elvis Angelaccio authored
      The failOperation() function is confusing, since it just calls doKill().
      We can rename it to a function that actually kills the process and
      that may or may not cause the finished() signal to be emitted.
      Differential Revision: D1521
    • 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
  4. 02 May, 2016 2 commits
    • Vladyslav Batyrenko's avatar
      Drop unused functions in CliInterface · 8db338b5
      Vladyslav Batyrenko authored
      These functions were removed with commit ba150aa6 and have been unused since
      Differential Revision: D1526
      Closes T2388 as resolved.
    • Elvis Angelaccio's avatar
      Drop CliInterface::isCliBased() · c090e935
      Elvis Angelaccio authored
      The only reason why we needed to know whether an interface is CLI-based was to
      check whether the executables needed by the cliplugins were available.
      This check is now done in the Plugin class, so we can drop this function.
  5. 30 Apr, 2016 2 commits
    • Ragnar Thomsen's avatar
      Add support for editing/adding archive comments · 04d56afa
      Ragnar Thomsen authored
      Support was added for editing comments in supported archive types
      (currently only RAR). A new bool was added to plugin json files
      ("SupportsWriteComment") to indicate support. A new action was added and
      is found in Archive menu. The editing of comment is done in the same
      QPlainTextEdit used to display comments before. When user modifies
      comment, a KMessageWidget pops up with a "Save" button. Actual saving of
      comment to archive is achieved by a new job type: CommentJob.
      FEATURE: 357594
      FIXED-IN: 16.08.0
      Differential Revision: D1493
    • Elvis Angelaccio's avatar
      Don't block the main thread while running CliInterface jobs · 074d5277
      Elvis Angelaccio authored
      Currently we freeze the GUI thread while running CliInterface jobs,
      because there is a nested event loop in runProcess(),
      which doesn't run anymore in a separate thread.
      We can simply drop this event loop and rework the CliInterface logic,
      such that the emit signal is not emitted anymore when runProcess() returns,
      but in processFinished() instead.
      This exposed a crash when closing the main window while a pending job was
      running. The fix is simply to not emit finished() if the m_abortingOperation
      flag is set.
      BUG: 222392
      FIXED-IN: 16.08.0
      CCBUG: 193908
      Differential Revision: D1510
  6. 28 Apr, 2016 1 commit
  7. 27 Apr, 2016 1 commit
    • Elvis Angelaccio's avatar
      Use PluginManager to load plugins in the Archive class · fc7c6ded
      Elvis Angelaccio authored
      The Archive class now uses internally the PluginManager class, when loading the
      plugins. This means that it's now possible to disable a specific plugin in the
      arkrc configuration file. For example, the following will disable the clirar
      Differential Revision: D1477
  8. 17 Apr, 2016 1 commit
  9. 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
  10. 07 Apr, 2016 1 commit
  11. 30 Mar, 2016 2 commits
  12. 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
  13. 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
  14. 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.
  15. 09 Mar, 2016 1 commit
  16. 06 Mar, 2016 1 commit
  17. 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
  18. 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
  19. 18 Nov, 2015 1 commit
  20. 26 Oct, 2015 2 commits
    • Ragnar Thomsen's avatar
      Add support for reading archive comments · 3a22bbd5
      Ragnar Thomsen authored
      Add support for reading comments in CLI-based plugins such as rar and
      zip. The comment is parsed from the output of ListJob. The comment is
      displayed below the file view in a read-only QPlainTextEdit with
      monospace font. A QSplitter is used so the user can resize the comment
      Support is added to clirar, clizip and cli7z plugins. The 7z-format
      doesn't support comments, but the cli7z-plugin supports reading comments
      in e.g. zip archives.
      BUG: 328790
      FIXED-IN: 15.12.0
      REVIEW: 124468
    • 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.
  21. 04 Oct, 2015 1 commit
    • 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
      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
      BUG: 261073
      BUG: 352949
      FIXED-IN: 15.12.0
      REVIEW: 125363
  22. 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
  23. 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
      resetParsing() is called in CliInterface::list(), before running the
      list process.
  24. 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
  25. 14 Sep, 2015 1 commit
  26. 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
  27. 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
      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
  28. 14 Oct, 2014 1 commit
  29. 14 May, 2014 1 commit
    • Albert Astals Cid's avatar
      Properly stop list jobs on close · acb455da
      Albert Astals Cid authored
      Track running jobs in JobTracker. On its destruction (i.e. UI is going down) we kill and delete (which waits for finishing) those jobs.
      Tested with very big tar.gz (libarchive plugin) and .zip (cliplugin) and it closes without crashing now
      Acked by rakuco
      BUGS: 193908
      FIXED-IN: 4.13.2
      REVIEW: 118108
  30. 19 Sep, 2013 1 commit
  31. 04 Jul, 2012 1 commit
    • Raphael Kubo da Costa's avatar
      cliinterface: Do not leak the pattern cache across different instances. · 586f4a25
      Raphael Kubo da Costa authored
      Since the pattern cache was a method-static variable, it was shared
      among all CliInterface instances created during Ark's lifetime, which
      meant that the same pattern cache ended up being used if one opened a
      zip archive and then a rar one.
      Fix that by making the pattern cache an actual member variable, so
      each CliInterface instance has its own.
      Reported by:	Torsten Rahn <tackat@kde.org>
  32. 09 May, 2012 1 commit