D5112: Make archiver ioslave extensible

Jonathan Marten noreply at phabricator.kde.org
Mon Mar 20 13:31:09 UTC 2017


marten created this revision.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.

REVISION SUMMARY
  The tar, zip and ar ioslaves are implemented in kio-extras/archive by a single plugin (class ArchiveProtocol).  This uses the URL scheme to determine which archive decoder to use - KTar, KZip or KAr all from the KArchive (tier 1) framework.  Unfortunately, it is not possible to use this ioslave as a base for another archive format plugin to be distributed and built outside of the KDE source tree, because the supported protocols and their decoders are hardcoded in the depths of ArchiveProtocol::checkNewFile().  This means that a new ioslave for another archive format would need to copy and adapt the whole of the ArchiveProtocol source.
  
  This change makes it possible to do that by moving most of ArchiveProtocol into an abstract base class ArchiveProtocolBase, compiled into an library and installed along with its supporting files.  This is not a framework library (and is not ever intended to be), but a support library similar to libkonq.  It calls a virtual function in a derived class to create the KArchive-based decoder depending on the URL scheme.  The ioslave plugin for the existing archive formats is a single derived class (although it could just as easily be three) which is installed in the same way as before.
  
  With this change, it is then possible to build and install an additional out-of-tree ioslave plugin, deriving from ArchiveProtocolBase and using its installed headers and library, without needing any further changes to kio-extras.
  
  The additional files installed are:
  
  lib/cmake/KF5KioArchive/KF5KioArchiveConfig.cmake
  lib/cmake/KF5KioArchive/KF5KioArchiveConfigVersion.cmake
  lib/cmake/KF5KioArchive/KF5KioArchiveTargets.cmake
  lib/cmake/KF5KioArchive/KF5KioArchiveTargets-debug.cmake
  include/KF5/kio_archivebase.h
  include/KF5/libkioarchive_export.h
  lib/libKF5KioArchive.so.5.97.0
  lib/libKF5KioArchive.so.6 -> libKF5KioArchive.so.5.97.0
  lib/libKF5KioArchive.so -> libKF5KioArchive.so.6
  
  The .so versions are set as for libkonq, although they can easily be changed if required.

TEST PLAN
  Built kio-extras with this change, all autotests pass.
  Konqueror operates correctly to browse tar and zip archives.
  External archive format plugin builds and works correctly.

REPOSITORY
  R320 KIO Extras

REVISION DETAIL
  https://phabricator.kde.org/D5112

AFFECTED FILES
  archive/CMakeLists.txt
  archive/KF5KioArchiveConfig.cmake.in
  archive/kio_archive.cpp
  archive/kio_archive.h
  archive/kio_archivebase.cpp
  archive/kio_archivebase.h

To: marten, #plasma, dfaure
Cc: plasma-devel, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170320/f055e1b2/attachment.html>


More information about the Plasma-devel mailing list