1. 08 Oct, 2016 1 commit
  2. 05 Oct, 2016 2 commits
    • Ragnar Thomsen's avatar
      Register jobs in KIO's jobtracker · e7a74d59
      Ragnar Thomsen authored
      This makes all of Ark's job types show up in system tray of Plasma. The
      progress of the jobs is then visible in system tray and they can also be
      stopped from system tray. Additionally, the user gets a notification
      when jobs complete.
      Ellipsis were removed from description of LoadJob ("Loading archive...")
      to be consistent with description of the other jobs.
    • Elvis Angelaccio's avatar
      BacthExtractJob: fix forwarding of errors · 6db65d75
      Elvis Angelaccio authored
      Now ark shows again the error dialog when a wrong password is provided
      upon batch-extracting header-encrypted archives.
      Task: 1877
  3. 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
  4. 29 Sep, 2016 1 commit
  5. 14 Sep, 2016 1 commit
    • Elvis Angelaccio's avatar
      Fix race condition when killing jobs · 8ad610bf
      Elvis Angelaccio authored
      The `m_abortOperation` global variable was set by the main thread and read
      by the secondary thread, i.e. undefined behavior.
      QThread::requestInterruption() and isInterruptionRequest() are instead
      safe because they use a QMutexLocker.
      Tested only with ListJobs, are other type of jobs are currently broken
      (see e.g. bugs #365869 and #365870).
      Closes T3598
  6. 13 Sep, 2016 1 commit
    • Elvis Angelaccio's avatar
      Drop unused event loop code · 0fffb964
      Elvis Angelaccio authored
      The event loop in the QThread's run() method was only necessary when
      CliInterface was running in another thread, but this is no longer
      happening. This event loop does not even start because when doWork()
      returns, `result` has already been emitted, resulting in q->isRunning()
      being false.
      This also means that we can drop m_isRunning, removing a possible
      source of race conditions.
  7. 15 Aug, 2016 1 commit
  8. 11 Aug, 2016 1 commit
    • Ragnar Thomsen's avatar
      AddJob: Count number of entries to be added · 41e3d16e
      Ragnar Thomsen authored
      Count the total number of entries to be added using QDirIterator. We can
      then use the number to display a correct string in statusbar when adding
      files. Also pass the number to AddFiles() so interfaces/plugins can use
      it for showing progress in %.
      Differential Revision: D2397
  9. 08 Aug, 2016 1 commit
  10. 22 Jul, 2016 1 commit
    • Elvis Angelaccio's avatar
      Fix preview of nested archives · 8be8fe5b
      Elvis Angelaccio authored
      The assumption that a PreviewJob can remove its temp dir when it's done (commit 41b25127)
      was wrong, at least with nested archives.
      If we remove the extracted file too soon, there is no way to preview a nested archive or,
      worse, a "double-nested" archive.
      This patch just delays the cleanup to the Part destructor.
      Differential Revision: D2265
  11. 19 Jul, 2016 1 commit
  12. 17 Jul, 2016 1 commit
  13. 21 Jun, 2016 1 commit
  14. 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
  15. 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
  16. 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
  17. 02 May, 2016 1 commit
    • 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.
  18. 30 Apr, 2016 1 commit
    • 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
  19. 23 Apr, 2016 1 commit
    • Elvis Angelaccio's avatar
      libarchive: properly stop all jobs · 8c21ca3a
      Elvis Angelaccio authored
      We use the m_abortOperation flag in the same way ListJob does (see commit
      We also need to remove the disconnect() in the Job destructor, which makes Ark
      crash if we stop an AddToArchive job. This disconnect() looks like a relic of the
      past (see e.g. commit 15fce6f5) and doesn't seem really necessary.
      Note that the CliInterface jobs still need to be fixed. So do batch extract
      jobs, which are KCompositeJobs and currently ignore the kill button in the
      CCBUG: 222392
      Differential Revision: D1466
  20. 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
  21. 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
      Differential Revision: D1229
  22. 23 Feb, 2016 4 commits
  23. 18 Nov, 2015 2 commits
  24. 27 Oct, 2015 2 commits
  25. 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
      This bumps the required dep version for ECM to 5.14.0.
  26. 23 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
  28. 22 Aug, 2015 1 commit
  29. 09 Jun, 2015 1 commit
  30. 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
      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
  31. 31 May, 2015 2 commits
  32. 30 May, 2015 1 commit
    • 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.
  33. 25 May, 2015 1 commit