├── .craft.ini ├── .flatpak-manifest.json ├── .gitignore ├── .gitlab-ci.yml ├── .kde-ci.yml ├── .krazy ├── CMakeLists.txt ├── CMakePresets.json ├── CONTRIBUTING.md ├── COPYING.icons ├── LICENSES ├── BSD-2-Clause.txt ├── CC0-1.0.txt ├── GPL-2.0-or-later.txt ├── LGPL-3.0-only.txt └── MIT.txt ├── Mainpage.dox ├── Messages.sh ├── README.md ├── README.packagers ├── REUSE.toml ├── app ├── CMakeLists.txt ├── MacOSXBundleInfo.plist.in ├── ark.qrc ├── ark_dndextract.json.cmake ├── arkrc ├── arkui.rc ├── batchextract.cpp ├── batchextract.h ├── compressfileitemaction.cpp ├── compressfileitemaction.h ├── compressfileitemaction.json ├── extractHereDndPlugin.cpp ├── extractHereDndPlugin.h ├── extractfileitemaction.cpp ├── extractfileitemaction.h ├── extractfileitemaction.json ├── icons │ ├── 128-apps-ark.png │ ├── 48-apps-ark.png │ ├── 64-apps-ark.png │ ├── CMakeLists.txt │ └── sc-apps-ark.svgz ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── org.kde.ark.appdata.xml ├── org.kde.ark.desktop.cmake └── welcomeview │ ├── recentfilesmodel.cpp │ ├── recentfilesmodel.h │ ├── welcomeview.cpp │ ├── welcomeview.h │ └── welcomeview.ui ├── autotests ├── CMakeLists.txt ├── app │ ├── CMakeLists.txt │ ├── batchextracttest.cpp │ └── data │ │ ├── simple%archive.tar.gz │ │ └── test.txt.gz ├── kerfuffle │ ├── CMakeLists.txt │ ├── adddialogtest.cpp │ ├── addtest.cpp │ ├── addtoarchivetest.cpp │ ├── copytest.cpp │ ├── createdialogtest.cpp │ ├── data │ │ ├── .clang-format │ │ ├── Makefile │ │ ├── README │ │ ├── a.txt │ │ ├── absolutepath.tar.xz │ │ ├── addonsu-remove-14.1-x86-signed.zip │ │ ├── archive-deepsinglehierarchy.json │ │ ├── archive-emptysinglefolder.json │ │ ├── archive-malicious.json │ │ ├── archive-multiplefolders.json │ │ ├── archive-multivolume.7z.001 │ │ ├── archive-multivolume.7z.002 │ │ ├── archive-multivolume.7z.003 │ │ ├── archive-multivolume.part1.rar │ │ ├── archive-multivolume.part2.rar │ │ ├── archive-multivolume.part3.rar │ │ ├── archive-nodir-manyfiles.json │ │ ├── archive-onetopfolder.json │ │ ├── archive-password.json │ │ ├── archive-singlefile.json │ │ ├── archive-unorderedsinglefolder.json │ │ ├── archive-with-metadata.zip │ │ ├── archive001.json │ │ ├── archive002.json │ │ ├── archivetest_encrypted.zip │ │ ├── archivetest_unencrypted.zip │ │ ├── archlinux-2015.09.01-dual_truncated.iso │ │ ├── bug_#394542.zip │ │ ├── code-x.y.z.tar.gz │ │ ├── empty_folders.tar.gz │ │ ├── empty_folders.zip │ │ ├── firmware-pine64-20160329-6.1.aarch64.rpm │ │ ├── hello-1.0-x86_64.AppImage │ │ ├── hello-appimage-runtime.c │ │ ├── kubuntu-14.04.1-desktop-amd64_truncated.iso │ │ ├── libdummy.a │ │ ├── one_toplevel_folder.7z │ │ ├── one_toplevel_folder.arj │ │ ├── one_toplevel_folder.zip │ │ ├── simplearchive.tar.Z │ │ ├── simplearchive.tar.bz2 │ │ ├── simplearchive.tar.gz │ │ ├── simplearchive.tar.lrz │ │ ├── simplearchive.tar.lz │ │ ├── simplearchive.tar.lz4 │ │ ├── simplearchive.tar.lzma │ │ ├── simplearchive.tar.lzo │ │ ├── simplearchive.tar.xz │ │ ├── simplearchive.tar.zst │ │ ├── simplearchive.xar │ │ ├── single-empty-folder.zip │ │ ├── smallarchive.deb │ │ ├── tar-v7.tar │ │ ├── test%dir │ │ │ ├── testfile1.txt │ │ │ └── testfile2.txt │ │ ├── test-3.4.0 │ │ │ └── testfile1.txt │ │ ├── test.7z │ │ ├── test.arj │ │ ├── test.odt │ │ ├── test.png.lzma │ │ ├── test.png.lzo │ │ ├── test.rar │ │ ├── test.sit │ │ ├── test.svgz │ │ ├── test.tar.bz2 │ │ ├── test.txt.bz2 │ │ ├── test.txt.gz │ │ ├── test.txt.lrz │ │ ├── test.txt.lz4 │ │ ├── test.txt.zst │ │ ├── test.z │ │ ├── test.zip │ │ ├── test.zz │ │ ├── test_encrypted.arj │ │ ├── test_permissions.7z │ │ ├── test_permissions.rar │ │ ├── test_permissions.tar.bz2 │ │ ├── test_permissions.zip │ │ ├── testdir │ │ │ ├── testfile1.txt │ │ │ └── testfile2.txt │ │ ├── testdir2 │ │ │ └── testdir │ │ │ │ ├── testfile1.txt │ │ │ │ └── testfile2.txt │ │ ├── testdirwithemptysubdir │ │ │ ├── testfile1.txt │ │ │ └── testfile2.txt │ │ ├── testdirwithemptysubdir_1.rar │ │ ├── testdirwithsubdirs │ │ │ ├── subdir1 │ │ │ │ ├── subdir2 │ │ │ │ │ ├── subdir3 │ │ │ │ │ │ └── testfile4.txt │ │ │ │ │ └── testfile3.txt │ │ │ │ └── testfile2.txt │ │ │ └── testfile1.txt │ │ ├── testfile.md │ │ ├── testfile.txt │ │ ├── textfile1.txt │ │ ├── textfile2.txt │ │ ├── wget-download.tar.gz.1 │ │ ├── wget.rpm │ │ └── zip_with_wrong_extension.rar │ ├── deletetest.cpp │ ├── extracttest.cpp │ ├── jobstest.cpp │ ├── jsonarchiveinterface.cpp │ ├── jsonarchiveinterface.h │ ├── jsonparser.cpp │ ├── jsonparser.h │ ├── loadtest.cpp │ ├── metadatatest.cpp │ ├── mimetypetest.cpp │ ├── movetest.cpp │ └── preservemetadatatest.cpp ├── plugins │ ├── CMakeLists.txt │ ├── cli7zplugin │ │ ├── CMakeLists.txt │ │ ├── cli7ztest.cpp │ │ ├── cli7ztest.h │ │ └── data │ │ │ ├── RDA-attributes.zip │ │ │ ├── archive-encrypted-1509.txt │ │ │ ├── archive-encrypted-1514.txt │ │ │ ├── archive-encrypted-1602.txt │ │ │ ├── archive-encrypted-9381.txt │ │ │ ├── archive-multivol-1602.txt │ │ │ ├── archive-multivolume.7z.001 │ │ │ ├── archive-multivolume.7z.002 │ │ │ ├── archive-multivolume.7z.003 │ │ │ ├── archive-with-symlink-1509.txt │ │ │ ├── archive-with-symlink-1514.txt │ │ │ ├── archive-with-symlink-1602.txt │ │ │ ├── archive-with-symlink-9381.txt │ │ │ ├── archive-zip-AES256-1602.txt │ │ │ └── one_toplevel_folder.7z │ ├── cliarjplugin │ │ ├── CMakeLists.txt │ │ ├── cliarjtest.cpp │ │ └── cliarjtest.h │ ├── clirarplugin │ │ ├── CMakeLists.txt │ │ ├── clirartest.cpp │ │ ├── clirartest.h │ │ └── data │ │ │ ├── archive-RARv5-unrar3.txt │ │ │ ├── archive-RARv5-unrar4.txt │ │ │ ├── archive-RARv5-unrar5.txt │ │ │ ├── archive-corrupt-file-header-unrar3.txt │ │ │ ├── archive-corrupt-file-header-unrar4.txt │ │ │ ├── archive-corrupt-file-header-unrar5.txt │ │ │ ├── archive-encrypted-unrar4.txt │ │ │ ├── archive-encrypted-unrar5.txt │ │ │ ├── archive-multivol-unrar4.txt │ │ │ ├── archive-multivol-unrar5.txt │ │ │ ├── archive-recovery-record-unrar4.txt │ │ │ ├── archive-recovery-record-unrar5.txt │ │ │ ├── archive-with-symlink-unrar4.txt │ │ │ ├── archive-with-symlink-unrar5.txt │ │ │ ├── locked_archive.rar │ │ │ └── one_toplevel_folder.rar │ ├── cliunarchiverplugin │ │ ├── CMakeLists.txt │ │ ├── cliunarchivertest.cpp │ │ ├── cliunarchivertest.h │ │ └── data │ │ │ ├── README │ │ │ ├── empty_folders.rar │ │ │ ├── encrypted_entries.json │ │ │ ├── encrypted_entries.rar │ │ │ ├── hidden_files.rar │ │ │ ├── huge_archive.json │ │ │ ├── multiple_toplevel_entries.json │ │ │ ├── multiple_toplevel_entries.lha │ │ │ ├── multiple_toplevel_entries.rar │ │ │ ├── one_toplevel_folder.json │ │ │ ├── one_toplevel_folder.lha │ │ │ ├── one_toplevel_folder.rar │ │ │ └── test.sit │ └── clizipplugin │ │ ├── CMakeLists.txt │ │ ├── cliziptest.cpp │ │ └── cliziptest.h └── testhelper │ ├── CMakeLists.txt │ ├── abstractaddtest.cpp │ ├── abstractaddtest.h │ ├── testhelper.cpp │ └── testhelper.h ├── cmake └── modules │ └── FindLibZip.cmake ├── config.h.in ├── doc ├── CMakeLists.txt ├── ark-comment.png ├── ark-mainwindow.png ├── create-archive.png ├── create-protected-archive.png ├── extract-dialog.png ├── index.docbook └── man-ark.1.docbook ├── kerfuffle ├── CMakeLists.txt ├── adddialog.cpp ├── adddialog.h ├── adddialog.ui ├── addtoarchive.cpp ├── addtoarchive.h ├── archive_kerfuffle.cpp ├── archive_kerfuffle.h ├── archiveentry.cpp ├── archiveentry.h ├── archiveformat.cpp ├── archiveformat.h ├── archiveinterface.cpp ├── archiveinterface.h ├── ark.kcfg ├── cliinterface.cpp ├── cliinterface.h ├── cliproperties.cpp ├── cliproperties.h ├── compressionoptionswidget.cpp ├── compressionoptionswidget.h ├── compressionoptionswidget.ui ├── createdialog.cpp ├── createdialog.h ├── createdialog.ui ├── extractiondialog.cpp ├── extractiondialog.h ├── extractiondialog.ui ├── extractionsettingspage.cpp ├── extractionsettingspage.h ├── extractionsettingspage.ui ├── generalsettingspage.cpp ├── generalsettingspage.h ├── generalsettingspage.ui ├── jobs.cpp ├── jobs.h ├── metadatabackup.cpp ├── metadatabackup.h ├── mimetypes.cpp ├── mimetypes.h ├── options.cpp ├── options.h ├── plugin.cpp ├── plugin.h ├── pluginmanager.cpp ├── pluginmanager.h ├── pluginsettingspage.cpp ├── pluginsettingspage.h ├── pluginsettingspage.ui ├── previewsettingspage.cpp ├── previewsettingspage.h ├── previewsettingspage.ui ├── propertiesdialog.cpp ├── propertiesdialog.h ├── propertiesdialog.ui ├── qstringtokenizer.cpp ├── qstringtokenizer.h ├── queries.cpp ├── queries.h ├── settings.kcfgc ├── settingsdialog.cpp ├── settingsdialog.h ├── settingspage.cpp ├── settingspage.h ├── util.h └── windows_stat.h ├── logo.png ├── part ├── CMakeLists.txt ├── archivemodel.cpp ├── archivemodel.h ├── archivesortfiltermodel.cpp ├── archivesortfiltermodel.h ├── archiveview.cpp ├── archiveview.h ├── ark_part.desktop.cmake ├── ark_part.json.cmake ├── ark_part.rc ├── ark_viewer.rc ├── arkpart.qrc ├── arkviewer.cpp ├── arkviewer.h ├── arkviewer.ui ├── dnddbusinterface.xml ├── factory.cpp ├── factory.h ├── infopanel.cpp ├── infopanel.h ├── infopanel.ui ├── interface.h ├── jobtracker.cpp ├── jobtracker.h ├── jobtracker.ui ├── overwritedialog.cpp ├── overwritedialog.h ├── part.cpp └── part.h ├── plugins ├── CLI-README ├── CMakeLists.txt ├── cli7zplugin │ ├── CMakeLists.txt │ ├── cliplugin.cpp │ ├── cliplugin.h │ └── kerfuffle_cli7z.json.cmake ├── cliarjplugin │ ├── CMakeLists.txt │ ├── cliplugin.cpp │ ├── cliplugin.h │ └── kerfuffle_cliarj.json.cmake ├── cliplugin-example │ ├── CMakeLists.txt │ ├── cliplugin.cpp │ ├── cliplugin.h │ └── kerfuffle_cli.json_TEMPLATE ├── clirarplugin │ ├── CMakeLists.txt │ ├── cliplugin.cpp │ ├── cliplugin.h │ └── kerfuffle_clirar.json.cmake ├── cliunarchiverplugin │ ├── CMakeLists.txt │ ├── cliplugin.cpp │ ├── cliplugin.h │ └── kerfuffle_cliunarchiver.json.cmake ├── clizipplugin │ ├── CMakeLists.txt │ ├── cliplugin.cpp │ ├── cliplugin.h │ └── kerfuffle_clizip.json.cmake ├── libarchive │ ├── CMakeLists.txt │ ├── kerfuffle_libarchive.json.cmake │ ├── kerfuffle_libarchive_readonly.json.cmake │ ├── libarchiveplugin.cpp │ ├── libarchiveplugin.h │ ├── readonlylibarchiveplugin.cpp │ ├── readonlylibarchiveplugin.h │ ├── readwritelibarchiveplugin.cpp │ └── readwritelibarchiveplugin.h └── libzipplugin │ ├── .test_chrono_cast.cpp │ ├── CMakeLists.txt │ ├── kerfuffle_libzip.json.cmake │ ├── libzipplugin.cpp │ └── libzipplugin.h ├── po ├── af │ └── ark.po ├── ar │ └── ark.po ├── ast │ └── ark.po ├── az │ └── ark.po ├── be │ └── ark.po ├── bg │ └── ark.po ├── br │ └── ark.po ├── bs │ └── ark.po ├── ca │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── ca@valencia │ └── ark.po ├── cs │ └── ark.po ├── cy │ └── ark.po ├── da │ └── ark.po ├── de │ ├── ark.po │ └── docs │ │ └── ark │ │ └── ark-mainwindow.png ├── el │ └── ark.po ├── en_GB │ └── ark.po ├── eo │ └── ark.po ├── es │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── et │ ├── ark.po │ └── docs │ │ └── ark │ │ └── index.docbook ├── eu │ └── ark.po ├── fa │ └── ark.po ├── fi │ └── ark.po ├── fr │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── ark-mainwindow.png │ │ └── man-ark.1.docbook ├── ga │ └── ark.po ├── gl │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── he │ └── ark.po ├── hi │ └── ark.po ├── hne │ └── ark.po ├── hr │ └── ark.po ├── hu │ └── ark.po ├── ia │ └── ark.po ├── id │ └── ark.po ├── ie │ └── ark.po ├── is │ └── ark.po ├── it │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── ark-comment.png │ │ ├── ark-mainwindow.png │ │ ├── create-archive.png │ │ ├── create-protected-archive.png │ │ ├── extract-dialog.png │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── ja │ └── ark.po ├── ka │ └── ark.po ├── kk │ └── ark.po ├── km │ └── ark.po ├── ko │ └── ark.po ├── ku │ └── ark.po ├── lt │ └── ark.po ├── lv │ └── ark.po ├── mk │ └── ark.po ├── mr │ └── ark.po ├── ms │ └── ark.po ├── nb │ └── ark.po ├── nds │ └── ark.po ├── ne │ └── ark.po ├── nl │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── nn │ └── ark.po ├── oc │ └── ark.po ├── pa │ └── ark.po ├── pl │ ├── ark.po │ └── docs │ │ └── ark │ │ └── index.docbook ├── pt │ ├── ark.po │ └── docs │ │ └── ark │ │ └── index.docbook ├── pt_BR │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── ark-mainwindow.png │ │ ├── create-protected-archive.png │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── ro │ └── ark.po ├── ru │ ├── ark.po │ └── docs │ │ └── ark │ │ └── index.docbook ├── sa │ └── ark.po ├── se │ └── ark.po ├── sk │ └── ark.po ├── sl │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── sq │ └── ark.po ├── sr │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── index.docbook │ │ ├── l10n-track │ │ └── man-ark.1.docbook ├── sr@ijekavian │ └── ark.po ├── sr@ijekavianlatin │ └── ark.po ├── sr@latin │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── sv │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── ta │ └── ark.po ├── tg │ └── ark.po ├── th │ └── ark.po ├── tr │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── ug │ └── ark.po ├── uk │ ├── ark.po │ └── docs │ │ └── ark │ │ ├── ark-comment.png │ │ ├── ark-mainwindow.png │ │ ├── create-archive.png │ │ ├── create-protected-archive.png │ │ ├── extract-dialog.png │ │ ├── index.docbook │ │ └── man-ark.1.docbook ├── uz │ └── ark.po ├── uz@cyrillic │ └── ark.po ├── xh │ └── ark.po ├── zh_CN │ └── ark.po ├── zh_HK │ └── ark.po └── zh_TW │ └── ark.po └── snapcraft.yaml /.craft.ini: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | [BlueprintSettings] 5 | kde/kdeutils/ark.packageAppx=True -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: CC0-1.0 2 | # SPDX-FileCopyrightText: none 3 | # Ignore the following files 4 | *~ 5 | *.[oa] 6 | *.diff 7 | *.kate-swp 8 | *.kdev4 9 | .kdev_include_paths 10 | *.kdevelop.pcs 11 | *.moc 12 | *.moc.cpp 13 | *.orig 14 | *.user 15 | .*.swp 16 | .swp.* 17 | Doxyfile 18 | Makefile 19 | avail 20 | random_seed 21 | /build*/ 22 | CMakeLists.txt.user* 23 | *.unc-backup* 24 | .cmake/ 25 | /.clang-format 26 | /compile_commands.json 27 | .clangd 28 | .cache 29 | .idea 30 | /cmake-build* 31 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | include: 5 | - project: sysadmin/ci-utilities 6 | file: 7 | - /gitlab-templates/clang-format.yml 8 | - /gitlab-templates/linux-qt6.yml 9 | - /gitlab-templates/linux-qt6-next.yml 10 | - /gitlab-templates/freebsd-qt6.yml 11 | - /gitlab-templates/windows-qt6.yml 12 | - /gitlab-templates/flatpak.yml 13 | - /gitlab-templates/craft-windows-x86-64-qt6.yml 14 | - /gitlab-templates/craft-windows-appx-qt6.yml 15 | - /gitlab-templates/xml-lint.yml 16 | - /gitlab-templates/yaml-lint.yml 17 | -------------------------------------------------------------------------------- /.kde-ci.yml: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: None 2 | # SPDX-License-Identifier: CC0-1.0 3 | 4 | Dependencies: 5 | - 'on': ['Linux', 'FreeBSD', 'Windows'] 6 | 'require': 7 | 'frameworks/extra-cmake-modules': '@latest-kf6' 8 | 'frameworks/kcoreaddons': '@latest-kf6' 9 | 'frameworks/kconfig': '@latest-kf6' 10 | 'frameworks/ki18n': '@latest-kf6' 11 | 'frameworks/karchive': '@latest-kf6' 12 | 'frameworks/kcrash': '@latest-kf6' 13 | 'frameworks/kdbusaddons': '@latest-kf6' 14 | 'frameworks/kdoctools': '@latest-kf6' 15 | 'frameworks/kio': '@latest-kf6' 16 | 'frameworks/kservice': '@latest-kf6' 17 | 'frameworks/kparts': '@latest-kf6' 18 | 'frameworks/kwidgetsaddons': '@latest-kf6' 19 | 'frameworks/kwindowsystem': '@latest-kf6' 20 | 'frameworks/kiconthemes': '@latest-kf6' 21 | 'frameworks/kfilemetadata': '@latest-kf6' 22 | 23 | - 'on': ['Linux', 'FreeBSD'] 24 | 'require': 25 | 'frameworks/kpty': '@latest-kf6' 26 | 27 | Options: 28 | require-passing-tests-on: ['Linux', 'FreeBSD'] 29 | clang-format-versions: [15, 18] 30 | -------------------------------------------------------------------------------- /.krazy: -------------------------------------------------------------------------------- 1 | SKIP /autotests/kerfuffle/data/hello-appimage-runtime.c 2 | 3 | -------------------------------------------------------------------------------- /LICENSES/BSD-2-Clause.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, 4 | are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, 7 | this list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 17 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 22 | USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /LICENSES/MIT.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 18 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 20 | OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Mainpage.dox: -------------------------------------------------------------------------------- 1 | /** @mainpage ark 2 | 3 | The ark application 4 | 5 | */ 6 | 7 | // DOXYGEN_REFERENCES = kdecore 8 | // DOXYGEN_SET_PROJECT_NAME = ark 9 | -------------------------------------------------------------------------------- /Messages.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | $EXTRACTRC $(find . -name '*.rc') >> rc.cpp || exit 11 3 | $EXTRACTRC $(find . -name '*.ui') >> rc.cpp || exit 12 4 | $EXTRACTRC $(find . -name '*.kcfg') >> rc.cpp 5 | $XGETTEXT $(find app kerfuffle part plugins -name '*.cpp') rc.cpp -o $podir/ark.pot 6 | rm -f rc.cpp 7 | -------------------------------------------------------------------------------- /README.packagers: -------------------------------------------------------------------------------- 1 | OPTIONAL RUNTIME DEPENDENCIES 2 | 3 | Ark has a plugin-based architecture in order to support many archive formats. 4 | The only required plugin is the libarchive plugin (which is why libarchive is a required build-time dependency of Ark). 5 | 6 | The other plugins are optional. They are built by default, but each of them requires one or more runtime dependencies, i.e. they won't work if they don't find the CLI executable(s) they rely on. 7 | 8 | The following is a list of these optional executables. Some of them are marked as RECOMMENDED, as Ark won't be able to (properly) handle popular formats without them. 9 | 10 | * unzip, zipinfo: to open and extract zip archives 11 | * zip: to create and edit zip archives 12 | * 7z: to open/extract/create/edit 7z and zip archives [RECOMMENDED, free] 13 | * unrar: to open and extract rar archives [RECOMMENDED, non-free] 14 | * rar: to create and edit rar archives 15 | * lsar, unar: to open and extract rar archives [RECOMMENDED, free] 16 | * lrzip: to open and extract lrzip archives 17 | * lzop: to open and extract tar.lzo archives if libarchive >= 3.3 has been compiled without liblzo2 support. 18 | 19 | OPTIONAL BUILD-TIME DEPENDENCIES 20 | 21 | * libzip (>= 1.2.0): for .zip files [RECOMMENDED] 22 | * zlib: for .gz files 23 | * bzip2: for .bz2 files 24 | * liblzma/xz: for .xz files 25 | 26 | -------------------------------------------------------------------------------- /REUSE.toml: -------------------------------------------------------------------------------- 1 | version = 1 2 | SPDX-PackageName = "ark" 3 | SPDX-PackageSupplier = "Elvis Angelaccio " 4 | SPDX-PackageDownloadLocation = "https://invent.kde.org/utilities/ark" 5 | 6 | [[annotations]] 7 | path = "app/icons/**" 8 | precedence = "aggregate" 9 | SPDX-FileCopyrightText = "KDE Community" 10 | SPDX-License-Identifier = "LGPL-3.0-only" 11 | -------------------------------------------------------------------------------- /app/MacOSXBundleInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrincipalClass 6 | NSApplication 7 | NSHighResolutionCapable 8 | True 9 | CFBundleDevelopmentRegion 10 | English 11 | CFBundleExecutable 12 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 13 | CFBundleGetInfoString 14 | ${MACOSX_BUNDLE_INFO_STRING} 15 | CFBundleIconFile 16 | ${MACOSX_BUNDLE_ICON_FILE} 17 | CFBundleIdentifier 18 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 19 | CFBundleInfoDictionaryVersion 20 | 6.0 21 | CFBundleLongVersionString 22 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 23 | CFBundleName 24 | ${MACOSX_BUNDLE_BUNDLE_NAME} 25 | CFBundlePackageType 26 | APPL 27 | CFBundleShortVersionString 28 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 29 | CFBundleSignature 30 | ???? 31 | CFBundleVersion 32 | ${MACOSX_BUNDLE_BUNDLE_VERSION} 33 | CSResourcesFileMapped 34 | 35 | LSRequiresCarbon 36 | 37 | NSHumanReadableCopyright 38 | ${MACOSX_BUNDLE_COPYRIGHT} 39 | LSMultipleInstancesProhibited 40 | 41 | CFBundleDocumentTypes 42 | 43 | 44 | CFBundleTypeExtensions 45 | 46 | * 47 | 48 | CFBundleTypeName 49 | NSStringPboardType 50 | CFBundleTypeRole 51 | Editor 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /app/ark.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | icons/sc-apps-ark.svgz 4 | 5 | 6 | arkui.rc 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/ark_dndextract.json.cmake: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "MimeTypes": [ 4 | "@SUPPORTED_ARK_MIMETYPES_JSON@" 5 | ], 6 | "Name": "Ark Extract Here", 7 | "Name[ar]": "أرك استخرج هنا", 8 | "Name[ast]": "«Estrayer equí» d'Ark", 9 | "Name[az]": "Buraya çıxarın", 10 | "Name[be]": "Распакаваць сюды з дапамогай Ark", 11 | "Name[bg]": "Извличане с Ark тук", 12 | "Name[ca@valencia]": "Extracció d'Ark ací", 13 | "Name[ca]": "Extracció de l'Ark aquí", 14 | "Name[cs]": "Rozbalit Arkem sem", 15 | "Name[da]": "Pak ud med Ark her", 16 | "Name[de]": "Ark hierher entpacken", 17 | "Name[el]": "Ark Εξαγωγή Εδώ", 18 | "Name[en_GB]": "Ark Extract Here", 19 | "Name[eo]": "Ark-Extrakti ĉi tie", 20 | "Name[es]": "Ark - Extraer aquí", 21 | "Name[eu]": "Ark Erauzi hemen", 22 | "Name[fi]": "Ark: pura tähän", 23 | "Name[fr]": "Extraire ici avec Ark", 24 | "Name[gl]": "Extraer aquí con Ark", 25 | "Name[he]": "חילוץ עם Ark לכאן", 26 | "Name[hu]": "Kibontás ide", 27 | "Name[ia]": "Ark Extrahe Hic", 28 | "Name[ie]": "Extraer a ci (Ark)", 29 | "Name[is]": "Ark afþjappa hingað", 30 | "Name[it]": "Ark estrai qui", 31 | "Name[ja]": "Ark で展開", 32 | "Name[ka]": "Ark აქ გაშლა", 33 | "Name[ko]": "Ark 여기에 압축 풀기", 34 | "Name[lt]": "Ark išpakuoti čia", 35 | "Name[lv]": "„Ark“ izvilkt te", 36 | "Name[nl]": "Ark: hier uitpakken", 37 | "Name[nn]": "Pakk ut med Ark her", 38 | "Name[pa]": "ਆਕ ਇ਼ੱਥੇ ਖਿਲਾਰੋ", 39 | "Name[pl]": "Wypakuj tutaj", 40 | "Name[pt]": "Ark - Extrair Aqui", 41 | "Name[pt_BR]": "Extrair com o Ark aqui", 42 | "Name[ro]": "Ark Extrage aici", 43 | "Name[ru]": "Распаковать в эту папку", 44 | "Name[sa]": "सन्दूकः अर्कः अत्र", 45 | "Name[sk]": "Extrahovať sem Arkom", 46 | "Name[sl]": "Arkov ekstrakt tukaj", 47 | "Name[sv]": "Ark packa upp här", 48 | "Name[tr]": "Ark Buraya Çıkar", 49 | "Name[uk]": "Розпакувати сюди за допомогою Ark", 50 | "Name[x-test]": "xxArk Extract Herexx", 51 | "Name[zh_CN]": "Ark 解压到此位置", 52 | "Name[zh_TW]": "Ark 在此解壓縮" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/arkrc: -------------------------------------------------------------------------------- 1 | [MainWindow] 2 | MenuBar=Disabled 3 | -------------------------------------------------------------------------------- /app/arkui.rc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | &Archive 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/compressfileitemaction.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | SPDX-FileCopyrightText: 2021 Alexander Lohnau 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef COMPRESSFILEITEMACTION_H 9 | #define COMPRESSFILEITEMACTION_H 10 | 11 | #include 12 | #include 13 | 14 | class QAction; 15 | class QWidget; 16 | 17 | namespace Kerfuffle 18 | { 19 | class PluginManager; 20 | } 21 | 22 | class CompressFileItemAction : public KAbstractFileItemActionPlugin 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | CompressFileItemAction(QObject *parent, const QVariantList &args); 28 | 29 | QList actions(const KFileItemListProperties &fileItemInfos, QWidget *parentWidget) override; 30 | 31 | private: 32 | QAction *createAction(const QIcon &icon, QWidget *parent, const QList &urls, const QString &fileExtension); 33 | 34 | Kerfuffle::PluginManager *m_pluginManager; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /app/extractHereDndPlugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2009 Harald Hvaal 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "extractHereDndPlugin.h" 8 | #include "archive_kerfuffle.h" 9 | #include "ark_debug.h" 10 | #include "batchextract.h" 11 | #include "pluginmanager.h" 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | K_PLUGIN_CLASS_WITH_JSON(ExtractHereDndPlugin, "ark_dndextract.json") 20 | 21 | void ExtractHereDndPlugin::slotTriggered() 22 | { 23 | qCDebug(ARK_LOG) << "Preparing job"; 24 | BatchExtract *batchJob = new BatchExtract(); 25 | 26 | batchJob->setAutoSubfolder(true); 27 | batchJob->setDestinationFolder(m_dest.toDisplayString(QUrl::PreferLocalFile)); 28 | batchJob->setPreservePaths(true); 29 | for (const QUrl &url : std::as_const(m_urls)) { 30 | batchJob->addInput(url); 31 | } 32 | 33 | qCDebug(ARK_LOG) << "Starting job"; 34 | batchJob->start(); 35 | } 36 | 37 | ExtractHereDndPlugin::ExtractHereDndPlugin(QObject *parent, const QVariantList &) 38 | : KIO::DndPopupMenuPlugin(parent) 39 | { 40 | } 41 | 42 | QList ExtractHereDndPlugin::setup(const KFileItemListProperties &popupMenuInfo, const QUrl &destination) 43 | { 44 | QList actionList; 45 | 46 | Kerfuffle::PluginManager pluginManager; 47 | if (!pluginManager.supportedMimeTypes().contains(popupMenuInfo.mimeType())) { 48 | qCDebug(ARK_LOG) << popupMenuInfo.mimeType() << "is not a supported mimetype"; 49 | return actionList; 50 | } 51 | 52 | qCDebug(ARK_LOG) << "Plugin executed"; 53 | 54 | const QString extractHereMessage = i18nc("@action:inmenu Context menu shown when an archive is being drag'n'dropped", "Extract here"); 55 | 56 | QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("archive-extract")), extractHereMessage, nullptr); 57 | connect(action, &QAction::triggered, this, &ExtractHereDndPlugin::slotTriggered); 58 | 59 | actionList.append(action); 60 | m_dest = destination; 61 | m_urls = popupMenuInfo.urlList(); 62 | 63 | return actionList; 64 | } 65 | 66 | #include "extractHereDndPlugin.moc" 67 | #include "moc_extractHereDndPlugin.cpp" 68 | -------------------------------------------------------------------------------- /app/extractHereDndPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2009 Harald Hvaal 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef EXTRACTHEREDNDPLUGIN_H 8 | #define EXTRACTHEREDNDPLUGIN_H 9 | 10 | #include 11 | 12 | #include 13 | 14 | class ExtractHereDndPlugin : public KIO::DndPopupMenuPlugin 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void slotTriggered(); 20 | 21 | public: 22 | ExtractHereDndPlugin(QObject *parent, const QVariantList &); 23 | 24 | QList setup(const KFileItemListProperties &popupMenuInfo, const QUrl &destination) override; 25 | 26 | private: 27 | QUrl m_dest; 28 | QList m_urls; 29 | }; 30 | 31 | #endif /* EXTRACTHEREDNDPLUGIN_H */ 32 | -------------------------------------------------------------------------------- /app/extractfileitemaction.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | SPDX-FileCopyrightText: 2021 Alexander Lohnau 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef EXTRACTFILEITEMACTION_H 9 | #define EXTRACTFILEITEMACTION_H 10 | 11 | #include 12 | #include 13 | 14 | class QAction; 15 | class QWidget; 16 | 17 | namespace Kerfuffle 18 | { 19 | class PluginManager; 20 | } 21 | 22 | class ExtractFileItemAction : public KAbstractFileItemActionPlugin 23 | { 24 | Q_OBJECT 25 | 26 | public: 27 | ExtractFileItemAction(QObject *parent, const QVariantList &args); 28 | 29 | QList actions(const KFileItemListProperties &fileItemInfos, QWidget *parentWidget) override; 30 | 31 | private: 32 | enum AdditionalJobOptions { 33 | None, 34 | ShowDialog, 35 | AutoDelete, 36 | }; 37 | QAction *createAction(const QIcon &icon, const QString &name, QWidget *parent, const QList &urls, AdditionalJobOptions option); 38 | 39 | Kerfuffle::PluginManager *m_pluginManager; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /app/icons/128-apps-ark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/app/icons/128-apps-ark.png -------------------------------------------------------------------------------- /app/icons/48-apps-ark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/app/icons/48-apps-ark.png -------------------------------------------------------------------------------- /app/icons/64-apps-ark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/app/icons/64-apps-ark.png -------------------------------------------------------------------------------- /app/icons/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ECMInstallIcons) 2 | 3 | ecm_install_icons(ICONS 48-apps-ark.png 64-apps-ark.png 128-apps-ark.png sc-apps-ark.svgz DESTINATION ${KDE_INSTALL_ICONDIR}) 4 | -------------------------------------------------------------------------------- /app/icons/sc-apps-ark.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/app/icons/sc-apps-ark.svgz -------------------------------------------------------------------------------- /app/mainwindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Henrique Pinto 3 | SPDX-FileCopyrightText: 2008 Harald Hvaal 4 | SPDX-FileCopyrightText: 2021 Jiří Wolker 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | #ifndef MAINWINDOW_H 9 | #define MAINWINDOW_H 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #include "welcomeview/welcomeview.h" 16 | 17 | namespace KParts 18 | { 19 | class ReadWritePart; 20 | } 21 | 22 | class KRecentFilesMenu; 23 | class Sidebar; 24 | 25 | class MainWindow : public KParts::MainWindow 26 | { 27 | Q_OBJECT 28 | public: 29 | explicit MainWindow(QWidget *parent = nullptr); 30 | ~MainWindow() override; 31 | 32 | bool loadPart(); 33 | KRecentFilesMenu *recentFilesMenu() const; 34 | 35 | void dragEnterEvent(class QDragEnterEvent *event) override; 36 | void dropEvent(class QDropEvent *event) override; 37 | void dragMoveEvent(class QDragMoveEvent *event) override; 38 | 39 | public Q_SLOTS: 40 | void openUrl(const QUrl &url); 41 | void setShowExtractDialog(bool); 42 | 43 | void showWelcomeScreen(); 44 | void hideWelcomeScreen(); 45 | 46 | protected: 47 | void closeEvent(QCloseEvent *event) override; 48 | QSize sizeHint() const override; 49 | 50 | private Q_SLOTS: 51 | void updateActions(); 52 | void newArchive(); 53 | void openArchive(); 54 | void quit(); 55 | void showSettings(); 56 | void writeSettings(); 57 | void addPartUrl(); 58 | 59 | private: 60 | void setupActions(); 61 | void updateHamburgerMenu(); 62 | 63 | KParts::ReadWritePart *m_part; 64 | KRecentFilesMenu *m_recentFilesMenu; 65 | QAction *m_openAction; 66 | QAction *m_newAction; 67 | KParts::OpenUrlArguments m_openArgs; 68 | WelcomeView *m_welcomeView; 69 | QStackedWidget *m_windowContents; 70 | Sidebar *m_sidebar = nullptr; 71 | QAction *m_showSidebarAction = nullptr; 72 | QAction *m_lockSidebarAction = nullptr; 73 | }; 74 | 75 | #endif // MAINWINDOW_H 76 | -------------------------------------------------------------------------------- /app/welcomeview/recentfilesmodel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2022 Jiří Wolker 3 | SPDX-FileCopyrightText: 2022 Eugene Popov 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #include "recentfilesmodel.h" 9 | 10 | #include 11 | #include 12 | 13 | RecentFilesModel::RecentFilesModel(QObject *parent) 14 | : QAbstractListModel(parent) 15 | { 16 | } 17 | 18 | QVariant RecentFilesModel::data(const QModelIndex &index, int role) const 19 | { 20 | if (index.isValid()) { 21 | const int row = index.row(); 22 | if (row >= 0 && row < m_recentFiles.count()) { 23 | const RecentFileInfo &recentFile = m_recentFiles.at(row); 24 | switch (role) { 25 | case Qt::DisplayRole: 26 | return recentFile.name; 27 | case Qt::DecorationRole: 28 | return recentFile.icon; 29 | case Qt::ToolTipRole: 30 | return recentFile.url.toString(QUrl::PreferLocalFile); 31 | default: 32 | break; 33 | } 34 | } 35 | } 36 | 37 | return QVariant(); 38 | } 39 | 40 | int RecentFilesModel::rowCount(const QModelIndex &parent) const 41 | { 42 | Q_UNUSED(parent); 43 | 44 | return m_recentFiles.count(); 45 | } 46 | 47 | void RecentFilesModel::refresh(const QList &urls) 48 | { 49 | QList recentFiles; 50 | recentFiles.reserve(urls.count()); 51 | 52 | QIcon icon; 53 | QString name; 54 | for (const QUrl &url : urls) { 55 | if (url.isLocalFile()) { 56 | const QFileInfo fileInfo(url.toLocalFile()); 57 | icon = QIcon::fromTheme(QMimeDatabase().mimeTypeForFile(fileInfo).iconName()); 58 | name = fileInfo.fileName(); 59 | } else { 60 | icon = QIcon::fromTheme(QStringLiteral("network-server")); 61 | name = url.toString(); 62 | } 63 | 64 | recentFiles.append({icon, name, url}); 65 | } 66 | 67 | beginResetModel(); 68 | m_recentFiles = std::move(recentFiles); 69 | endResetModel(); 70 | } 71 | 72 | QUrl RecentFilesModel::url(const QModelIndex &index) const 73 | { 74 | if (index.isValid()) { 75 | const int row = index.row(); 76 | if (row >= 0 && row < m_recentFiles.count()) { 77 | return m_recentFiles.at(row).url; 78 | } 79 | } 80 | 81 | return QUrl(); 82 | } 83 | 84 | #include "moc_recentfilesmodel.cpp" 85 | -------------------------------------------------------------------------------- /app/welcomeview/recentfilesmodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2022 Jiří Wolker 3 | SPDX-FileCopyrightText: 2022 Eugene Popov 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef RECENTFILESMODEL_H 9 | #define RECENTFILESMODEL_H 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | class RecentFilesModel : public QAbstractListModel 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit RecentFilesModel(QObject *parent = nullptr); 21 | 22 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 23 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; 24 | 25 | void refresh(const QList &urls); 26 | QUrl url(const QModelIndex &index) const; 27 | 28 | private: 29 | struct RecentFileInfo { 30 | QIcon icon; 31 | QString name; 32 | QUrl url; 33 | }; 34 | 35 | QList m_recentFiles; 36 | }; 37 | 38 | #endif // RECENTFILESMODEL_H 39 | -------------------------------------------------------------------------------- /app/welcomeview/welcomeview.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2022 Jiří Wolker 3 | SPDX-FileCopyrightText: 2022 Eugene Popov 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef WELCOMEVIEW_H 9 | #define WELCOMEVIEW_H 10 | 11 | #include "ui_welcomeview.h" 12 | 13 | class MainWindow; 14 | class Placeholder; 15 | class RecentFilesModel; 16 | 17 | class WelcomeView : public QScrollArea, Ui::WelcomeView 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | explicit WelcomeView(MainWindow *mainWindow, QWidget *parent = nullptr); 23 | 24 | protected: 25 | bool event(QEvent *event) override; 26 | void resizeEvent(QResizeEvent *event) override; 27 | 28 | private Q_SLOTS: 29 | void onRecentFilesContextMenuRequested(const QPoint &pos); 30 | 31 | private: 32 | void updateButtons(); 33 | void updateFonts(); 34 | bool updateLayout(); 35 | 36 | MainWindow *m_mainWindow = nullptr; 37 | RecentFilesModel *m_recentFilesModel = nullptr; 38 | Placeholder *m_placeholderRecentFiles = nullptr; 39 | }; 40 | 41 | #endif // WELCOMEVIEW_H 42 | -------------------------------------------------------------------------------- /autotests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ECMAddTests) 2 | 3 | add_subdirectory(app) 4 | add_subdirectory(testhelper) 5 | add_subdirectory(kerfuffle) 6 | add_subdirectory(plugins) 7 | -------------------------------------------------------------------------------- /autotests/app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${CMAKE_SOURCE_DIR}/app) 2 | 3 | ecm_add_test( 4 | batchextracttest.cpp 5 | ${CMAKE_SOURCE_DIR}/app/batchextract.cpp 6 | ${CMAKE_BINARY_DIR}/app/ark_debug.cpp 7 | LINK_LIBRARIES Qt::Test KF6::KIOFileWidgets kerfuffle 8 | TEST_NAME batchextracttest 9 | NAME_PREFIX app-) 10 | -------------------------------------------------------------------------------- /autotests/app/data/simple%archive.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/app/data/simple%archive.tar.gz -------------------------------------------------------------------------------- /autotests/app/data/test.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/app/data/test.txt.gz -------------------------------------------------------------------------------- /autotests/kerfuffle/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 2 | 3 | set(JSONINTERFACE_SOURCES 4 | jsonarchiveinterface.cpp 5 | jsonparser.cpp 6 | ) 7 | add_library(jsoninterface STATIC ${JSONINTERFACE_SOURCES}) 8 | target_link_libraries(jsoninterface kerfuffle) 9 | 10 | ecm_add_tests( 11 | addtoarchivetest.cpp 12 | deletetest.cpp 13 | loadtest.cpp 14 | extracttest.cpp 15 | addtest.cpp 16 | movetest.cpp 17 | copytest.cpp 18 | createdialogtest.cpp 19 | metadatatest.cpp 20 | mimetypetest.cpp 21 | preservemetadatatest.cpp 22 | LINK_LIBRARIES testhelper kerfuffle Qt::Test KF6::ConfigCore KF6::KIOCore 23 | NAME_PREFIX kerfuffle-) 24 | 25 | ecm_add_test( 26 | adddialogtest.cpp 27 | LINK_LIBRARIES kerfuffle Qt::Test KF6::KIOFileWidgets 28 | NAME_PREFIX kerfuffle-) 29 | 30 | ecm_add_tests( 31 | jobstest.cpp 32 | LINK_LIBRARIES jsoninterface Qt::Test 33 | NAME_PREFIX kerfuffle-) 34 | 35 | # metadatatest needs the number of plugins actually installed by an install() command. 36 | list(REMOVE_ITEM INSTALLED_KERFUFFLE_PLUGINS "") 37 | list(LENGTH INSTALLED_KERFUFFLE_PLUGINS INSTALLED_COUNT) 38 | target_compile_definitions(metadatatest PRIVATE -DPLUGINS_COUNT=${INSTALLED_COUNT}) 39 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/.clang-format: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Alexander Lohnau 2 | # SPDX-License-Identifier: CC0-1.0 3 | DisableFormat: true 4 | SortIncludes: false 5 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/Makefile -------------------------------------------------------------------------------- /autotests/kerfuffle/data/README: -------------------------------------------------------------------------------- 1 | Test data for the kerfuffle's unit tests. 2 | 3 | * The password for archivetest_encrypted.zip is 'ark' (without quotes). 4 | * The password for test_encrypted.arj is 'ark' (without quotes). 5 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/a.txt: -------------------------------------------------------------------------------- 1 | A simple text file (new). 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/absolutepath.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/absolutepath.tar.xz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/addonsu-remove-14.1-x86-signed.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/addonsu-remove-14.1-x86-signed.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-deepsinglehierarchy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "aDir/", 4 | "isDirectory": true 5 | }, 6 | { 7 | "fullPath": "aDir/b.txt" 8 | }, 9 | { 10 | "fullPath": "aDir/aDirInside/", 11 | "isDirectory": true 12 | }, 13 | { 14 | "fullPath": "aDir/aDirInside/anotherDir/", 15 | "isDirectory": true 16 | }, 17 | { 18 | "fullPath": "aDir/aDirInside/anotherDir/file.txt" 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-emptysinglefolder.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "aDir/", 4 | "isDirectory": true 5 | } 6 | ] 7 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-malicious.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "aDir/", 4 | "isDirectory": true 5 | }, 6 | { 7 | "fullPath": "aDir/b.txt" 8 | }, 9 | { 10 | "fullPath": "anotherDir/", 11 | "isDirectory": true 12 | }, 13 | { 14 | "fullPath": "anotherDir/..", 15 | "isDirectory": true 16 | }, 17 | { 18 | "fullPath": "anotherDir/../..", 19 | "isDirectory": true 20 | }, 21 | { 22 | "fullPath": "anotherDir/../../file.txt" 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-multiplefolders.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "aDir/", 4 | "isDirectory": true 5 | }, 6 | { 7 | "fullPath": "aDir/b.txt" 8 | }, 9 | { 10 | "fullPath": "anotherDir/", 11 | "isDirectory": true 12 | }, 13 | { 14 | "fullPath": "anotherDir/file.txt" 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-multivolume.7z.001: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archive-multivolume.7z.001 -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-multivolume.7z.002: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archive-multivolume.7z.002 -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-multivolume.7z.003: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archive-multivolume.7z.003 -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-multivolume.part1.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archive-multivolume.part1.rar -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-multivolume.part2.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archive-multivolume.part2.rar -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-multivolume.part3.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archive-multivolume.part3.rar -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-nodir-manyfiles.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "a.txt" 4 | }, 5 | { 6 | "fullPath": "file.txt" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-onetopfolder.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "aDir/", 4 | "isDirectory": true 5 | }, 6 | { 7 | "fullPath": "aDir/b.txt" 8 | } 9 | ] 10 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-password.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "foo.txt", 4 | "isPasswordProtected": true 5 | }, 6 | { 7 | "fullPath": "bar.txt" 8 | }, 9 | { 10 | "fullPath": "aDirectory/", 11 | "isDirectory": true 12 | } 13 | ] 14 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-singlefile.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "a.txt" 4 | } 5 | ] 6 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-unorderedsinglefolder.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "aDir/anotherDir/bar.txt" 4 | }, 5 | { 6 | "fullPath": "aDir/foo.txt" 7 | }, 8 | { 9 | "fullPath": "aDir/anotherDir/", 10 | "isDirectory": true 11 | }, 12 | { 13 | "fullPath": "aDir/", 14 | "isDirectory": true 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive-with-metadata.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archive-with-metadata.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive001.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "a.txt" 4 | }, 5 | { 6 | "fullPath": "aDir/", 7 | "isDirectory": true 8 | }, 9 | { 10 | "fullPath": "aDir/b.txt" 11 | }, 12 | { 13 | "fullPath": "c.txt" 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archive002.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fullPath": "a.txt", 4 | "size": 5 5 | }, 6 | { 7 | "fullPath": "aDir/", 8 | "isDirectory": true 9 | }, 10 | { 11 | "fullPath": "aDir/b.txt", 12 | "size": 954 13 | }, 14 | { 15 | "fullPath": "c.txt", 16 | "size": 45000 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archivetest_encrypted.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archivetest_encrypted.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archivetest_unencrypted.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archivetest_unencrypted.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/archlinux-2015.09.01-dual_truncated.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/archlinux-2015.09.01-dual_truncated.iso -------------------------------------------------------------------------------- /autotests/kerfuffle/data/bug_#394542.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/bug_#394542.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/code-x.y.z.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/code-x.y.z.tar.gz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/empty_folders.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/empty_folders.tar.gz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/empty_folders.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/empty_folders.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/firmware-pine64-20160329-6.1.aarch64.rpm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/firmware-pine64-20160329-6.1.aarch64.rpm -------------------------------------------------------------------------------- /autotests/kerfuffle/data/hello-1.0-x86_64.AppImage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/hello-1.0-x86_64.AppImage -------------------------------------------------------------------------------- /autotests/kerfuffle/data/kubuntu-14.04.1-desktop-amd64_truncated.iso: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/kubuntu-14.04.1-desktop-amd64_truncated.iso -------------------------------------------------------------------------------- /autotests/kerfuffle/data/libdummy.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/libdummy.a -------------------------------------------------------------------------------- /autotests/kerfuffle/data/one_toplevel_folder.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/one_toplevel_folder.7z -------------------------------------------------------------------------------- /autotests/kerfuffle/data/one_toplevel_folder.arj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/one_toplevel_folder.arj -------------------------------------------------------------------------------- /autotests/kerfuffle/data/one_toplevel_folder.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/one_toplevel_folder.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.Z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.Z -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.bz2 -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.gz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.lrz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.lrz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.lz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.lz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.lz4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.lz4 -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.lzma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.lzma -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.lzo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.lzo -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.xz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.tar.zst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.tar.zst -------------------------------------------------------------------------------- /autotests/kerfuffle/data/simplearchive.xar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/simplearchive.xar -------------------------------------------------------------------------------- /autotests/kerfuffle/data/single-empty-folder.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/single-empty-folder.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/smallarchive.deb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/smallarchive.deb -------------------------------------------------------------------------------- /autotests/kerfuffle/data/tar-v7.tar: -------------------------------------------------------------------------------- 1 | test.txt000644 001750 001750 00000000110 12632042244 006266 This is an uncompressed tar archive created with: 2 | $ bsdtar --format=v7 3 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test%dir/testfile1.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test%dir/testfile2.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test-3.4.0/testfile1.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.7z -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.arj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.arj -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.odt -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.png.lzma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.png.lzma -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.png.lzo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.png.lzo -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.rar -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.sit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.sit -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.svgz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.txt.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.txt.bz2 -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.txt.gz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.txt.lrz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.txt.lrz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.txt.lz4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.txt.lz4 -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.txt.zst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.txt.zst -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.z -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test.zz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test.zz -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test_encrypted.arj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test_encrypted.arj -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test_permissions.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test_permissions.7z -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test_permissions.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test_permissions.rar -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test_permissions.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test_permissions.tar.bz2 -------------------------------------------------------------------------------- /autotests/kerfuffle/data/test_permissions.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/test_permissions.zip -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdir/testfile1.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdir/testfile2.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdir2/testdir/testfile1.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdir2/testdir/testfile2.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdirwithemptysubdir/testfile1.txt: -------------------------------------------------------------------------------- 1 | testfile1.txt 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdirwithemptysubdir/testfile2.txt: -------------------------------------------------------------------------------- 1 | testfile2.txt 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdirwithemptysubdir_1.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/testdirwithemptysubdir_1.rar -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdirwithsubdirs/subdir1/subdir2/subdir3/testfile4.txt: -------------------------------------------------------------------------------- 1 | testfile4.txt 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdirwithsubdirs/subdir1/subdir2/testfile3.txt: -------------------------------------------------------------------------------- 1 | testfile3.txt 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdirwithsubdirs/subdir1/testfile2.txt: -------------------------------------------------------------------------------- 1 | testfile2.txt 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testdirwithsubdirs/testfile1.txt: -------------------------------------------------------------------------------- 1 | testfile1.txt 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testfile.md: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/testfile.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/textfile1.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/textfile2.txt: -------------------------------------------------------------------------------- 1 | A simple text file. 2 | -------------------------------------------------------------------------------- /autotests/kerfuffle/data/wget-download.tar.gz.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/wget-download.tar.gz.1 -------------------------------------------------------------------------------- /autotests/kerfuffle/data/wget.rpm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/wget.rpm -------------------------------------------------------------------------------- /autotests/kerfuffle/data/zip_with_wrong_extension.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/kerfuffle/data/zip_with_wrong_extension.rar -------------------------------------------------------------------------------- /autotests/kerfuffle/jsonarchiveinterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2010-2011 Raphael Kubo da Costa 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef JSONARCHIVEINTERFACE_H 8 | #define JSONARCHIVEINTERFACE_H 9 | 10 | #include "archiveinterface.h" 11 | #include "jsonparser.h" 12 | 13 | /** 14 | * A dummy archive interface used by our test cases. 15 | * 16 | * It reads a JSON file which defines the contents of the archive. 17 | * For the file format description, see the documentation for @c JSONParser. 18 | * 19 | * The file's content is read to memory when open() is called and the archive 20 | * is then closed. This means that this class never changes the file's content 21 | * on disk, and entry addition or deletion do not change the original file. 22 | * 23 | * @sa JSONParser 24 | * 25 | * @author Raphael Kubo da Costa 26 | */ 27 | class JSONArchiveInterface : public Kerfuffle::ReadWriteArchiveInterface 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit JSONArchiveInterface(QObject *parent, const QVariantList &args); 33 | ~JSONArchiveInterface() override; 34 | 35 | bool list() override; 36 | bool open() override; 37 | 38 | bool addFiles(const QList &files, 39 | const Kerfuffle::Archive::Entry *destination, 40 | const Kerfuffle::CompressionOptions &options, 41 | uint numberOfEntriesToAdd = 0) override; 42 | bool 43 | moveFiles(const QList &files, Kerfuffle::Archive::Entry *destination, const Kerfuffle::CompressionOptions &options) override; 44 | bool 45 | copyFiles(const QList &files, Kerfuffle::Archive::Entry *destination, const Kerfuffle::CompressionOptions &options) override; 46 | bool 47 | extractFiles(const QList &files, const QString &destinationDirectory, const Kerfuffle::ExtractionOptions &options) override; 48 | bool deleteFiles(const QList &files) override; 49 | bool addComment(const QString &comment) override; 50 | bool testArchive() override; 51 | 52 | private: 53 | JSONParser::JSONArchive m_archive; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /autotests/kerfuffle/jsonparser.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Raphael Kubo da Costa 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "jsonparser.h" 8 | #include "archiveinterface.h" 9 | 10 | #include 11 | #include 12 | 13 | JSONParser::JSONParser() 14 | { 15 | } 16 | 17 | JSONParser::~JSONParser() 18 | { 19 | } 20 | 21 | JSONParser::JSONArchive JSONParser::parse(QIODevice *json) 22 | { 23 | QJsonParseError error; 24 | QJsonDocument jsonDoc = QJsonDocument::fromJson(json->readAll(), &error); 25 | 26 | if (error.error != QJsonParseError::NoError) { 27 | qDebug() << "Parse error: " << error.errorString(); 28 | return JSONParser::JSONArchive(); 29 | } 30 | 31 | return createJSONArchive(jsonDoc.toVariant()); 32 | } 33 | 34 | JSONParser::JSONArchive JSONParser::createJSONArchive(const QVariant &json) 35 | { 36 | JSONParser::JSONArchive archive; 37 | 38 | const auto jsonList = json.toList(); 39 | for (const QVariant &entry : jsonList) { 40 | const QVariantMap entryMap = entry.toMap(); 41 | 42 | if (!entryMap.contains(QStringLiteral("fullPath"))) { 43 | continue; 44 | } 45 | 46 | Kerfuffle::Archive::Entry *e = new Kerfuffle::Archive::Entry(); 47 | 48 | QVariantMap::const_iterator entryIterator = entryMap.constBegin(); 49 | for (; entryIterator != entryMap.constEnd(); ++entryIterator) { 50 | const QByteArray key = entryIterator.key().toUtf8(); 51 | if (e->property(key.constData()).isValid()) { 52 | e->setProperty(key.constData(), entryIterator.value()); 53 | } else { 54 | qDebug() << entryIterator.key() << "is not a valid entry key"; 55 | } 56 | } 57 | 58 | const QString fullPath = entryMap[QStringLiteral("fullPath")].toString(); 59 | archive[fullPath] = e; 60 | } 61 | 62 | return archive; 63 | } 64 | -------------------------------------------------------------------------------- /autotests/kerfuffle/jsonparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Raphael Kubo da Costa 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef JSONPARSER_H 8 | #define JSONPARSER_H 9 | 10 | #include "archiveentry.h" 11 | 12 | #include 13 | #include 14 | 15 | /** 16 | * Simple parser which reads JSON files and creates @c ArchiveEntry objects 17 | * from it. 18 | * 19 | * The JSON file is expected to follow a specific format that describes an 20 | * archive read by Kerfuffle. 21 | * 22 | * The format consists of a list of dictionaries whose keys are values from the 23 | * EntryMetaDataType enum. The only required key for each entry is FileName; 24 | * other values which are omitted for each entry are assumed to be 0 or false. 25 | * 26 | * Example file: 27 | * @code 28 | * [ 29 | * { "fullPath": "foo", "IsPasswordProtected": true }, 30 | * { "fullPath": "aDir/", "IsDirectory": true } 31 | * ] 32 | * @endcode 33 | * 34 | * @author Raphael Kubo da Costa 35 | */ 36 | class JSONParser 37 | { 38 | public: 39 | typedef QMap JSONArchive; 40 | 41 | ~JSONParser(); 42 | 43 | static JSONArchive parse(QIODevice *json); 44 | 45 | private: 46 | JSONParser(); 47 | 48 | /** 49 | * Parses each entry in the QVariant obtained from parsing a JSON file and 50 | * creates a @c JSONArchive from them. 51 | * 52 | * If an entry does not have a "fullPath" key, it is ignored. Keys which do 53 | * not correspond to a value in the EntryMetaDataType enum are ignored. 54 | * 55 | * @return A new @c JSONArchive corresponding to the parsed JSON file. If a 56 | * parsing error occurs, it is empty. 57 | */ 58 | static JSONArchive createJSONArchive(const QVariant &json); 59 | }; 60 | 61 | #endif // JSONPARSER_H 62 | -------------------------------------------------------------------------------- /autotests/kerfuffle/metadatatest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | class MetaDataTest : public QObject 11 | { 12 | Q_OBJECT 13 | 14 | private Q_SLOTS: 15 | 16 | void initTestCase(); 17 | void testPluginLoading(); 18 | void testPluginMetadata(); 19 | 20 | private: 21 | QList m_plugins; 22 | }; 23 | 24 | void MetaDataTest::initTestCase() 25 | { 26 | m_plugins = KPluginMetaData::findPlugins(QStringLiteral("kerfuffle")); 27 | } 28 | 29 | // If a plugin has invalid JSON metadata (e.g. an extra comma somewhere) 30 | // it won't occur in the list of available plugins. 31 | void MetaDataTest::testPluginLoading() 32 | { 33 | QCOMPARE(m_plugins.count() % PLUGINS_COUNT, 0); 34 | } 35 | 36 | void MetaDataTest::testPluginMetadata() 37 | { 38 | for (const KPluginMetaData &metaData : std::as_const(m_plugins)) { 39 | QVERIFY(!metaData.mimeTypes().isEmpty()); 40 | 41 | const QJsonObject json = metaData.rawData(); 42 | QVERIFY(json.keys().contains(QLatin1String("X-KDE-Priority"))); 43 | QVERIFY(json.keys().contains(QLatin1String("KPlugin"))); 44 | 45 | if (json.keys().contains(QLatin1String("X-KDE-Kerfuffle-ReadOnlyExecutables"))) { 46 | QVERIFY(json[QStringLiteral("X-KDE-Kerfuffle-ReadOnlyExecutables")].isArray()); 47 | } 48 | 49 | if (json.keys().contains(QLatin1String("X-KDE-Kerfuffle-ReadWriteExecutables"))) { 50 | QVERIFY(json[QStringLiteral("X-KDE-Kerfuffle-ReadWriteExecutables")].isArray()); 51 | 52 | // If there is a list of read-write executables, the plugin has to be read-write. 53 | QVERIFY(json.keys().contains(QLatin1String("X-KDE-Kerfuffle-ReadWrite"))); 54 | QVERIFY(json[QStringLiteral("X-KDE-Kerfuffle-ReadWrite")].toBool()); 55 | } 56 | } 57 | } 58 | 59 | QTEST_GUILESS_MAIN(MetaDataTest) 60 | 61 | #include "metadatatest.moc" 62 | -------------------------------------------------------------------------------- /autotests/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(clizipplugin) 2 | add_subdirectory(cli7zplugin) 3 | add_subdirectory(clirarplugin) 4 | add_subdirectory(cliunarchiverplugin) 5 | add_subdirectory(cliarjplugin) 6 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 2 | 3 | include_directories(${CMAKE_SOURCE_DIR}/plugins/cli7zplugin/) 4 | 5 | file(COPY ${CMAKE_BINARY_DIR}/plugins/cli7zplugin/kerfuffle_cli7z.json 6 | DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 7 | 8 | ecm_add_test( 9 | cli7ztest.cpp 10 | ${CMAKE_SOURCE_DIR}/plugins/cli7zplugin/cliplugin.cpp 11 | ${CMAKE_BINARY_DIR}/plugins/cli7zplugin/ark_debug.cpp 12 | LINK_LIBRARIES testhelper kerfuffle Qt::Test 13 | TEST_NAME cli7ztest 14 | NAME_PREFIX plugins-) 15 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/cli7ztest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Ragnar Thomsen 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef CLI7ZTEST_H 8 | #define CLI7ZTEST_H 9 | 10 | #include "pluginmanager.h" 11 | 12 | using namespace Kerfuffle; 13 | 14 | class Cli7zTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void initTestCase(); 20 | void testArchive_data(); 21 | void testArchive(); 22 | void testList_data(); 23 | void testList(); 24 | void testListArgs_data(); 25 | void testListArgs(); 26 | void testAddArgs_data(); 27 | void testAddArgs(); 28 | void testExtractArgs_data(); 29 | void testExtractArgs(); 30 | void testRDAAttributes(); 31 | 32 | private: 33 | PluginManager m_pluginManger; 34 | Plugin *m_plugin; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/RDA-attributes.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cli7zplugin/data/RDA-attributes.zip -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-encrypted-1509.txt: -------------------------------------------------------------------------------- 1 | 2 | 7-Zip [64] 15.09 beta : Copyright (c) 1999-2015 Igor Pavlov : 2015-10-16 3 | p7zip Version 15.09 beta (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64) 4 | 5 | Scanning the drive for archives: 6 | 1 file, 373 bytes (1 KiB) 7 | 8 | Listing archive: testpassfiles.7z 9 | 10 | -- 11 | Path = testpassfiles.7z 12 | Type = 7z 13 | Physical Size = 373 14 | Headers Size = 309 15 | Method = LZMA2:12 7zAES 16 | Solid = + 17 | Blocks = 1 18 | 19 | ---------- 20 | Path = testarchive 21 | Size = 0 22 | Packed Size = 0 23 | Modified = 2016-03-23 07:40:06 24 | Attributes = D_ drwxrwxr-x 25 | CRC = 26 | Encrypted = - 27 | Method = 28 | Block = 29 | 30 | Path = testarchive/dir1 31 | Size = 0 32 | Packed Size = 0 33 | Modified = 2015-05-14 00:45:24 34 | Attributes = D_ drwxrwxr-x 35 | CRC = 36 | Encrypted = - 37 | Method = 38 | Block = 39 | 40 | Path = testarchive/dir2 41 | Size = 0 42 | Packed Size = 0 43 | Modified = 2015-05-14 00:43:41 44 | Attributes = D_ drwxrwxr-x 45 | CRC = 46 | Encrypted = - 47 | Method = 48 | Block = 49 | 50 | Path = testarchive/dir1/file1.txt 51 | Size = 32 52 | Packed Size = 64 53 | Modified = 2015-05-17 19:41:48 54 | Attributes = A_ -rw-rw-r-- 55 | CRC = 034EE5C7 56 | Encrypted = + 57 | Method = LZMA2:12 7zAES:19 58 | Block = 0 59 | 60 | Path = testarchive/dir2/file2.txt 61 | Size = 32 62 | Packed Size = 63 | Modified = 2015-05-17 19:41:48 64 | Attributes = A_ -rw-rw-r-- 65 | CRC = D49ECBCA 66 | Encrypted = + 67 | Method = LZMA2:12 7zAES:19 68 | Block = 0 69 | 70 | Path = testarchive/file1.txt 71 | Size = 43 72 | Packed Size = 73 | Modified = 2015-09-13 13:05:45 74 | Attributes = A_ -rw-rw-r-- 75 | CRC = 94E02716 76 | Encrypted = + 77 | Method = LZMA2:12 7zAES:19 78 | Block = 0 79 | 80 | Path = testarchive/file2.txt 81 | Size = 32 82 | Packed Size = 83 | Modified = 2015-05-18 13:57:37 84 | Attributes = A_ -rw-rw-r-- 85 | CRC = D49ECBCA 86 | Encrypted = + 87 | Method = LZMA2:12 7zAES:19 88 | Block = 0 89 | 90 | Path = testarchive/file3.txt 91 | Size = 32 92 | Packed Size = 93 | Modified = 2015-05-13 16:26:42 94 | Attributes = A_ -rw-rw-r-- 95 | CRC = 99D12E31 96 | Encrypted = + 97 | Method = LZMA2:12 7zAES:19 98 | Block = 0 99 | 100 | Path = testarchive/file4.txt 101 | Size = 32 102 | Packed Size = 103 | Modified = 2015-07-26 17:53:21 104 | Attributes = A_ -rw-rw-r-- 105 | CRC = A04F9191 106 | Encrypted = + 107 | Method = LZMA2:12 7zAES:19 108 | Block = 0 109 | 110 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-encrypted-1514.txt: -------------------------------------------------------------------------------- 1 | 2 | 7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31 3 | p7zip Version 15.14 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64) 4 | 5 | Scanning the drive for archives: 6 | 1 file, 373 bytes (1 KiB) 7 | 8 | Listing archive: testpassfiles.7z 9 | 10 | -- 11 | Path = testpassfiles.7z 12 | Type = 7z 13 | Physical Size = 373 14 | Headers Size = 309 15 | Method = LZMA2:12 7zAES 16 | Solid = + 17 | Blocks = 1 18 | 19 | ---------- 20 | Path = testarchive 21 | Size = 0 22 | Packed Size = 0 23 | Modified = 2016-03-23 07:40:06 24 | Attributes = D_ drwxrwxr-x 25 | CRC = 26 | Encrypted = - 27 | Method = 28 | Block = 29 | 30 | Path = testarchive/dir1 31 | Size = 0 32 | Packed Size = 0 33 | Modified = 2015-05-14 00:45:24 34 | Attributes = D_ drwxrwxr-x 35 | CRC = 36 | Encrypted = - 37 | Method = 38 | Block = 39 | 40 | Path = testarchive/dir2 41 | Size = 0 42 | Packed Size = 0 43 | Modified = 2015-05-14 00:43:41 44 | Attributes = D_ drwxrwxr-x 45 | CRC = 46 | Encrypted = - 47 | Method = 48 | Block = 49 | 50 | Path = testarchive/dir1/file1.txt 51 | Size = 32 52 | Packed Size = 64 53 | Modified = 2015-05-17 19:41:48 54 | Attributes = A_ -rw-rw-r-- 55 | CRC = 034EE5C7 56 | Encrypted = + 57 | Method = LZMA2:12 7zAES:19 58 | Block = 0 59 | 60 | Path = testarchive/dir2/file2.txt 61 | Size = 32 62 | Packed Size = 63 | Modified = 2015-05-17 19:41:48 64 | Attributes = A_ -rw-rw-r-- 65 | CRC = D49ECBCA 66 | Encrypted = + 67 | Method = LZMA2:12 7zAES:19 68 | Block = 0 69 | 70 | Path = testarchive/file1.txt 71 | Size = 43 72 | Packed Size = 73 | Modified = 2015-09-13 13:05:45 74 | Attributes = A_ -rw-rw-r-- 75 | CRC = 94E02716 76 | Encrypted = + 77 | Method = LZMA2:12 7zAES:19 78 | Block = 0 79 | 80 | Path = testarchive/file2.txt 81 | Size = 32 82 | Packed Size = 83 | Modified = 2015-05-18 13:57:37 84 | Attributes = A_ -rw-rw-r-- 85 | CRC = D49ECBCA 86 | Encrypted = + 87 | Method = LZMA2:12 7zAES:19 88 | Block = 0 89 | 90 | Path = testarchive/file3.txt 91 | Size = 32 92 | Packed Size = 93 | Modified = 2015-05-13 16:26:42 94 | Attributes = A_ -rw-rw-r-- 95 | CRC = 99D12E31 96 | Encrypted = + 97 | Method = LZMA2:12 7zAES:19 98 | Block = 0 99 | 100 | Path = testarchive/file4.txt 101 | Size = 32 102 | Packed Size = 103 | Modified = 2015-07-26 17:53:21 104 | Attributes = A_ -rw-rw-r-- 105 | CRC = A04F9191 106 | Encrypted = + 107 | Method = LZMA2:12 7zAES:19 108 | Block = 0 109 | 110 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-encrypted-1602.txt: -------------------------------------------------------------------------------- 1 | 2 | 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 3 | p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64) 4 | 5 | Scanning the drive for archives: 6 | 1 file, 276 bytes (1 KiB) 7 | 8 | Listing archive: testpassfiles.7z 9 | 10 | -- 11 | Path = testpassfiles.7z 12 | Type = 7z 13 | Physical Size = 276 14 | Headers Size = 212 15 | Method = LZMA2:12 7zAES 16 | Solid = + 17 | Blocks = 1 18 | 19 | ---------- 20 | Path = file1.txt 21 | Size = 32 22 | Packed Size = 64 23 | Modified = 2016-03-02 22:37:55 24 | Attributes = A_ -rw-rw-r-- 25 | CRC = 034EE5C7 26 | Encrypted = + 27 | Method = LZMA2:12 7zAES:19 28 | Block = 0 29 | 30 | Path = file2.txt 31 | Size = 14 32 | Packed Size = 33 | Modified = 2016-03-02 22:37:55 34 | Attributes = A_ -rw-rw-r-- 35 | CRC = A5BA4A7B 36 | Encrypted = + 37 | Method = LZMA2:12 7zAES:19 38 | Block = 0 39 | 40 | Path = file3.txt 41 | Size = 32 42 | Packed Size = 43 | Modified = 2016-03-02 22:37:54 44 | Attributes = A_ -rw-rw-r-- 45 | CRC = 99D12E31 46 | Encrypted = + 47 | Method = LZMA2:12 7zAES:19 48 | Block = 0 49 | 50 | Path = file4.txt 51 | Size = 32 52 | Packed Size = 53 | Modified = 2016-03-02 22:37:50 54 | Attributes = A_ -rw-rw-r-- 55 | CRC = A04F9191 56 | Encrypted = + 57 | Method = LZMA2:12 7zAES:19 58 | Block = 0 59 | 60 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-encrypted-9381.txt: -------------------------------------------------------------------------------- 1 | 2 | 7-Zip [64] 9.38 beta Copyright (c) 1999-2014 Igor Pavlov 2015-01-03 3 | p7zip Version 9.38.1 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,8 CPUs) 4 | 5 | Listing archive: testpassfiles.7z 6 | 7 | -- 8 | Path = testpassfiles.7z 9 | Type = 7z 10 | Physical Size = 373 11 | Headers Size = 309 12 | Method = LZMA2:12 7zAES 13 | Solid = + 14 | Blocks = 1 15 | 16 | ---------- 17 | Path = testarchive 18 | Size = 0 19 | Packed Size = 0 20 | Modified = 2016-03-23 07:40:06 21 | Attributes = D_ 22 | CRC = 23 | Encrypted = - 24 | Method = 25 | Block = 26 | 27 | Path = testarchive/dir1 28 | Size = 0 29 | Packed Size = 0 30 | Modified = 2015-05-14 00:45:24 31 | Attributes = D_ 32 | CRC = 33 | Encrypted = - 34 | Method = 35 | Block = 36 | 37 | Path = testarchive/dir2 38 | Size = 0 39 | Packed Size = 0 40 | Modified = 2015-05-14 00:43:41 41 | Attributes = D_ 42 | CRC = 43 | Encrypted = - 44 | Method = 45 | Block = 46 | 47 | Path = testarchive/dir1/file1.txt 48 | Size = 32 49 | Packed Size = 64 50 | Modified = 2015-05-17 19:41:48 51 | Attributes = A_ 52 | CRC = 034EE5C7 53 | Encrypted = + 54 | Method = LZMA2:12 7zAES:19 55 | Block = 0 56 | 57 | Path = testarchive/dir2/file2.txt 58 | Size = 32 59 | Packed Size = 60 | Modified = 2015-05-17 19:41:48 61 | Attributes = A_ 62 | CRC = D49ECBCA 63 | Encrypted = + 64 | Method = LZMA2:12 7zAES:19 65 | Block = 0 66 | 67 | Path = testarchive/file1.txt 68 | Size = 43 69 | Packed Size = 70 | Modified = 2015-09-13 13:05:45 71 | Attributes = A_ 72 | CRC = 94E02716 73 | Encrypted = + 74 | Method = LZMA2:12 7zAES:19 75 | Block = 0 76 | 77 | Path = testarchive/file2.txt 78 | Size = 32 79 | Packed Size = 80 | Modified = 2015-05-18 13:57:37 81 | Attributes = A_ 82 | CRC = D49ECBCA 83 | Encrypted = + 84 | Method = LZMA2:12 7zAES:19 85 | Block = 0 86 | 87 | Path = testarchive/file3.txt 88 | Size = 32 89 | Packed Size = 90 | Modified = 2015-05-13 16:26:42 91 | Attributes = A_ 92 | CRC = 99D12E31 93 | Encrypted = + 94 | Method = LZMA2:12 7zAES:19 95 | Block = 0 96 | 97 | Path = testarchive/file4.txt 98 | Size = 32 99 | Packed Size = 100 | Modified = 2015-07-26 17:53:21 101 | Attributes = A_ 102 | CRC = A04F9191 103 | Encrypted = + 104 | Method = LZMA2:12 7zAES:19 105 | Block = 0 106 | 107 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-multivol-1602.txt: -------------------------------------------------------------------------------- 1 | 2 | 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 3 | p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64) 4 | 5 | Scanning the drive for archives: 6 | 1 file, 1048576 bytes (1024 KiB) 7 | 8 | Listing archive: testmultivol.7z.001 9 | 10 | -- 11 | Path = testmultivol.7z.001 12 | Type = Split 13 | Physical Size = 1048576 14 | Volumes = 5 15 | Total Physical Size = 4194711 16 | ---- 17 | Path = testmultivol.7z 18 | Size = 4194711 19 | -- 20 | Path = testmultivol.7z 21 | Type = 7z 22 | Physical Size = 4194711 23 | Headers Size = 181 24 | Method = LZMA2:22 25 | Solid = + 26 | Blocks = 1 27 | 28 | ---------- 29 | Path = largefile1 30 | Size = 2097152 31 | Packed Size = 4194530 32 | Modified = 2016-07-17 11:25:56 33 | Attributes = A_ -rw-rw-r-- 34 | CRC = 147E8FFD 35 | Encrypted = - 36 | Method = LZMA2:22 37 | Block = 0 38 | 39 | Path = largefile2 40 | Size = 2097152 41 | Packed Size = 42 | Modified = 2016-07-17 11:26:19 43 | Attributes = A_ -rw-rw-r-- 44 | CRC = 934DAE71 45 | Encrypted = - 46 | Method = LZMA2:22 47 | Block = 0 48 | 49 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-multivolume.7z.001: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cli7zplugin/data/archive-multivolume.7z.001 -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-multivolume.7z.002: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cli7zplugin/data/archive-multivolume.7z.002 -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-multivolume.7z.003: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cli7zplugin/data/archive-multivolume.7z.003 -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-with-symlink-9381.txt: -------------------------------------------------------------------------------- 1 | 2 | 7-Zip [64] 9.38 beta Copyright (c) 1999-2014 Igor Pavlov 2015-01-03 3 | p7zip Version 9.38.1 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,8 CPUs) 4 | 5 | Listing archive: testlink.7z 6 | 7 | -- 8 | Path = testlink.7z 9 | Type = 7z 10 | Physical Size = 371 11 | Headers Size = 310 12 | Method = LZMA2:12 13 | Solid = + 14 | Blocks = 1 15 | 16 | ---------- 17 | Path = testarchive 18 | Size = 0 19 | Packed Size = 0 20 | Modified = 2016-03-23 07:46:21 21 | Attributes = D_ 22 | CRC = 23 | Encrypted = - 24 | Method = 25 | Block = 26 | 27 | Path = testarchive/dir1 28 | Size = 0 29 | Packed Size = 0 30 | Modified = 2015-05-14 00:45:24 31 | Attributes = D_ 32 | CRC = 33 | Encrypted = - 34 | Method = 35 | Block = 36 | 37 | Path = testarchive/dir2 38 | Size = 0 39 | Packed Size = 0 40 | Modified = 2015-05-14 00:43:41 41 | Attributes = D_ 42 | CRC = 43 | Encrypted = - 44 | Method = 45 | Block = 46 | 47 | Path = testarchive/dir1/file1.txt 48 | Size = 32 49 | Packed Size = 61 50 | Modified = 2015-05-17 19:41:48 51 | Attributes = A_ 52 | CRC = 034EE5C7 53 | Encrypted = - 54 | Method = LZMA2:12 55 | Block = 0 56 | 57 | Path = testarchive/dir2/file2.txt 58 | Size = 32 59 | Packed Size = 60 | Modified = 2015-05-17 19:41:48 61 | Attributes = A_ 62 | CRC = D49ECBCA 63 | Encrypted = - 64 | Method = LZMA2:12 65 | Block = 0 66 | 67 | Path = testarchive/file1.txt 68 | Size = 43 69 | Packed Size = 70 | Modified = 2015-09-13 13:05:45 71 | Attributes = A_ 72 | CRC = 94E02716 73 | Encrypted = - 74 | Method = LZMA2:12 75 | Block = 0 76 | 77 | Path = testarchive/file2.txt 78 | Size = 32 79 | Packed Size = 80 | Modified = 2015-05-18 13:57:37 81 | Attributes = A_ 82 | CRC = D49ECBCA 83 | Encrypted = - 84 | Method = LZMA2:12 85 | Block = 0 86 | 87 | Path = testarchive/file3.txt 88 | Size = 32 89 | Packed Size = 90 | Modified = 2015-05-13 16:26:42 91 | Attributes = A_ 92 | CRC = 99D12E31 93 | Encrypted = - 94 | Method = LZMA2:12 95 | Block = 0 96 | 97 | Path = testarchive/file4.txt 98 | Size = 32 99 | Packed Size = 100 | Modified = 2015-07-26 17:53:21 101 | Attributes = A_ 102 | CRC = A04F9191 103 | Encrypted = - 104 | Method = LZMA2:12 105 | Block = 0 106 | 107 | Path = testarchive/linktofile1.txt 108 | Size = 9 109 | Packed Size = 110 | Modified = 2016-03-23 07:46:21 111 | Attributes = A_ 112 | CRC = 2D212004 113 | Encrypted = - 114 | Method = LZMA2:12 115 | Block = 0 116 | 117 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/archive-zip-AES256-1602.txt: -------------------------------------------------------------------------------- 1 | 2 | 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21 3 | p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,8 CPUs x64) 4 | 5 | Scanning the drive for archives: 6 | 1 file, 781 bytes (1 KiB) 7 | 8 | Listing archive: testarchive.zip 9 | 10 | -- 11 | Path = testarchive.zip 12 | Type = zip 13 | Physical Size = 781 14 | 15 | ---------- 16 | Path = testarchive 17 | Folder = + 18 | Size = 0 19 | Packed Size = 0 20 | Modified = 2016-11-06 21:17:02 21 | Created = 2016-11-06 21:17:02 22 | Accessed = 2016-11-06 21:17:03 23 | Attributes = D_ drwxrwxr-x 24 | Encrypted = - 25 | Comment = 26 | CRC = 27 | Method = Store 28 | Host OS = Unix 29 | Version = 20 30 | Volume Index = 0 31 | 32 | Path = testarchive/dir1 33 | Folder = + 34 | Size = 0 35 | Packed Size = 0 36 | Modified = 2015-05-14 00:45:24 37 | Created = 2016-11-06 21:16:31 38 | Accessed = 2016-11-06 21:16:35 39 | Attributes = D_ drwxrwxr-x 40 | Encrypted = - 41 | Comment = 42 | CRC = 43 | Method = Store 44 | Host OS = Unix 45 | Version = 20 46 | Volume Index = 0 47 | 48 | Path = testarchive/dir1/file1.txt 49 | Folder = - 50 | Size = 32 51 | Packed Size = 57 52 | Modified = 2015-05-17 19:41:48 53 | Created = 2016-11-06 21:16:31 54 | Accessed = 2016-11-06 21:17:06 55 | Attributes = _ -rw-rw-r-- 56 | Encrypted = + 57 | Comment = 58 | CRC = 59 | Method = AES-256 Deflate 60 | Host OS = Unix 61 | Version = 51 62 | Volume Index = 0 63 | 64 | Path = testarchive/file2.txt 65 | Folder = - 66 | Size = 33 67 | Packed Size = 58 68 | Modified = 2016-11-06 21:17:02 69 | Created = 2016-11-06 21:17:02 70 | Accessed = 2016-11-06 21:17:02 71 | Attributes = _ -rw-rw-r-- 72 | Encrypted = + 73 | Comment = 74 | CRC = 75 | Method = AES-256 Deflate 76 | Host OS = Unix 77 | Version = 51 78 | Volume Index = 0 79 | 80 | -------------------------------------------------------------------------------- /autotests/plugins/cli7zplugin/data/one_toplevel_folder.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cli7zplugin/data/one_toplevel_folder.7z -------------------------------------------------------------------------------- /autotests/plugins/cliarjplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 2 | 3 | include_directories(${CMAKE_SOURCE_DIR}/plugins/cliarjplugin/) 4 | 5 | file(COPY ${CMAKE_BINARY_DIR}/plugins/cliarjplugin/kerfuffle_cliarj.json 6 | DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 7 | 8 | ecm_add_test( 9 | cliarjtest.cpp 10 | ${CMAKE_SOURCE_DIR}/plugins/cliarjplugin/cliplugin.cpp 11 | ${CMAKE_BINARY_DIR}/plugins/cliarjplugin/ark_debug.cpp 12 | LINK_LIBRARIES testhelper kerfuffle Qt::Test 13 | TEST_NAME cliarjtest 14 | NAME_PREFIX plugins-) 15 | -------------------------------------------------------------------------------- /autotests/plugins/cliarjplugin/cliarjtest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2022 Ilya Pominov 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef CLIARJTEST_H 8 | #define CLIARJTEST_H 9 | 10 | #include "pluginmanager.h" 11 | 12 | using namespace Kerfuffle; 13 | 14 | class CliArjTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void initTestCase(); 20 | void testListArgs_data(); 21 | void testListArgs(); 22 | void testAddArgs_data(); 23 | void testAddArgs(); 24 | void testExtractArgs_data(); 25 | void testExtractArgs(); 26 | 27 | private: 28 | PluginManager m_pluginManger; 29 | Plugin *m_plugin; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 2 | 3 | include_directories(${CMAKE_SOURCE_DIR}/plugins/clirarplugin/) 4 | 5 | file(COPY ${CMAKE_BINARY_DIR}/plugins/clirarplugin/kerfuffle_clirar.json 6 | DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 7 | 8 | ecm_add_test( 9 | clirartest.cpp 10 | ${CMAKE_SOURCE_DIR}/plugins/clirarplugin/cliplugin.cpp 11 | ${CMAKE_BINARY_DIR}/plugins/clirarplugin/ark_debug.cpp 12 | LINK_LIBRARIES testhelper kerfuffle Qt::Test 13 | TEST_NAME clirartest 14 | NAME_PREFIX plugins-) 15 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/clirartest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Raphael Kubo da Costa 3 | SPDX-FileCopyrightText: 2015, 2016 Ragnar Thomsen 4 | 5 | SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #ifndef CLIRARTEST_H 9 | #define CLIRARTEST_H 10 | 11 | #include "pluginmanager.h" 12 | 13 | using namespace Kerfuffle; 14 | 15 | class CliRarTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | private Q_SLOTS: 20 | void initTestCase(); 21 | void testArchive_data(); 22 | void testArchive(); 23 | void testList_data(); 24 | void testList(); 25 | void testListArgs_data(); 26 | void testListArgs(); 27 | void testAddArgs_data(); 28 | void testAddArgs(); 29 | void testExtractArgs_data(); 30 | void testExtractArgs(); 31 | 32 | private: 33 | PluginManager m_pluginManger; 34 | Plugin *m_plugin; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-RARv5-unrar3.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 3.71 beta 1 freeware Copyright (c) 1993-2007 Alexander Roshal 3 | 4 | testv5.rar is not RAR archive 5 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-RARv5-unrar4.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 4.20 freeware Copyright (c) 1993-2012 Alexander Roshal 3 | 4 | Unsupported archive format. Please update RAR to a newer version. 5 | testv5.rar is not RAR archive 6 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-RARv5-unrar5.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 5.40 freeware Copyright (c) 1993-2016 Alexander Roshal 3 | 4 | Archive: testrar5.rar 5 | Details: RAR 5 6 | 7 | Name: testarchive/file4.txt 8 | Type: File 9 | Size: 32 10 | Packed size: 32 11 | Ratio: 100% 12 | mtime: 2015-07-26 18:53:21,000 13 | Attributes: -rw-rw-r-- 14 | CRC32: A04F9191 15 | Host OS: Unix 16 | Compression: RAR 5.0(v50) -m0 -md=128K 17 | 18 | Name: testarchive/dir2/file2.txt 19 | Type: File 20 | Size: 32 21 | Packed size: 32 22 | Ratio: 100% 23 | mtime: 2015-05-17 20:41:48,000 24 | Attributes: -rw-rw-r-- 25 | CRC32: D49ECBCA 26 | Host OS: Unix 27 | Compression: RAR 5.0(v50) -m3 -md=128K 28 | 29 | Name: testarchive/file1.txt 30 | Type: File 31 | Size: 43 32 | Packed size: 35 33 | Ratio: 81% 34 | mtime: 2015-09-13 14:05:45,000 35 | Attributes: -rw-rw-r-- 36 | CRC32: 94E02716 37 | Host OS: Unix 38 | Compression: RAR 5.0(v50) -m3 -md=128K 39 | 40 | Name: testarchive/file2.txt 41 | Type: File 42 | Size: 32 43 | Packed size: 32 44 | Ratio: 100% 45 | mtime: 2015-05-18 14:57:37,000 46 | Attributes: -rw-rw-r-- 47 | CRC32: D49ECBCA 48 | Host OS: Unix 49 | Compression: RAR 5.0(v50) -m3 -md=128K 50 | 51 | Name: testarchive/dir1/file1.txt 52 | Type: File 53 | Size: 32 54 | Packed size: 32 55 | Ratio: 100% 56 | mtime: 2015-05-17 20:41:48,000 57 | Attributes: -rw-rw-r-- 58 | CRC32: 034EE5C7 59 | Host OS: Unix 60 | Compression: RAR 5.0(v50) -m3 -md=128K 61 | 62 | Name: testarchive/file3.txt 63 | Type: File 64 | Size: 32 65 | Packed size: 32 66 | Ratio: 100% 67 | mtime: 2015-05-13 17:26:42,000 68 | Attributes: -rw-rw-r-- 69 | CRC32: 99D12E31 70 | Host OS: Unix 71 | Compression: RAR 5.0(v50) -m3 -md=128K 72 | 73 | Name: testarchive/dir2 74 | Type: Directory 75 | mtime: 2015-05-14 01:43:41,000 76 | Attributes: drwxrwxr-x 77 | CRC32: 00000000 78 | Host OS: Unix 79 | Compression: RAR 5.0(v50) -m0 -md=0K 80 | 81 | Name: testarchive/dir1 82 | Type: Directory 83 | mtime: 2015-05-14 01:45:24,000 84 | Attributes: drwxrwxr-x 85 | CRC32: 00000000 86 | Host OS: Unix 87 | Compression: RAR 5.0(v50) -m0 -md=0K 88 | 89 | Name: testarchive 90 | Type: Directory 91 | mtime: 2016-10-09 19:01:48,000 92 | Attributes: drwxrwxr-x 93 | CRC32: 00000000 94 | Host OS: Unix 95 | Compression: RAR 5.0(v50) -m0 -md=0K 96 | 97 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-corrupt-file-header-unrar3.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 3.90 beta 3 freeware Copyright (c) 1993-2009 Alexander Roshal 3 | 4 | Volume foo.r45 5 | 6 | Recovery record is present 7 | 8 | Pathname/Comment 9 | Size Packed Ratio Date Time Attr CRC Meth Ver 10 | Host OS Solid Old 11 | ------------------------------------------------------------------------------- 12 | some-file.ext 13 | 732522496 14851208 <-> 29-10-10 20:47 .....A. 0868E5EA m0g 2.0 14 | Win95/NT No No 15 | Data header type: RR 16 | RR 17 | 148638 148638 100% 00-00-80 00:00 .....B 3622BF05 m0a 2.9 18 | Win95/NT No No 19 | ??? - the file header is corrupt 20 | ------------------------------------------------------------------------------- 21 | 0 0 14851208 0% volume 46 22 | 23 | 1 732522496 732522496 100% 24 | 25 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-corrupt-file-header-unrar4.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 4.20 freeware Copyright (c) 1993-2012 Alexander Roshal 3 | 4 | file1.txt - the file header is corrupt 5 | Archive testarchive-corrupt.rar 6 | 7 | file1.txt - the file header is corrupt 8 | Pathname/Comment 9 | Size Packed Ratio Date Time Attr CRC Meth Ver 10 | Host OS Solid Old 11 | ------------------------------------------------------------------------------- 12 | file1.txt 13 | 32 33 103% 26-07-15 19:04 -rw-rw-r-- 034EE5C7 m3b 2.9 14 | Unix No No 15 | file2.txt 16 | 32 32 100% 18-05-15 14:57 -rw-rw-r-- D49ECBCA m3b 2.9 17 | Unix No No 18 | file3.txt 19 | 32 32 100% 13-05-15 17:26 -rw-rw-r-- 99D12E31 m3b 2.9 20 | Unix No No 21 | file4.txt 22 | 32 33 103% 26-07-15 18:53 -rw-rw-r-- A04F9191 m3b 2.9 23 | Unix No No 24 | dir1/file1.txt 25 | 32 33 103% 17-05-15 20:41 -rw-rw-r-- 034EE5C7 m3b 2.9 26 | Unix No No 27 | dir2/file2.txt 28 | 32 32 100% 17-05-15 20:41 -rw-rw-r-- D49ECBCA m3b 2.9 29 | Unix No No 30 | dir1 31 | 0 0 0% 14-05-15 01:45 drwxrwxr-x 00000000 m0 2.0 32 | Unix No No 33 | dir2 34 | 0 0 0% 14-05-15 01:43 drwxrwxr-x 00000000 m0 2.0 35 | Unix No No 36 | ------------------------------------------------------------------------------- 37 | 8 192 195 101% 38 | 39 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-corrupt-file-header-unrar5.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 5.31 freeware Copyright (c) 1993-2016 Alexander Roshal 3 | 4 | file1.txt - the file header is corrupt 5 | Archive: testarchive-corrupt.rar 6 | Details: RAR 4 7 | 8 | file1.txt - the file header is corrupt 9 | Name: file1.txt 10 | Type: File 11 | Size: 32 12 | Packed size: 33 13 | Ratio: 103% 14 | mtime: 2015-07-26 19:04:38,000 15 | Attributes: -rw-rw-r-- 16 | CRC32: 034EE5C7 17 | Host OS: Unix 18 | Compression: RAR 3.0(v29) -m3 -md=128K 19 | 20 | Name: file2.txt 21 | Type: File 22 | Size: 32 23 | Packed size: 32 24 | Ratio: 100% 25 | mtime: 2015-05-18 14:57:37,000 26 | Attributes: -rw-rw-r-- 27 | CRC32: D49ECBCA 28 | Host OS: Unix 29 | Compression: RAR 3.0(v29) -m3 -md=128K 30 | 31 | Name: file3.txt 32 | Type: File 33 | Size: 32 34 | Packed size: 32 35 | Ratio: 100% 36 | mtime: 2015-05-13 17:26:42,000 37 | Attributes: -rw-rw-r-- 38 | CRC32: 99D12E31 39 | Host OS: Unix 40 | Compression: RAR 3.0(v29) -m3 -md=128K 41 | 42 | Name: file4.txt 43 | Type: File 44 | Size: 32 45 | Packed size: 33 46 | Ratio: 103% 47 | mtime: 2015-07-26 18:53:21,000 48 | Attributes: -rw-rw-r-- 49 | CRC32: A04F9191 50 | Host OS: Unix 51 | Compression: RAR 3.0(v29) -m3 -md=128K 52 | 53 | Name: dir1/file1.txt 54 | Type: File 55 | Size: 32 56 | Packed size: 33 57 | Ratio: 103% 58 | mtime: 2015-05-17 20:41:48,000 59 | Attributes: -rw-rw-r-- 60 | CRC32: 034EE5C7 61 | Host OS: Unix 62 | Compression: RAR 3.0(v29) -m3 -md=128K 63 | 64 | Name: dir2/file2.txt 65 | Type: File 66 | Size: 32 67 | Packed size: 32 68 | Ratio: 100% 69 | mtime: 2015-05-17 20:41:48,000 70 | Attributes: -rw-rw-r-- 71 | CRC32: D49ECBCA 72 | Host OS: Unix 73 | Compression: RAR 3.0(v29) -m3 -md=128K 74 | 75 | Name: dir1 76 | Type: Directory 77 | mtime: 2015-05-14 01:45:24,000 78 | Attributes: drwxrwxr-x 79 | CRC32: 00000000 80 | Host OS: Unix 81 | Compression: RAR 3.0(v20) -m0 -md=0K 82 | 83 | Name: dir2 84 | Type: Directory 85 | mtime: 2015-05-14 01:43:41,000 86 | Attributes: drwxrwxr-x 87 | CRC32: 00000000 88 | Host OS: Unix 89 | Compression: RAR 3.0(v20) -m0 -md=0K 90 | 91 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-encrypted-unrar4.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 4.20 freeware Copyright (c) 1993-2012 Alexander Roshal 3 | 4 | Archive rartestenc.rar 5 | 6 | Pathname/Comment 7 | Size Packed Ratio Date Time Attr CRC Meth Ver 8 | Host OS Solid Old 9 | ------------------------------------------------------------------------------- 10 | *rartest/file4.txt 11 | 32 48 150% 21-03-16 17:03 -rw-rw-r-- A04F9191 m3b 2.9 12 | Unix No No 13 | *rartest/file1.txt 14 | 32 48 150% 21-03-16 17:03 -rw-rw-r-- 034EE5C7 m3b 2.9 15 | Unix No No 16 | *rartest/file2.txt 17 | 14 32 228% 21-03-16 17:03 -rw-rw-r-- A5BA4A7B m3b 2.9 18 | Unix No No 19 | *rartest/dir1/file11.txt 20 | 32 48 150% 21-03-16 17:03 -rw-rw-r-- 034EE5C7 m3b 2.9 21 | Unix No No 22 | *rartest/file3.txt 23 | 32 32 100% 21-03-16 17:03 -rw-rw-r-- 99D12E31 m3b 2.9 24 | Unix No No 25 | rartest/dir1 26 | 0 0 0% 21-03-16 17:03 drwxrwxr-x 00000000 m0 2.9 27 | Unix No No 28 | rartest 29 | 0 0 0% 21-03-16 17:03 drwxrwxr-x 00000000 m0 2.9 30 | Unix No No 31 | ------------------------------------------------------------------------------- 32 | 7 142 208 146% 33 | 34 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-encrypted-unrar5.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 5.31 freeware Copyright (c) 1993-2016 Alexander Roshal 3 | 4 | Archive: rartestenc.rar 5 | Details: RAR 4 6 | 7 | Name: rartest/file4.txt 8 | Type: File 9 | Size: 32 10 | Packed size: 48 11 | Ratio: 150% 12 | mtime: 2016-03-21 17:03:36,000 13 | Attributes: -rw-rw-r-- 14 | CRC32: A04F9191 15 | Host OS: Unix 16 | Compression: RAR 3.0(v29) -m3 -md=128K 17 | Flags: encrypted 18 | 19 | Name: rartest/file1.txt 20 | Type: File 21 | Size: 32 22 | Packed size: 48 23 | Ratio: 150% 24 | mtime: 2016-03-21 17:03:36,000 25 | Attributes: -rw-rw-r-- 26 | CRC32: 034EE5C7 27 | Host OS: Unix 28 | Compression: RAR 3.0(v29) -m3 -md=128K 29 | Flags: encrypted 30 | 31 | Name: rartest/file2.txt 32 | Type: File 33 | Size: 14 34 | Packed size: 32 35 | Ratio: 228% 36 | mtime: 2016-03-21 17:03:36,000 37 | Attributes: -rw-rw-r-- 38 | CRC32: A5BA4A7B 39 | Host OS: Unix 40 | Compression: RAR 3.0(v29) -m3 -md=128K 41 | Flags: encrypted 42 | 43 | Name: rartest/dir1/file11.txt 44 | Type: File 45 | Size: 32 46 | Packed size: 48 47 | Ratio: 150% 48 | mtime: 2016-03-21 17:03:36,000 49 | Attributes: -rw-rw-r-- 50 | CRC32: 034EE5C7 51 | Host OS: Unix 52 | Compression: RAR 3.0(v29) -m3 -md=128K 53 | Flags: encrypted 54 | 55 | Name: rartest/file3.txt 56 | Type: File 57 | Size: 32 58 | Packed size: 32 59 | Ratio: 100% 60 | mtime: 2016-03-21 17:03:36,000 61 | Attributes: -rw-rw-r-- 62 | CRC32: 99D12E31 63 | Host OS: Unix 64 | Compression: RAR 3.0(v29) -m3 -md=128K 65 | Flags: encrypted 66 | 67 | Name: rartest/dir1 68 | Type: Directory 69 | mtime: 2016-03-21 17:03:36,000 70 | Attributes: drwxrwxr-x 71 | CRC32: 00000000 72 | Host OS: Unix 73 | Compression: RAR 3.0(v29) -m0 -md=0K 74 | 75 | Name: rartest 76 | Type: Directory 77 | mtime: 2016-03-21 17:03:44,000 78 | Attributes: drwxrwxr-x 79 | CRC32: 00000000 80 | Host OS: Unix 81 | Compression: RAR 3.0(v29) -m0 -md=0K 82 | 83 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-multivol-unrar5.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 5.40 beta 2 freeware Copyright (c) 1993-2016 Alexander Roshal 3 | 4 | Archive: testmultivol.part1.rar 5 | Details: RAR 4, volume 6 | 7 | Name: largefile1 8 | Type: File 9 | Size: 2097152 10 | Packed size: 1048494 11 | Ratio: --> 12 | mtime: 2016-07-17 11:25:56,000 13 | Attributes: -rw-rw-r-- 14 | Pack-CRC32: D1D888DB 15 | Host OS: Unix 16 | Compression: RAR 3.0(v29) -m3 -md=4M 17 | 18 | Archive: testmultivol.part2.rar 19 | Details: RAR 4, volume 20 | 21 | Name: largefile1 22 | Type: File 23 | Size: 2097152 24 | Packed size: 1048494 25 | Ratio: <-> 26 | mtime: 2016-07-17 11:25:56,000 27 | Attributes: -rw-rw-r-- 28 | Pack-CRC32: 034C76D1 29 | Host OS: Unix 30 | Compression: RAR 3.0(v29) -m3 -md=4M 31 | 32 | Archive: testmultivol.part3.rar 33 | Details: RAR 4, volume 34 | 35 | Name: largefile1 36 | Type: File 37 | Size: 2097152 38 | Packed size: 5613 39 | Ratio: <-- 40 | mtime: 2016-07-17 11:25:56,000 41 | Attributes: -rw-rw-r-- 42 | CRC32: 147E8FFD 43 | Host OS: Unix 44 | Compression: RAR 3.0(v29) -m3 -md=4M 45 | 46 | Name: largefile2 47 | Type: File 48 | Size: 2097152 49 | Packed size: 1042837 50 | Ratio: --> 51 | mtime: 2016-07-17 11:26:19,000 52 | Attributes: -rw-rw-r-- 53 | Pack-CRC32: 0B319F93 54 | Host OS: Unix 55 | Compression: RAR 3.0(v29) -m3 -md=4M 56 | 57 | Archive: testmultivol.part4.rar 58 | Details: RAR 4, volume 59 | 60 | Name: largefile2 61 | Type: File 62 | Size: 2097152 63 | Packed size: 1048492 64 | Ratio: <-> 65 | mtime: 2016-07-17 11:26:19,000 66 | Attributes: -rw-rw-r-- 67 | Pack-CRC32: BE13353A 68 | Host OS: Unix 69 | Compression: RAR 3.0(v29) -m3 -md=4M 70 | 71 | Archive: testmultivol.part5.rar 72 | Details: RAR 4, volume 73 | 74 | Name: largefile2 75 | Type: File 76 | Size: 2097152 77 | Packed size: 11231 78 | Ratio: <-- 79 | mtime: 2016-07-17 11:26:19,000 80 | Attributes: -rw-rw-r-- 81 | CRC32: 934DAE71 82 | Host OS: Unix 83 | Compression: RAR 3.0(v29) -m3 -md=4M 84 | 85 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-recovery-record-unrar4.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 4.20 freeware Copyright (c) 1993-2012 Alexander Roshal 3 | 4 | Archive testrr.rar 5 | 6 | Recovery record is present 7 | 8 | Pathname/Comment 9 | Size Packed Ratio Date Time Attr CRC Meth Ver 10 | Host OS Solid Old 11 | ------------------------------------------------------------------------------- 12 | file1.txt 13 | 32 33 103% 26-07-15 19:04 -rw-rw-r-- 034EE5C7 m3b 2.9 14 | Unix No No 15 | file2.txt 16 | 32 32 100% 18-05-15 14:57 -rw-rw-r-- D49ECBCA m3b 2.9 17 | Unix No No 18 | file3.txt 19 | 32 32 100% 13-05-15 17:26 -rw-rw-r-- 99D12E31 m3b 2.9 20 | Unix No No 21 | Data header type: RR 22 | RR 23 | 514 514 100% 27-07-15 19:21 .....B C6807093 m0a 2.9 24 | Unix No No 25 | ------------------------------------------------------------------------------- 26 | 3 96 97 101% 27 | 28 | 29 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-recovery-record-unrar5.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 5.30 beta 2 freeware Copyright (c) 1993-2015 Alexander Roshal 3 | 4 | Archive: testrr.rar 5 | Details: RAR 4, recovery record 6 | 7 | Name: file1.txt 8 | Type: File 9 | Size: 32 10 | Packed size: 33 11 | Ratio: 103% 12 | mtime: 2015-07-26 19:04:38,000 13 | Attributes: -rw-rw-r-- 14 | CRC32: 034EE5C7 15 | Host OS: Unix 16 | Compression: RAR 3.0(v29) -m3 -md=128K 17 | 18 | Name: file2.txt 19 | Type: File 20 | Size: 32 21 | Packed size: 32 22 | Ratio: 100% 23 | mtime: 2015-05-18 14:57:37,000 24 | Attributes: -rw-rw-r-- 25 | CRC32: D49ECBCA 26 | Host OS: Unix 27 | Compression: RAR 3.0(v29) -m3 -md=128K 28 | 29 | Name: file3.txt 30 | Type: File 31 | Size: 32 32 | Packed size: 32 33 | Ratio: 100% 34 | mtime: 2015-05-13 17:26:42,000 35 | Attributes: -rw-rw-r-- 36 | CRC32: 99D12E31 37 | Host OS: Unix 38 | Compression: RAR 3.0(v29) -m3 -md=128K 39 | 40 | 41 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-with-symlink-unrar4.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 4.20 freeware Copyright (c) 1993-2012 Alexander Roshal 3 | 4 | Archive rartest.rar 5 | 6 | Pathname/Comment 7 | Size Packed Ratio Date Time Attr CRC Meth Ver 8 | Host OS Solid Old 9 | ------------------------------------------------------------------------------- 10 | rartest/file4.txt 11 | 32 33 103% 21-03-16 08:57 -rw-rw-r-- A04F9191 m3g 2.9 12 | Unix No No 13 | rartest/file1.txt 14 | 32 33 103% 21-03-16 08:57 -rw-rw-r-- 034EE5C7 m3g 2.9 15 | Unix No No 16 | rartest/file2.txt 17 | 14 23 164% 21-03-16 08:57 -rw-rw-r-- A5BA4A7B m3g 2.9 18 | Unix No No 19 | rartest/linktofile1.txt 20 | 9 9 100% 21-03-16 08:58 lrwxrwxrwx 2D212004 m0g 2.0 21 | Unix No No 22 | --> file1.txt 23 | rartest/dir1/file11.txt 24 | 32 33 103% 21-03-16 08:58 -rw-rw-r-- 034EE5C7 m3g 2.9 25 | Unix No No 26 | rartest/file3.txt 27 | 32 32 100% 21-03-16 08:57 -rw-rw-r-- 99D12E31 m3g 2.9 28 | Unix No No 29 | rartest/dir1 30 | 0 0 0% 21-03-16 08:58 drwxrwxr-x 00000000 m0 2.0 31 | Unix No No 32 | rartest 33 | 0 0 0% 21-03-16 08:58 drwxrwxr-x 00000000 m0 2.0 34 | Unix No No 35 | ------------------------------------------------------------------------------- 36 | 8 151 163 107% 37 | 38 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/archive-with-symlink-unrar5.txt: -------------------------------------------------------------------------------- 1 | 2 | UNRAR 5.31 freeware Copyright (c) 1993-2016 Alexander Roshal 3 | 4 | Archive: rartest.rar 5 | Details: RAR 4 6 | 7 | Name: rartest/file4.txt 8 | Type: File 9 | Size: 32 10 | Packed size: 33 11 | Ratio: 103% 12 | mtime: 2016-03-21 08:57:36,000 13 | Attributes: -rw-rw-r-- 14 | CRC32: A04F9191 15 | Host OS: Unix 16 | Compression: RAR 3.0(v29) -m3 -md=4M 17 | 18 | Name: rartest/file1.txt 19 | Type: File 20 | Size: 32 21 | Packed size: 33 22 | Ratio: 103% 23 | mtime: 2016-03-21 08:57:36,000 24 | Attributes: -rw-rw-r-- 25 | CRC32: 034EE5C7 26 | Host OS: Unix 27 | Compression: RAR 3.0(v29) -m3 -md=4M 28 | 29 | Name: rartest/file2.txt 30 | Type: File 31 | Size: 14 32 | Packed size: 23 33 | Ratio: 164% 34 | mtime: 2016-03-21 08:57:36,000 35 | Attributes: -rw-rw-r-- 36 | CRC32: A5BA4A7B 37 | Host OS: Unix 38 | Compression: RAR 3.0(v29) -m3 -md=4M 39 | 40 | Name: rartest/linktofile1.txt 41 | Type: Unix symbolic link 42 | Target: file1.txt 43 | Size: 9 44 | Packed size: 9 45 | Ratio: 100% 46 | mtime: 2016-03-21 08:58:16,000 47 | Attributes: lrwxrwxrwx 48 | CRC32: 2D212004 49 | Host OS: Unix 50 | Compression: RAR 3.0(v20) -m0 -md=4M 51 | 52 | Name: rartest/dir1/file11.txt 53 | Type: File 54 | Size: 32 55 | Packed size: 33 56 | Ratio: 103% 57 | mtime: 2016-03-21 08:58:40,000 58 | Attributes: -rw-rw-r-- 59 | CRC32: 034EE5C7 60 | Host OS: Unix 61 | Compression: RAR 3.0(v29) -m3 -md=4M 62 | 63 | Name: rartest/file3.txt 64 | Type: File 65 | Size: 32 66 | Packed size: 32 67 | Ratio: 100% 68 | mtime: 2016-03-21 08:57:36,000 69 | Attributes: -rw-rw-r-- 70 | CRC32: 99D12E31 71 | Host OS: Unix 72 | Compression: RAR 3.0(v29) -m3 -md=4M 73 | 74 | Name: rartest/dir1 75 | Type: Directory 76 | mtime: 2016-03-21 08:58:40,000 77 | Attributes: drwxrwxr-x 78 | CRC32: 00000000 79 | Host OS: Unix 80 | Compression: RAR 3.0(v20) -m0 -md=0K 81 | 82 | Name: rartest 83 | Type: Directory 84 | mtime: 2016-03-21 08:58:24,000 85 | Attributes: drwxrwxr-x 86 | CRC32: 00000000 87 | Host OS: Unix 88 | Compression: RAR 3.0(v20) -m0 -md=0K 89 | 90 | -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/locked_archive.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/clirarplugin/data/locked_archive.rar -------------------------------------------------------------------------------- /autotests/plugins/clirarplugin/data/one_toplevel_folder.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/clirarplugin/data/one_toplevel_folder.rar -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 2 | 3 | include_directories(${CMAKE_SOURCE_DIR}/plugins/cliunarchiverplugin/) 4 | 5 | file(COPY ${CMAKE_BINARY_DIR}/plugins/cliunarchiverplugin/kerfuffle_cliunarchiver.json 6 | DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 7 | 8 | ecm_add_test( 9 | cliunarchivertest.cpp 10 | ${CMAKE_SOURCE_DIR}/plugins/cliunarchiverplugin/cliplugin.cpp 11 | ${CMAKE_BINARY_DIR}/plugins/cliunarchiverplugin/ark_debug.cpp 12 | LINK_LIBRARIES testhelper kerfuffle Qt::Test 13 | TEST_NAME cliunarchivertest 14 | NAME_PREFIX plugins-) 15 | 16 | # cliunarchiver plugin needs exceptions enabled 17 | kde_target_enable_exceptions(cliunarchivertest PRIVATE) 18 | -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/cliunarchivertest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef CLIUNARCHIVERTEST_H 8 | #define CLIUNARCHIVERTEST_H 9 | 10 | #include "cliplugin.h" 11 | #include "pluginmanager.h" 12 | 13 | using namespace Kerfuffle; 14 | 15 | class CliUnarchiverTest : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | private Q_SLOTS: 20 | 21 | void initTestCase(); 22 | void testArchive_data(); 23 | void testArchive(); 24 | void testList_data(); 25 | void testList(); 26 | void testListArgs_data(); 27 | void testListArgs(); 28 | void testExtraction_data(); 29 | void testExtraction(); 30 | void testExtractArgs_data(); 31 | void testExtractArgs(); 32 | 33 | private: 34 | PluginManager m_pluginManger; 35 | Plugin *m_plugin; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/data/README: -------------------------------------------------------------------------------- 1 | Test data for the cliunarchiver's unit tests. 2 | 3 | * The password for encrypted_entries.rar is 'asdasd' (without quotes). 4 | -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/data/empty_folders.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cliunarchiverplugin/data/empty_folders.rar -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/data/encrypted_entries.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cliunarchiverplugin/data/encrypted_entries.rar -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/data/hidden_files.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cliunarchiverplugin/data/hidden_files.rar -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/data/multiple_toplevel_entries.lha: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cliunarchiverplugin/data/multiple_toplevel_entries.lha -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/data/multiple_toplevel_entries.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cliunarchiverplugin/data/multiple_toplevel_entries.rar -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/data/one_toplevel_folder.lha: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cliunarchiverplugin/data/one_toplevel_folder.lha -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/data/one_toplevel_folder.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cliunarchiverplugin/data/one_toplevel_folder.rar -------------------------------------------------------------------------------- /autotests/plugins/cliunarchiverplugin/data/test.sit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/autotests/plugins/cliunarchiverplugin/data/test.sit -------------------------------------------------------------------------------- /autotests/plugins/clizipplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 2 | 3 | include_directories(${CMAKE_SOURCE_DIR}/plugins/clizipplugin/) 4 | 5 | file(COPY ${CMAKE_BINARY_DIR}/plugins/clizipplugin/kerfuffle_clizip.json 6 | DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 7 | 8 | ecm_add_test( 9 | cliziptest.cpp 10 | ${CMAKE_SOURCE_DIR}/plugins/clizipplugin/cliplugin.cpp 11 | ${CMAKE_BINARY_DIR}/plugins/clizipplugin/ark_debug.cpp 12 | LINK_LIBRARIES testhelper kerfuffle Qt::Test 13 | TEST_NAME cliziptest 14 | NAME_PREFIX plugins-) 15 | -------------------------------------------------------------------------------- /autotests/plugins/clizipplugin/cliziptest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef CLIZIPTEST_H 8 | #define CLIZIPTEST_H 9 | 10 | #include "pluginmanager.h" 11 | 12 | using namespace Kerfuffle; 13 | 14 | class CliZipTest : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | private Q_SLOTS: 19 | void initTestCase(); 20 | void testListArgs_data(); 21 | void testListArgs(); 22 | void testAddArgs_data(); 23 | void testAddArgs(); 24 | void testExtractArgs_data(); 25 | void testExtractArgs(); 26 | 27 | private: 28 | PluginManager m_pluginManger; 29 | Plugin *m_plugin; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /autotests/testhelper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 2 | 3 | set(TESTHELPER_SOURCES 4 | abstractaddtest.cpp 5 | testhelper.cpp) 6 | 7 | add_library(testhelper STATIC ${TESTHELPER_SOURCES}) 8 | target_link_libraries(testhelper Qt::Test kerfuffle) 9 | -------------------------------------------------------------------------------- /autotests/testhelper/abstractaddtest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Vladyslav Batyrenko 3 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 4 | 5 | SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #include "abstractaddtest.h" 9 | 10 | #include "jobs.h" 11 | #include "testhelper.h" 12 | 13 | #include 14 | #include 15 | 16 | using namespace Kerfuffle; 17 | 18 | QStringList AbstractAddTest::getEntryPaths(Archive *archive) 19 | { 20 | QStringList paths; 21 | auto loadJob = Archive::load(archive->fileName()); 22 | QObject::connect(loadJob, &Job::newEntry, [&paths](Archive::Entry *entry) { 23 | paths << entry->fullPath(); 24 | }); 25 | TestHelper::startAndWaitForResult(loadJob); 26 | 27 | return paths; 28 | } 29 | 30 | void AbstractAddTest::setupRows(const QString &testName, 31 | const QString &archiveName, 32 | const QList &targetEntries, 33 | Archive::Entry *destination, 34 | const QStringList &expectedNewPaths, 35 | uint numberOfEntries) const 36 | { 37 | // Repeat the same test case for each format and for each plugin supporting the format. 38 | const QStringList formats = TestHelper::testFormats(); 39 | for (const QString &format : formats) { 40 | const QString filename = QStringLiteral("%1.%2").arg(archiveName, format); 41 | const auto mime = QMimeDatabase().mimeTypeForFile(filename, QMimeDatabase::MatchExtension); 42 | 43 | const auto plugins = m_pluginManager.preferredWritePluginsFor(mime); 44 | for (const auto plugin : plugins) { 45 | QTest::newRow(QStringLiteral("%1 (%2, %3)").arg(testName, format, plugin->metaData().pluginId()).toUtf8().constData()) 46 | << filename << plugin << targetEntries << destination << expectedNewPaths << numberOfEntries; 47 | } 48 | } 49 | } 50 | 51 | #include "moc_abstractaddtest.cpp" 52 | -------------------------------------------------------------------------------- /autotests/testhelper/abstractaddtest.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Vladyslav Batyrenko 3 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 4 | 5 | SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #ifndef ABSTRACTADDTEST_H 9 | #define ABSTRACTADDTEST_H 10 | 11 | #include "archive_kerfuffle.h" 12 | #include "pluginmanager.h" 13 | 14 | /** 15 | * Base class for tests about Add/Copy/Move jobs. 16 | * Make sure to call the constructor in order to load the plugins. 17 | */ 18 | class AbstractAddTest : public QObject 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | static QStringList getEntryPaths(Kerfuffle::Archive *archive); 24 | 25 | /** 26 | * Setup test cases for each format and for each plugin. 27 | * @param testName Name of the test case shown in the debug output 28 | * @param archiveName Archive name. The extension of the tested formats will be appended to it. 29 | * @param targetEntries Entries passed to the job. 30 | * @param destination Destination entry passed to the job. 31 | * @param expectedNewPaths New expected paths that the job should create. 32 | * @param numberOfEntries Number of entries in the archive expected after the job ends. 33 | */ 34 | void setupRows(const QString &testName, 35 | const QString &archiveName, 36 | const QList &targetEntries, 37 | Kerfuffle::Archive::Entry *destination, 38 | const QStringList &expectedNewPaths, 39 | uint numberOfEntries) const; 40 | 41 | protected: 42 | Kerfuffle::PluginManager m_pluginManager; 43 | }; 44 | 45 | #endif // ABSTRACTADDTEST_H 46 | -------------------------------------------------------------------------------- /autotests/testhelper/testhelper.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Vladyslav Batyrenko 3 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 4 | 5 | SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #include "testhelper.h" 9 | 10 | #include 11 | 12 | #include 13 | 14 | void TestHelper::startAndWaitForResult(KJob *job) 15 | { 16 | QEventLoop eventLoop; 17 | QObject::connect(job, &KJob::result, &eventLoop, &QEventLoop::quit); 18 | job->start(); 19 | eventLoop.exec(); // krazy:exclude=crashy 20 | } 21 | 22 | QStringList TestHelper::testFormats() 23 | { 24 | return {QStringLiteral("7z"), QStringLiteral("rar"), QStringLiteral("tar.bz2"), QStringLiteral("zip")}; 25 | } 26 | -------------------------------------------------------------------------------- /autotests/testhelper/testhelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Vladyslav Batyrenko 3 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 4 | 5 | SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #ifndef TESTHELPER_H 9 | #define TESTHELPER_H 10 | 11 | class KJob; 12 | 13 | #include 14 | 15 | namespace TestHelper 16 | { 17 | void startAndWaitForResult(KJob *job); 18 | 19 | /** 20 | * @return List of format extensions (without the leading dot) to be used in tests. 21 | */ 22 | QStringList testFormats(); 23 | } 24 | 25 | #endif // TESTHELPER_H 26 | -------------------------------------------------------------------------------- /cmake/modules/FindLibZip.cmake: -------------------------------------------------------------------------------- 1 | # Find libzip library and headers 2 | # 3 | # The module defines the following variables: 4 | # 5 | # :: 6 | # 7 | # LibZip_FOUND - true if libzip was found 8 | # LibZip_INCLUDE_DIRS - include search path 9 | # LibZip_LIBRARIES - libraries to link 10 | # LibZip_VERSION - libzip 3-component version number 11 | 12 | find_package(PkgConfig) 13 | pkg_check_modules(PC_LIBZIP QUIET libzip) 14 | 15 | set(LibZip_VERSION ${PC_LIBZIP_VERSION}) 16 | 17 | find_path(LibZip_INCLUDE_DIR zip.h 18 | HINTS ${PC_LIBZIP_INCLUDEDIR}) 19 | 20 | # Contains the version of libzip: 21 | find_path(LibZip_INCLUDE_CONF_DIR zipconf.h 22 | HINTS ${PC_LIBZIP_INCLUDE_DIRS}) 23 | 24 | find_library(LibZip_LIBRARIES 25 | NAMES zip libzip 26 | HINTS ${PC_LIBZIP_LIBDIR}) 27 | 28 | set(LibZip_INCLUDE_DIRS ${LibZip_INCLUDE_DIR} ${LibZip_INCLUDE_CONF_DIR}) 29 | 30 | include(FindPackageHandleStandardArgs) 31 | find_package_handle_standard_args(LibZip 32 | FOUND_VAR LibZip_FOUND 33 | REQUIRED_VARS LibZip_LIBRARIES LibZip_INCLUDE_DIR LibZip_INCLUDE_CONF_DIR 34 | VERSION_VAR LibZip_VERSION) 35 | 36 | if(LibZip_FOUND AND NOT TARGET LibZip::LibZip) 37 | add_library(LibZip::LibZip UNKNOWN IMPORTED) 38 | set_target_properties(LibZip::LibZip PROPERTIES 39 | IMPORTED_LOCATION "${LibZip_LIBRARIES}" 40 | INTERFACE_INCLUDE_DIRECTORIES "${LibZip_INCLUDE_DIRS}" 41 | ) 42 | endif() 43 | 44 | mark_as_advanced(LibZip_INCLUDE_DIR LibZip_INCLUDE_CONF_DIR) 45 | -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | #ifndef ARK_CONFIG_H 2 | #define ARK_CONFIG_H 3 | 4 | #cmakedefine01 LIBZIP_CANCELATION 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### install files ############### 2 | # 3 | kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${KDE_INSTALL_DOCBUNDLEDIR}/en SUBDIR ark) 4 | kdoctools_create_manpage(man-ark.1.docbook 1 INSTALL_DESTINATION ${KDE_INSTALL_MANDIR}) 5 | 6 | -------------------------------------------------------------------------------- /doc/ark-comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/doc/ark-comment.png -------------------------------------------------------------------------------- /doc/ark-mainwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/doc/ark-mainwindow.png -------------------------------------------------------------------------------- /doc/create-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/doc/create-archive.png -------------------------------------------------------------------------------- /doc/create-protected-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/doc/create-protected-archive.png -------------------------------------------------------------------------------- /doc/extract-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/doc/extract-dialog.png -------------------------------------------------------------------------------- /kerfuffle/adddialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Ragnar Thomsen 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef ADDDIALOG_H 8 | #define ADDDIALOG_H 9 | 10 | #include "archive_kerfuffle.h" 11 | #include "compressionoptionswidget.h" 12 | #include "kerfuffle_export.h" 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | 19 | class QUrl; 20 | 21 | namespace Kerfuffle 22 | { 23 | class KERFUFFLE_EXPORT AddDialog : public QDialog 24 | { 25 | Q_OBJECT 26 | public: 27 | explicit AddDialog(QWidget *parent, const QString &title, const QUrl &startDir, const QMimeType &mimeType, const CompressionOptions &opts = {}); 28 | ~AddDialog() override; 29 | QStringList selectedFiles() const; 30 | CompressionOptions compressionOptions() const; 31 | QDialog *optionsDialog = nullptr; 32 | 33 | private: 34 | KFileWidget *m_fileWidget = nullptr; 35 | const QMimeType m_mimeType; 36 | CompressionOptions m_compOptions; 37 | 38 | public Q_SLOTS: 39 | void slotOpenOptions(); 40 | }; 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /kerfuffle/addtoarchive.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Harald Hvaal 3 | SPDX-FileCopyrightText: 2009 Raphael Kubo da Costa 4 | 5 | SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #ifndef ADDTOARCHIVE_H 9 | #define ADDTOARCHIVE_H 10 | 11 | #include "archive_kerfuffle.h" 12 | #include "kerfuffle_export.h" 13 | 14 | #include 15 | 16 | #include 17 | 18 | /** 19 | * Compresses all input files into an archive. 20 | * 21 | * This is a job class that creates a compressed archive 22 | * with all the given input files. 23 | * 24 | * It provides the functionality for the --add command-line 25 | * option, and does not need the GUI to be running. 26 | * 27 | * @author Harald Hvaal 28 | */ 29 | namespace Kerfuffle 30 | { 31 | class KERFUFFLE_EXPORT AddToArchive : public KJob 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit AddToArchive(QObject *parent = nullptr); 37 | ~AddToArchive() override; 38 | 39 | bool showAddDialog(QWidget *parentWidget); 40 | void setPreservePaths(bool value); 41 | void setChangeToFirstPath(bool value); 42 | void setImmediateProgressReporting(bool immediateProgressReporting); 43 | static QString getFileNameForEntries(const QList &entries, const QString &suffix); 44 | static QString getFileNameForUrls(const QList &entries, const QString &suffix); 45 | 46 | QString fileName() const 47 | { 48 | return m_filename; 49 | } 50 | 51 | public Q_SLOTS: 52 | bool addInput(const QUrl &url); 53 | void setAutoFilenameSuffix(const QString &suffix); 54 | void setFilename(const QUrl &path); 55 | void setMimeType(const QString &mimeType); 56 | void setPassword(const QString &password); 57 | void setHeaderEncryptionEnabled(bool enabled); 58 | void start() override; 59 | 60 | protected: 61 | bool doKill() override; 62 | 63 | private Q_SLOTS: 64 | void slotFinished(KJob *); 65 | void slotStartJob(); 66 | 67 | private: 68 | void detectFileName(); 69 | bool confirmAndDelete(const QString &targetFile); 70 | 71 | CompressionOptions m_options; 72 | CreateJob *m_createJob = nullptr; 73 | QString m_filename; 74 | QString m_strippedPath; 75 | QString m_autoFilenameSuffix; 76 | QString m_firstPath; 77 | QString m_mimeType; 78 | QString m_password; 79 | QList m_entries; 80 | bool m_changeToFirstPath; 81 | bool m_enableHeaderEncryption; 82 | bool m_immediateProgressReporting; 83 | }; 84 | } 85 | 86 | #endif // ADDTOARCHIVE_H 87 | -------------------------------------------------------------------------------- /kerfuffle/ark.kcfg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Preview 19 | 20 | 21 | 22 | 23 | 24 | false 25 | 26 | 27 | 28 | false 29 | 30 | 31 | 32 | true 33 | 34 | 35 | 36 | true 37 | 38 | 39 | 40 | 41 | 42 | 200,100 43 | 44 | 45 | 46 | true 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | true 57 | 58 | 59 | 60 | 200 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /kerfuffle/compressionoptionswidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Ragnar Thomsen 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef COMPRESSIONOPTIONSWIDGET_H 8 | #define COMPRESSIONOPTIONSWIDGET_H 9 | 10 | #include "archive_kerfuffle.h" 11 | #include "archiveformat.h" 12 | #include "kerfuffle_export.h" 13 | #include "ui_compressionoptionswidget.h" 14 | 15 | #include 16 | #include 17 | 18 | namespace Kerfuffle 19 | { 20 | class KERFUFFLE_EXPORT CompressionOptionsWidget : public QWidget, public Ui::CompressionOptionsWidget 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | explicit CompressionOptionsWidget(QWidget *parent = nullptr, const CompressionOptions &opts = {}); 26 | int compressionLevel() const; 27 | QString compressionMethod() const; 28 | QString encryptionMethod() const; 29 | ulong volumeSize() const; 30 | QString password() const; 31 | CompressionOptions commpressionOptions() const; 32 | bool isEncryptionAvailable() const; 33 | bool isEncryptionEnabled() const; 34 | bool isHeaderEncryptionAvailable() const; 35 | bool isHeaderEncryptionEnabled() const; 36 | KNewPasswordWidget::PasswordStatus passwordStatus() const; 37 | 38 | void setEncryptionVisible(bool visible); 39 | void setMimeType(const QMimeType &mimeType); 40 | 41 | private: 42 | void updateWidgets(); 43 | ArchiveFormat archiveFormat() const; 44 | 45 | QMimeType m_mimetype; 46 | CompressionOptions m_opts; 47 | 48 | private Q_SLOTS: 49 | void slotMultiVolumeChecked(int state); 50 | void slotCompMethodChanged(const QString &value); 51 | void slotEncryptionMethodChanged(const QString &value); 52 | }; 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /kerfuffle/createdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Harald Hvaal 3 | SPDX-FileCopyrightText: 2009 Raphael Kubo da Costa 4 | SPDX-FileCopyrightText: 2015 Elvis Angelaccio 5 | SPDX-FileCopyrightText: 2016 Ragnar Thomsen 6 | 7 | SPDX-License-Identifier: BSD-2-Clause 8 | */ 9 | 10 | #ifndef CREATEDIALOG_H 11 | #define CREATEDIALOG_H 12 | 13 | #include "archive_kerfuffle.h" 14 | #include "kerfuffle_export.h" 15 | #include "pluginmanager.h" 16 | 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | class QUrl; 23 | class QVBoxLayout; 24 | 25 | namespace Kerfuffle 26 | { 27 | class KERFUFFLE_EXPORT CreateDialog : public QDialog 28 | { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit CreateDialog(QWidget *parent, const QString &caption, const QUrl &startDir); 33 | void setFileName(const QString &fileName); 34 | QUrl selectedUrl() const; 35 | QString password() const; 36 | QMimeType currentMimeType() const; 37 | bool setMimeType(const QString &mimeTypeName); 38 | int compressionLevel() const; 39 | QString compressionMethod() const; 40 | QString encryptionMethod() const; 41 | ulong volumeSize() const; 42 | 43 | /** 44 | * @return Whether the user can encrypt the new archive. 45 | */ 46 | bool isEncryptionAvailable() const; 47 | 48 | /** 49 | * @return Whether the user has chosen to encrypt the new archive. 50 | */ 51 | bool isEncryptionEnabled() const; 52 | 53 | /** 54 | * @return Whether the user can encrypt the list of files in the new archive. 55 | */ 56 | bool isHeaderEncryptionAvailable() const; 57 | 58 | /** 59 | * @return Whether the user has chosen to encrypt the list of files in the new archive. 60 | */ 61 | bool isHeaderEncryptionEnabled() const; 62 | 63 | public Q_SLOTS: 64 | void accept() override; 65 | 66 | private: 67 | void loadConfiguration(); 68 | 69 | class CreateDialogUI *m_ui; 70 | QVBoxLayout *m_vlayout = nullptr; 71 | KConfigGroup m_config; 72 | QStringList m_supportedMimeTypes; 73 | PluginManager m_pluginManger; 74 | 75 | private Q_SLOTS: 76 | void slotFileNameEdited(const QString &text); 77 | void slotUpdateWidgets(int index); 78 | void slotUpdateDefaultMimeType(); 79 | void slotUpdateFilenameExtension(int index); 80 | void slotCheckFileExist(); 81 | }; 82 | } 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /kerfuffle/extractiondialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Henrique Pinto 3 | SPDX-FileCopyrightText: 2008 Harald Hvaal 4 | 5 | SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #ifndef EXTRACTIONDIALOG_H 9 | #define EXTRACTIONDIALOG_H 10 | 11 | #include "kerfuffle_export.h" 12 | 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | namespace Kerfuffle 19 | { 20 | class KERFUFFLE_EXPORT ExtractionDialog : public QDialog 21 | { 22 | Q_OBJECT 23 | public: 24 | explicit ExtractionDialog(QWidget *parent = nullptr); 25 | ~ExtractionDialog() override; 26 | 27 | void setShowSelectedFiles(bool); 28 | void setExtractToSubfolder(bool); 29 | void setPreservePaths(bool); 30 | void batchModeOption(); 31 | void setOpenDestinationFolderAfterExtraction(bool); 32 | void setCloseAfterExtraction(bool); 33 | void setAutoSubfolder(bool value); 34 | 35 | bool extractAllFiles() const; 36 | bool openDestinationAfterExtraction() const; 37 | bool closeAfterExtraction() const; 38 | bool extractToSubfolder() const; 39 | bool autoSubfolders() const; 40 | bool preservePaths() const; 41 | QUrl destinationDirectory() const; 42 | QString subfolder() const; 43 | 44 | public Q_SLOTS: 45 | void setBusyGui(); 46 | void setReadyGui(); 47 | void setSubfolder(const QString &subfolder); 48 | void setCurrentUrl(const QUrl &url); 49 | void restoreWindowSize(); 50 | 51 | private Q_SLOTS: 52 | void writeSettings(); 53 | void slotAccepted(); 54 | 55 | private: 56 | void loadSettings(); 57 | 58 | class ExtractionDialogUI *m_ui; 59 | KFileWidget *fileWidget = nullptr; 60 | }; 61 | } 62 | 63 | #endif // EXTRACTIONDIALOG_H 64 | -------------------------------------------------------------------------------- /kerfuffle/extractionsettingspage.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "extractionsettingspage.h" 8 | 9 | namespace Kerfuffle 10 | { 11 | ExtractionSettingsPage::ExtractionSettingsPage(QWidget *parent, const QString &name, const QString &iconName) 12 | : SettingsPage(parent, name, iconName) 13 | { 14 | setupUi(this); 15 | } 16 | } 17 | 18 | #include "moc_extractionsettingspage.cpp" 19 | -------------------------------------------------------------------------------- /kerfuffle/extractionsettingspage.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef EXTRACTIONSETTINGSPAGE_H 8 | #define EXTRACTIONSETTINGSPAGE_H 9 | 10 | #include "settingspage.h" 11 | #include "ui_extractionsettingspage.h" 12 | 13 | namespace Kerfuffle 14 | { 15 | class KERFUFFLE_EXPORT ExtractionSettingsPage : public SettingsPage, public Ui::ExtractionSettingsPage 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit ExtractionSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString()); 21 | }; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /kerfuffle/extractionsettingspage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ExtractionSettingsPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 544 10 | 487 11 | 12 | 13 | 14 | 15 | 16 | 17 | Open destination folder after extraction 18 | 19 | 20 | 21 | 22 | 23 | 24 | Close Ark after extraction 25 | 26 | 27 | 28 | 29 | 30 | 31 | Preserve paths when extracting 32 | 33 | 34 | true 35 | 36 | 37 | 38 | 39 | 40 | 41 | Whether to check by default the extraction into subfolder checkbox in the Extraction Dialog, when the archive has more than one top-level entry. 42 | 43 | 44 | Extract to a subfolder if the archive has more than one top-level entry 45 | 46 | 47 | true 48 | 49 | 50 | 51 | 52 | 53 | 54 | Qt::Vertical 55 | 56 | 57 | 58 | 20 59 | 388 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /kerfuffle/generalsettingspage.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "generalsettingspage.h" 8 | 9 | namespace Kerfuffle 10 | { 11 | GeneralSettingsPage::GeneralSettingsPage(QWidget *parent, const QString &name, const QString &iconName) 12 | : SettingsPage(parent, name, iconName) 13 | { 14 | setupUi(this); 15 | } 16 | } 17 | 18 | #include "moc_generalsettingspage.cpp" 19 | -------------------------------------------------------------------------------- /kerfuffle/generalsettingspage.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef GENERALSETTINGSPAGE_H 8 | #define GENERALSETTINGSPAGE_H 9 | 10 | #include "settingspage.h" 11 | #include "ui_generalsettingspage.h" 12 | 13 | namespace Kerfuffle 14 | { 15 | class KERFUFFLE_EXPORT GeneralSettingsPage : public SettingsPage, public Ui::GeneralSettingsPage 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit GeneralSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString()); 21 | }; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /kerfuffle/generalsettingspage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | GeneralSettingsPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 547 10 | 487 11 | 12 | 13 | 14 | 15 | 16 | 17 | When clicking a file in an archive or pressing the Return key: 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | true 28 | 29 | 30 | 31 | 32 | 33 | Pre&view the file with internal previewer 34 | 35 | 36 | true 37 | 38 | 39 | 40 | 41 | 42 | 43 | Open the fi&le with associated application 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Qt::Horizontal 54 | 55 | 56 | 57 | 58 | 59 | 60 | Show a warning when creating zip archives with AES encryption 61 | 62 | 63 | true 64 | 65 | 66 | 67 | 68 | 69 | 70 | Qt::Vertical 71 | 72 | 73 | 74 | 20 75 | 40 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /kerfuffle/metadatabackup.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Kristen McWilliam 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "metadatabackup.h" 8 | 9 | namespace Kerfuffle 10 | { 11 | MetadataBackup::MetadataBackup(const QString &filePath) 12 | { 13 | KFileMetaData::UserMetaData metaData(filePath); 14 | m_tags = metaData.tags(); 15 | m_rating = metaData.rating(); 16 | m_comment = metaData.userComment(); 17 | } 18 | 19 | const QStringList MetadataBackup::tags() const 20 | { 21 | return m_tags; 22 | } 23 | 24 | int MetadataBackup::rating() const 25 | { 26 | return m_rating; 27 | } 28 | 29 | const QString MetadataBackup::comment() const 30 | { 31 | return m_comment; 32 | } 33 | 34 | void MetadataBackup::restore(const QString &filePath) 35 | { 36 | KFileMetaData::UserMetaData metaData(filePath); 37 | metaData.setTags(m_tags); 38 | metaData.setRating(m_rating); 39 | metaData.setUserComment(m_comment); 40 | } 41 | 42 | } // namespace Kerfuffle 43 | -------------------------------------------------------------------------------- /kerfuffle/metadatabackup.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Kristen McWilliam 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | 9 | namespace Kerfuffle 10 | { 11 | /** 12 | * @class MetadataBackup 13 | * @brief A backup of the user metadata for an archive. 14 | * 15 | * When an archive is modified, its user metadata is removed. This class 16 | * holds a backup of the user metadata so that it can be restored after 17 | * the archive has been modified. 18 | */ 19 | class MetadataBackup 20 | { 21 | public: 22 | MetadataBackup(const QString &filePath); 23 | 24 | /** 25 | * @brief The comment for the archive. 26 | */ 27 | const QString comment() const; 28 | 29 | /** 30 | * @brief The rating for the archive. 31 | */ 32 | int rating() const; 33 | 34 | /** 35 | * @brief The tags for the archive. 36 | */ 37 | const QStringList tags() const; 38 | 39 | /** 40 | * @brief Restores the user metadata to the given file. 41 | */ 42 | void restore(const QString &filePath); 43 | 44 | private: 45 | QString m_comment; 46 | int m_rating; 47 | QStringList m_tags; 48 | }; 49 | 50 | } // namespace Kerfuffle 51 | -------------------------------------------------------------------------------- /kerfuffle/mimetypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Ragnar Thomsen 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef MIMETYPES_H 8 | #define MIMETYPES_H 9 | 10 | #include "kerfuffle_export.h" 11 | 12 | #include 13 | 14 | namespace Kerfuffle 15 | { 16 | enum MimePreference { 17 | PreferContentsMime, 18 | PreferExtensionMime, 19 | }; 20 | 21 | /** 22 | * @param filename Absolute path of a file. 23 | * @param mp Whether to prefer extension or contents mime when they disagree. 24 | * @return The mimetype of the given file. 25 | */ 26 | KERFUFFLE_EXPORT QMimeType determineMimeType(const QString &filename, MimePreference mp = PreferContentsMime); 27 | } 28 | 29 | #endif // MIMETYPES_H 30 | -------------------------------------------------------------------------------- /kerfuffle/pluginsettingspage.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef PLUGINSETTINGSPAGE_H 8 | #define PLUGINSETTINGSPAGE_H 9 | 10 | #include "pluginmanager.h" 11 | #include "settingspage.h" 12 | #include "ui_pluginsettingspage.h" 13 | 14 | class QTreeWidgetItem; 15 | 16 | namespace Kerfuffle 17 | { 18 | class KERFUFFLE_EXPORT PluginSettingsPage : public SettingsPage, public Ui::PluginSettingsPage 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit PluginSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString()); 24 | 25 | public Q_SLOTS: 26 | void slotSettingsChanged() override; 27 | void slotDefaultsButtonClicked() override; 28 | 29 | private Q_SLOTS: 30 | void slotItemChanged(QTreeWidgetItem *item); 31 | 32 | private: 33 | QStringList m_toBeDisabled; // List of plugins that will be disabled upon clicking the Apply button. 34 | PluginManager m_pluginManager; 35 | }; 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /kerfuffle/pluginsettingspage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | PluginSettingsPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 547 10 | 487 11 | 12 | 13 | 14 | 15 | 0 16 | 17 | 18 | 0 19 | 20 | 21 | 0 22 | 23 | 24 | 0 25 | 26 | 27 | 28 | 29 | false 30 | 31 | 32 | 2 33 | 34 | 35 | 36 | Name 37 | 38 | 39 | 40 | 41 | Description 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /kerfuffle/previewsettingspage.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "previewsettingspage.h" 8 | 9 | namespace Kerfuffle 10 | { 11 | PreviewSettingsPage::PreviewSettingsPage(QWidget *parent, const QString &name, const QString &iconName) 12 | : SettingsPage(parent, name, iconName) 13 | { 14 | setupUi(this); 15 | connect(kcfg_limitPreviewFileSize, &QCheckBox::toggled, this, &PreviewSettingsPage::slotToggled); 16 | } 17 | 18 | void PreviewSettingsPage::slotToggled(bool enabled) 19 | { 20 | kcfg_previewFileSizeLimit->setEnabled(enabled); 21 | } 22 | } 23 | 24 | #include "moc_previewsettingspage.cpp" 25 | -------------------------------------------------------------------------------- /kerfuffle/previewsettingspage.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef PREVIEWSETTINGSPAGE_H 8 | #define PREVIEWSETTINGSPAGE_H 9 | 10 | #include "settingspage.h" 11 | #include "ui_previewsettingspage.h" 12 | 13 | namespace Kerfuffle 14 | { 15 | class KERFUFFLE_EXPORT PreviewSettingsPage : public SettingsPage, public Ui::PreviewSettingsPage 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit PreviewSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString()); 21 | 22 | private Q_SLOTS: 23 | void slotToggled(bool enabled); 24 | }; 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /kerfuffle/previewsettingspage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | PreviewSettingsPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 547 10 | 487 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | true 20 | 21 | 22 | Disable preview for files larger than: 23 | 24 | 25 | true 26 | 27 | 28 | 29 | 30 | 31 | 32 | megabytes 33 | 34 | 35 | 10 36 | 37 | 38 | 10000 39 | 40 | 41 | 10 42 | 43 | 44 | 200 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | Qt::Vertical 54 | 55 | 56 | 57 | 20 58 | 40 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /kerfuffle/propertiesdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Ragnar Thomsen 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef PROPERTIESDIALOG_H 8 | #define PROPERTIESDIALOG_H 9 | 10 | #include "kerfuffle_export.h" 11 | 12 | #include 13 | #include 14 | 15 | class QLabel; 16 | 17 | namespace Kerfuffle 18 | { 19 | class Archive; 20 | 21 | class KERFUFFLE_EXPORT PropertiesDialog : public QDialog 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | explicit PropertiesDialog(QWidget *parent, Archive *archive, qulonglong numberOfFiles, qulonglong numberOfFolders, qulonglong size); 27 | 28 | private: 29 | QString calcHash(QCryptographicHash::Algorithm algorithm, const QString &path); 30 | void showChecksum(QCryptographicHash::Algorithm algorithm, const QString &fileName, QLabel *label); 31 | 32 | class PropertiesDialogUI *m_ui; 33 | }; 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /kerfuffle/settings.kcfgc: -------------------------------------------------------------------------------- 1 | File=ark.kcfg 2 | ClassName=ArkSettings 3 | Singleton=true 4 | Mutators=true 5 | SetUserTexts=true 6 | IncludeFiles=\"kerfuffle_export.h\" 7 | Visibility=KERFUFFLE_EXPORT 8 | GenerateProperties=true 9 | -------------------------------------------------------------------------------- /kerfuffle/settingsdialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "settingsdialog.h" 8 | 9 | namespace Kerfuffle 10 | { 11 | SettingsDialog::SettingsDialog(QWidget *parent, const QString &name, KCoreConfigSkeleton *config) 12 | : KConfigDialog(parent, name, config) 13 | { 14 | } 15 | 16 | void SettingsDialog::updateWidgetsDefault() 17 | { 18 | Q_EMIT defaultsButtonClicked(); 19 | } 20 | 21 | } 22 | 23 | #include "moc_settingsdialog.cpp" 24 | -------------------------------------------------------------------------------- /kerfuffle/settingsdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef SETTINGSDIALOG_H 8 | #define SETTINGSDIALOG_H 9 | 10 | #include "kerfuffle_export.h" 11 | 12 | #include 13 | 14 | namespace Kerfuffle 15 | { 16 | /** 17 | * A custom KConfigDialog that emits a signal when the Default button has been clicked. 18 | */ 19 | class KERFUFFLE_EXPORT SettingsDialog : public KConfigDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit SettingsDialog(QWidget *parent, const QString &name, KCoreConfigSkeleton *config); 25 | 26 | Q_SIGNALS: 27 | void defaultsButtonClicked(); 28 | 29 | protected Q_SLOTS: 30 | void updateWidgetsDefault() override; 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /kerfuffle/settingspage.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "settingspage.h" 8 | 9 | namespace Kerfuffle 10 | { 11 | SettingsPage::SettingsPage(QWidget *parent, const QString &name, const QString &iconName) 12 | : QWidget(parent) 13 | , m_name(name) 14 | , m_iconName(iconName) 15 | { 16 | } 17 | 18 | QString SettingsPage::name() const 19 | { 20 | return m_name; 21 | } 22 | 23 | QString SettingsPage::iconName() const 24 | { 25 | return m_iconName; 26 | } 27 | 28 | void SettingsPage::slotSettingsChanged() 29 | { 30 | } 31 | 32 | void SettingsPage::slotDefaultsButtonClicked() 33 | { 34 | } 35 | 36 | } 37 | 38 | #include "moc_settingspage.cpp" 39 | -------------------------------------------------------------------------------- /kerfuffle/settingspage.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2015 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef SETTINGSPAGE_H 8 | #define SETTINGSPAGE_H 9 | 10 | #include "kerfuffle_export.h" 11 | 12 | #include 13 | 14 | namespace Kerfuffle 15 | { 16 | class KERFUFFLE_EXPORT SettingsPage : public QWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit SettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString()); 22 | 23 | QString name() const; 24 | QString iconName() const; 25 | 26 | public Q_SLOTS: 27 | virtual void slotSettingsChanged(); 28 | virtual void slotDefaultsButtonClicked(); 29 | 30 | private: 31 | QString m_name; 32 | QString m_iconName; 33 | }; 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /kerfuffle/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2021 Nicolas Fella 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef KERFUFFLE_UTILS_H 8 | #define KERFUFFLE_UTILS_H 9 | 10 | namespace Kerfuffle 11 | { 12 | namespace Util 13 | { 14 | // Get the name segment from a path 15 | // e.g. /foo/bar/bla -> bla 16 | // /foo/bar/ -> bar 17 | QString lastPathSegment(const QString &path) 18 | { 19 | if (path == QLatin1String("/")) { 20 | return path; 21 | } else if (path.endsWith(QLatin1Char('/'))) { 22 | const int index = path.lastIndexOf(QLatin1Char('/'), -2); 23 | return path.mid(index + 1).chopped(1); 24 | } else { 25 | const int index = path.lastIndexOf(QLatin1Char('/')); 26 | return path.mid(index + 1); 27 | } 28 | } 29 | } 30 | } 31 | #endif 32 | -------------------------------------------------------------------------------- /kerfuffle/windows_stat.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Hannah von Reth 3 | SPDX-License-Identifier: BSD-2-Clause 4 | */ 5 | 6 | #ifndef WINDOWS_STAT_H 7 | #define WINDOWS_STAT_H 8 | 9 | #include 10 | 11 | #ifdef Q_OS_WIN 12 | 13 | #ifndef S_ISDIR 14 | #define S_ISDIR(m) ((m & QT_STAT_MASK) == QT_STAT_DIR) /* directory */ 15 | #endif 16 | 17 | // based on libarchive/archive_windows.h 18 | #ifndef S_IRUSR 19 | #define S_IRUSR _S_IREAD 20 | #endif 21 | 22 | #ifndef S_IWUSR 23 | #define S_IWUSR _S_IWRITE 24 | #endif 25 | 26 | #ifndef S_IXUSR 27 | #define S_IXUSR _S_IEXEC 28 | #endif 29 | 30 | #ifndef S_IRGRP 31 | #define S_IRGRP (S_IRUSR >> 3) /* execute/search permission, group */ 32 | #endif 33 | 34 | #ifndef S_IXGRP 35 | #define S_IXGRP (S_IXUSR >> 3) /* read permission, group */ 36 | #endif 37 | 38 | #ifndef S_IWGRP 39 | #define S_IWGRP (S_IWUSR >> 3) /* write permission, group */ 40 | #endif 41 | 42 | #ifndef S_IWOTH 43 | #define S_IWOTH (S_IWGRP >> 3) /* write permission, other */ 44 | #endif 45 | 46 | #ifndef S_IROTH 47 | #define S_IROTH (S_IRGRP >> 3) /* execute/search permission, other */ 48 | #endif 49 | 50 | #ifndef S_IXOTH 51 | #define S_IXOTH (S_IXGRP >> 3) /* read permission, other */ 52 | #endif 53 | 54 | #ifndef S_ISUID 55 | #define S_ISUID 0004000 /* set user id on execution */ 56 | #endif 57 | 58 | #ifndef S_ISGID 59 | #define S_ISGID 0002000 /* set group id on execution */ 60 | #endif 61 | 62 | #ifndef S_ISVTX 63 | #define S_ISVTX 0001000 /* save swapped text even after use */ 64 | #endif 65 | 66 | #endif 67 | 68 | #endif // WINDOWS_STAT_H 69 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/logo.png -------------------------------------------------------------------------------- /part/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(arkpart MODULE) 2 | 3 | target_sources(arkpart PRIVATE 4 | factory.cpp 5 | part.cpp 6 | infopanel.cpp 7 | arkviewer.cpp 8 | archivemodel.cpp 9 | archivesortfiltermodel.cpp 10 | archiveview.cpp 11 | jobtracker.cpp 12 | overwritedialog.cpp 13 | 14 | factory.h 15 | part.h 16 | infopanel.h 17 | arkviewer.h 18 | archivemodel.h 19 | archivesortfiltermodel.h 20 | archiveview.h 21 | jobtracker.h 22 | overwritedialog.h 23 | 24 | arkpart.qrc 25 | ) 26 | 27 | ecm_qt_declare_logging_category(arkpart 28 | HEADER ark_debug.h 29 | IDENTIFIER ARK_LOG 30 | CATEGORY_NAME ark.part DESCRIPTION "Ark KPart" EXPORT ARK) 31 | set(ark_adaptor_SRCS) 32 | qt_add_dbus_adaptor(ark_adaptor_SRCS dnddbusinterface.xml part.h Ark::Part) 33 | target_sources(arkpart PRIVATE ${ark_adaptor_SRCS}) 34 | ki18n_wrap_ui(arkpart 35 | arkviewer.ui 36 | infopanel.ui 37 | jobtracker.ui) 38 | 39 | 40 | target_link_libraries(arkpart kerfuffle KF6::Parts KF6::KIOFileWidgets Qt6::DBus) 41 | 42 | list(POP_BACK SUPPORTED_ARK_MIMETYPES) 43 | list(JOIN SUPPORTED_ARK_MIMETYPES "\", \"" SUPPORTED_ARK_MIMETYPES_JSON) 44 | 45 | configure_file( 46 | ${CMAKE_CURRENT_SOURCE_DIR}/ark_part.json.cmake 47 | ${CMAKE_CURRENT_BINARY_DIR}/ark_part.json 48 | ) 49 | 50 | install(TARGETS arkpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/parts) 51 | -------------------------------------------------------------------------------- /part/archivesortfiltermodel.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Ragnar Thomsen 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | #ifndef ARCHIVESORTFILTERMODEL_H 7 | #define ARCHIVESORTFILTERMODEL_H 8 | 9 | #include 10 | #include 11 | 12 | class ArchiveSortFilterModel : public QSortFilterProxyModel 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit ArchiveSortFilterModel(QObject *parent = nullptr); 18 | ~ArchiveSortFilterModel() override; 19 | 20 | bool lessThan(const QModelIndex &leftIndex, const QModelIndex &rightIndex) const override; 21 | 22 | private: 23 | QCollator m_collator; 24 | }; 25 | 26 | #endif // ARCHIVESORTFILTERMODEL_H 27 | -------------------------------------------------------------------------------- /part/archiveview.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Harald Hvaal 3 | SPDX-FileCopyrightText: 2016 Vladyslav Batyrenko 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef ARCHIVEVIEW_H 9 | #define ARCHIVEVIEW_H 10 | 11 | #include 12 | #include 13 | 14 | class QLineEdit; 15 | 16 | class ArchiveView : public QTreeView 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit ArchiveView(QWidget *parent = nullptr); 22 | void dragEnterEvent(class QDragEnterEvent *event) override; 23 | void dropEvent(class QDropEvent *event) override; 24 | void dragMoveEvent(class QDragMoveEvent *event) override; 25 | void startDrag(Qt::DropActions supportedActions) override; 26 | 27 | /** 28 | * Expand the first level in the view if there is only one root folder. 29 | * Typical use case: an archive with source code. 30 | */ 31 | void expandIfSingleFolder(); 32 | 33 | /** 34 | * Set whether the view should accept drop events. 35 | */ 36 | void setDropsEnabled(bool enabled); 37 | 38 | public Q_SLOTS: 39 | void renameSelectedEntry(); 40 | 41 | protected: 42 | bool eventFilter(QObject *object, QEvent *event) override; 43 | void mouseReleaseEvent(QMouseEvent *event) override; 44 | void keyPressEvent(QKeyEvent *event) override; 45 | 46 | Q_SIGNALS: 47 | void entryChanged(const QString &name); 48 | 49 | private: 50 | void openEntryEditor(const QModelIndex &index); 51 | void closeEntryEditor(); 52 | QModelIndex m_editorIndex; 53 | QLineEdit *m_entryEditor = nullptr; 54 | }; 55 | 56 | class NoHighlightSelectionDelegate : public QStyledItemDelegate 57 | { 58 | Q_OBJECT 59 | 60 | public: 61 | explicit NoHighlightSelectionDelegate(QObject *parent) 62 | : QStyledItemDelegate(parent) 63 | { 64 | } 65 | void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; 66 | }; 67 | 68 | #endif /* ARCHIVEVIEW_H */ 69 | -------------------------------------------------------------------------------- /part/ark_part.rc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | &Archive 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | &File 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | &Settings 30 | 31 | 32 | 33 | 34 | Main Toolbar 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /part/ark_viewer.rc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | &Help 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /part/arkpart.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | ark_part.rc 4 | ark_viewer.rc 5 | 6 | 7 | -------------------------------------------------------------------------------- /part/arkviewer.h: -------------------------------------------------------------------------------- 1 | /* 2 | ark: A program for modifying archives via a GUI. 3 | 4 | SPDX-FileCopyrightText: 2004-2008 Henrique Pinto 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef ARKVIEWER_H 10 | #define ARKVIEWER_H 11 | 12 | #include "ui_arkviewer.h" 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | class ArkViewer : public KParts::MainWindow, public Ui::ArkViewer 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | ~ArkViewer() override; 29 | 30 | static void view(const QString &fileName, const QString &entryPath = QString(), const QMimeType &mimeType = QMimeType()); 31 | 32 | private: 33 | explicit ArkViewer(); 34 | 35 | static KService::Ptr getExternalViewer(const QString &mimeType); 36 | static std::optional getInternalViewer(const QString &mimeType); 37 | 38 | static void openExternalViewer(const KService::Ptr viewer, const QString &fileName); 39 | 40 | static void openInternalViewer(const KPluginMetaData &viewer, const QString &fileName, const QString &entryPath, const QMimeType &mimeType); 41 | 42 | static bool askViewAsPlainText(const QMimeType &mimeType); 43 | 44 | bool viewInInternalViewer(const KPluginMetaData &viewer, const QString &fileName, const QString &entryPath, const QMimeType &mimeType); 45 | 46 | private Q_SLOTS: 47 | void aboutKPart(); 48 | 49 | private: 50 | QPointer m_part; 51 | QString m_fileName; 52 | }; 53 | 54 | #endif // ARKVIEWER_H 55 | -------------------------------------------------------------------------------- /part/arkviewer.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ArkViewer 4 | 5 | 6 | 7 | 0 8 | 0 9 | 800 10 | 600 11 | 12 | 13 | 14 | MainWindow 15 | 16 | 17 | 18 | 19 | 0 20 | 21 | 22 | 0 23 | 24 | 25 | 0 26 | 27 | 28 | 0 29 | 30 | 31 | 0 32 | 33 | 34 | 35 | 36 | 37 | 0 38 | 0 39 | 40 | 41 | 42 | 43 | 0 44 | 45 | 46 | 0 47 | 48 | 49 | 50 | 51 | mime icon 52 | 53 | 54 | 55 | 56 | 57 | 58 | mime comment 59 | 60 | 61 | 62 | 63 | 64 | 65 | Qt::Horizontal 66 | 67 | 68 | 69 | 40 70 | 20 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /part/dnddbusinterface.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /part/factory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2017 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #include "factory.h" 8 | #include "part.h" 9 | #include 10 | 11 | QObject *Factory::create(const char *iface, QWidget *parentWidget, QObject *parent, const QVariantList &args) 12 | { 13 | auto part = new Ark::Part(parentWidget, parent, metaData(), args); 14 | part->setReadWrite(QByteArray(iface) == QByteArray(KParts::ReadWritePart::staticMetaObject.className())); 15 | 16 | return part; 17 | } 18 | 19 | #include "moc_factory.cpp" 20 | -------------------------------------------------------------------------------- /part/factory.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2017 Elvis Angelaccio 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef FACTORY_H 8 | #define FACTORY_H 9 | 10 | #include 11 | 12 | class Factory : public KPluginFactory 13 | { 14 | Q_OBJECT 15 | Q_PLUGIN_METADATA(IID KPluginFactory_iid FILE "ark_part.json") 16 | Q_INTERFACES(KPluginFactory) 17 | 18 | protected: 19 | QObject *create(const char *iface, QWidget *parentWidget, QObject *parent, const QVariantList &args) override; 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /part/infopanel.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Henrique Pinto 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef INFOPANEL_H 8 | #define INFOPANEL_H 9 | 10 | #include "archivemodel.h" 11 | #include "ui_infopanel.h" 12 | 13 | #include 14 | 15 | class InfoPanel : public QFrame, Ui::InformationPanel 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit InfoPanel(ArchiveModel *model, QWidget *parent = nullptr); 20 | ~InfoPanel() override; 21 | 22 | void setIndex(const QModelIndex &); 23 | void setIndexes(const QModelIndexList &list); 24 | 25 | /** 26 | * Returns the file name that is displayed on the info panel. 27 | * 28 | * @return The current file name. If no pretty name has been 29 | * set, it returns the name of the loaded archive. 30 | */ 31 | QString prettyFileName() const; 32 | 33 | /** 34 | * Sets a different file name for the current open archive. 35 | * 36 | * This is particularly useful when a temporary archive (from 37 | * a remote location) is loaded, and the window title shows the 38 | * remote file name and the info panel, by default, would show 39 | * the name of the temporary downloaded file. 40 | * 41 | * @param fileName The new file name. 42 | */ 43 | void setPrettyFileName(const QString &fileName); 44 | 45 | void updateWithDefaults(); 46 | 47 | private: 48 | void showMetaData(); 49 | void hideMetaData(); 50 | 51 | void showMetaDataFor(const QModelIndex &index); 52 | 53 | QPixmap getPixmap(const QString &name); 54 | 55 | ArchiveModel *const m_model; 56 | QString m_prettyFileName; 57 | }; 58 | 59 | #endif // INFOPANEL_H 60 | -------------------------------------------------------------------------------- /part/interface.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Henrique Pinto 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | #ifndef INTERFACE_H 7 | #define INTERFACE_H 8 | 9 | #include 10 | #include 11 | 12 | namespace Kerfuffle 13 | { 14 | class SettingsPage; 15 | } 16 | 17 | class KConfigSkeleton; 18 | 19 | class Interface 20 | { 21 | public: 22 | virtual ~Interface() 23 | { 24 | } 25 | 26 | virtual bool isBusy() const = 0; 27 | virtual KConfigSkeleton *config() const = 0; 28 | virtual QList settingsPages(QWidget *parent) const = 0; 29 | virtual QWidget *infoPanel() const = 0; 30 | }; 31 | 32 | Q_DECLARE_INTERFACE(Interface, "org.kde.kerfuffle.partinterface/0.43") 33 | 34 | #endif // INTERFACE_H 35 | -------------------------------------------------------------------------------- /part/jobtracker.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Henrique Pinto 3 | SPDX-FileCopyrightText: 2008 Harald Hvaal 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #include "jobtracker.h" 9 | #include "ark_debug.h" 10 | 11 | JobTrackerWidget::JobTrackerWidget(QWidget *parent) 12 | : QFrame(parent) 13 | { 14 | setupUi(this); 15 | } 16 | 17 | JobTracker::JobTracker(QWidget *parent) 18 | : KAbstractWidgetJobTracker(parent) 19 | { 20 | m_ui = new JobTrackerWidget(parent); 21 | resetUi(); 22 | } 23 | 24 | JobTracker::~JobTracker() 25 | { 26 | QSetIterator it(m_jobs); 27 | while (it.hasNext()) { 28 | auto job = it.next(); 29 | job->kill(); 30 | } 31 | } 32 | 33 | void JobTracker::description(KJob *job, const QString &title, const QPair &f1, const QPair &f2) 34 | { 35 | Q_UNUSED(job) 36 | Q_UNUSED(f1) 37 | Q_UNUSED(f2) 38 | m_ui->descriptionLabel->setText(QStringLiteral("%1").arg(title)); 39 | m_ui->descriptionLabel->show(); 40 | } 41 | 42 | void JobTracker::infoMessage(KJob *job, const QString &message) 43 | { 44 | Q_UNUSED(job) 45 | m_ui->informationLabel->setText(message); 46 | m_ui->informationLabel->show(); 47 | } 48 | 49 | void JobTracker::warning(KJob *job, const QString &message) 50 | { 51 | Q_UNUSED(job) 52 | m_ui->informationLabel->setText(message); 53 | } 54 | 55 | void JobTracker::registerJob(KJob *job) 56 | { 57 | m_jobs << job; 58 | KAbstractWidgetJobTracker::registerJob(job); 59 | m_ui->show(); 60 | m_ui->informationLabel->hide(); 61 | m_ui->progressBar->show(); 62 | } 63 | 64 | void JobTracker::percent(KJob *job, unsigned long percent) 65 | { 66 | Q_UNUSED(job) 67 | m_ui->progressBar->setMaximum(100); 68 | m_ui->progressBar->setMinimum(0); 69 | m_ui->progressBar->setValue(static_cast(percent)); 70 | } 71 | 72 | void JobTracker::unregisterJob(KJob *job) 73 | { 74 | m_jobs.remove(job); 75 | KAbstractWidgetJobTracker::unregisterJob(job); 76 | resetUi(); 77 | } 78 | 79 | void JobTracker::resetUi() 80 | { 81 | m_ui->hide(); 82 | m_ui->descriptionLabel->hide(); 83 | m_ui->informationLabel->hide(); 84 | m_ui->progressBar->setMaximum(0); 85 | m_ui->progressBar->setMinimum(0); 86 | } 87 | 88 | QWidget *JobTracker::widget(KJob *) 89 | { 90 | return m_ui; 91 | } 92 | 93 | #include "moc_jobtracker.cpp" 94 | -------------------------------------------------------------------------------- /part/jobtracker.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Henrique Pinto 3 | SPDX-FileCopyrightText: 2008 Harald Hvaal 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | #ifndef JOBTRACKER_H 8 | #define JOBTRACKER_H 9 | 10 | #include "ui_jobtracker.h" 11 | 12 | #include 13 | 14 | class KJob; 15 | 16 | class JobTrackerWidget : public QFrame, public Ui::JobTrackerWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit JobTrackerWidget(QWidget *parent = nullptr); 22 | }; 23 | 24 | class JobTracker : public KAbstractWidgetJobTracker 25 | { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit JobTracker(QWidget *parent = nullptr); 30 | ~JobTracker() override; 31 | 32 | QWidget *widget(KJob *) override; 33 | 34 | public Q_SLOTS: 35 | void registerJob(KJob *job) override; 36 | void unregisterJob(KJob *job) override; 37 | 38 | protected Q_SLOTS: 39 | void description(KJob *job, const QString &title, const QPair &f1, const QPair &f2) override; 40 | void infoMessage(KJob *job, const QString &message) override; 41 | void warning(KJob *job, const QString &message) override; 42 | 43 | void percent(KJob *job, unsigned long percent) override; 44 | 45 | private Q_SLOTS: 46 | void resetUi(); 47 | 48 | private: 49 | JobTrackerWidget *m_ui = nullptr; 50 | QSet m_jobs; 51 | }; 52 | 53 | #endif // JOBTRACKER_H 54 | -------------------------------------------------------------------------------- /part/overwritedialog.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Ragnar Thomsen 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include "overwritedialog.h" 8 | 9 | #include 10 | 11 | using namespace Kerfuffle; 12 | 13 | OverwriteDialog::OverwriteDialog(QWidget *parent, const QList &entries, bool error) 14 | : QDialog(parent) 15 | , m_buttonBox(QDialogButtonBox::Cancel, Qt::Horizontal) 16 | { 17 | m_vBoxLayout.addLayout(&m_messageLayout); 18 | m_vBoxLayout.addWidget(&m_entriesList); 19 | m_vBoxLayout.addWidget(&m_buttonBox); 20 | 21 | m_messageLayout.addWidget(&m_messageIcon); 22 | m_messageLayout.addWidget(&m_messageText); 23 | 24 | m_messageIcon.setPixmap(QIcon::fromTheme(QStringLiteral("dialog-warning")).pixmap(QSize(64, 64))); 25 | if (error) { 26 | m_messageText.setText(i18n("Files with the following paths already exist. Remove them if you really want to overwrite.")); 27 | } else { 28 | m_messageText.setText(i18n("Files with the following paths already exist. Do you want to continue overwriting them?")); 29 | m_buttonBox.addButton(QDialogButtonBox::Ok); 30 | } 31 | 32 | connect(&m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept); 33 | connect(&m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); 34 | 35 | for (const Archive::Entry *entry : entries) { 36 | QListWidgetItem *item = new QListWidgetItem(entry->icon(), entry->fullPath(NoTrailingSlash)); 37 | m_entriesList.addItem(item); 38 | } 39 | 40 | setLayout(&m_vBoxLayout); 41 | setFixedSize(window()->sizeHint()); 42 | } 43 | 44 | OverwriteDialog::~OverwriteDialog() 45 | { 46 | } 47 | 48 | #include "moc_overwritedialog.cpp" 49 | -------------------------------------------------------------------------------- /part/overwritedialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2016 Ragnar Thomsen 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef OVERWRITEDIALOG_H 8 | #define OVERWRITEDIALOG_H 9 | 10 | #include "archiveentry.h" 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | class OverwriteDialog : public QDialog 20 | { 21 | Q_OBJECT 22 | public: 23 | explicit OverwriteDialog(QWidget *parent, const QList &entries, bool error = false); 24 | ~OverwriteDialog() override; 25 | 26 | private: 27 | QVBoxLayout m_vBoxLayout; 28 | QHBoxLayout m_messageLayout; 29 | QLabel m_messageIcon; 30 | QLabel m_messageText; 31 | QListWidget m_entriesList; 32 | QDialogButtonBox m_buttonBox; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /plugins/CLI-README: -------------------------------------------------------------------------------- 1 | In this folder is a general template of what one needs to implement 2 | support for a plugin using the cli interface in ark. 3 | 4 | Here are the steps. 5 | 6 | 1. First, create a copy of the cliplugin folder 7 | 2. Change plugins/CMakeLists.txt to include the new subfolder 8 | 3. Rename the kerfuffle_cli.json_TEMPLATE to a unique name, for example 9 | kerfuffle_rar.json. 10 | 4. Fill in the parts in the json metadata marked with TODO 11 | 5. Update the plugins/yourplugin/CMakeLists.txt file, replacing all 12 | instances of kerfuffle_cli with kerfuffle_yourplugin (where yourplugin 13 | must be a unique plugin name) 14 | 6. Implement/modify cliplugin.cpp to fit your archive type. 15 | Refer to kerfuffle/cliinterface.h for explanations on the values that 16 | needs to be implemented. The class name does not need to be changed 17 | 18 | Then finally, email the plugin to the ark maintainer for a code review before 19 | it is committed to master :D 20 | 21 | Have fun 22 | -------------------------------------------------------------------------------- /plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | function(kerfuffle_add_plugin plugin) 2 | kcoreaddons_add_plugin(${plugin} 3 | SOURCES ${ARGN} 4 | INSTALL_NAMESPACE kerfuffle) 5 | target_link_libraries(${plugin} kerfuffle) 6 | endfunction() 7 | 8 | # Utility function that parses the 'MimeTypes' JSON array defined inside the plugin JSON metadata. 9 | # Inputs: 10 | # - PLUGIN_JSON_FILEPATH: the absolute path of the plugin JSON metadata file 11 | # Outputs: 12 | # - PLUGIN_SUPPORTED_MIMETYPES is a list with all the mimetypes parsed from the JSON file. 13 | function(kerfuffle_parse_json_mimetypes PLUGIN_JSON_FILEPATH) 14 | file(READ ${PLUGIN_JSON_FILEPATH} PLUGIN_JSON_METADATA) 15 | string(JSON KPLUGIN_JSON_OBJECT GET ${PLUGIN_JSON_METADATA} KPlugin) 16 | string(JSON MIMETYPES_JSON_ARRAY GET ${KPLUGIN_JSON_OBJECT} MimeTypes) 17 | string(JSON MIMETYPES_COUNT LENGTH ${MIMETYPES_JSON_ARRAY}) 18 | math(EXPR MIMETYPES_RANGE "${MIMETYPES_COUNT} - 1") 19 | foreach(INDEX RANGE ${MIMETYPES_RANGE}) 20 | string(JSON CURRENT_MIMETYPE GET ${MIMETYPES_JSON_ARRAY} ${INDEX}) 21 | list(APPEND PARSED_MIMETYPES ${CURRENT_MIMETYPE}) 22 | endforeach() 23 | # NOTE: need to manually add trailing semicolon because cmake doesn't do it. 24 | set(PLUGIN_SUPPORTED_MIMETYPES "${PARSED_MIMETYPES};" PARENT_SCOPE) 25 | endfunction() 26 | 27 | add_subdirectory( libarchive ) 28 | add_subdirectory( clirarplugin ) 29 | add_subdirectory( cli7zplugin ) 30 | add_subdirectory( clizipplugin ) 31 | add_subdirectory(cliunarchiverplugin) 32 | if(LibZip_FOUND) 33 | add_subdirectory(libzipplugin) 34 | endif(LibZip_FOUND) 35 | add_subdirectory( cliarjplugin ) 36 | 37 | set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}" PARENT_SCOPE) 38 | set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}" PARENT_SCOPE) 39 | -------------------------------------------------------------------------------- /plugins/cli7zplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### next target ############### 2 | 3 | set(kerfuffle_cli7z_SRCS cliplugin.cpp cliplugin.h) 4 | 5 | ecm_qt_declare_logging_category(kerfuffle_cli7z_SRCS 6 | HEADER ark_debug.h 7 | IDENTIFIER ARK_LOG 8 | CATEGORY_NAME ark.cli7z DESCRIPTION "Ark 7z" EXPORT ARK) 9 | 10 | configure_file( 11 | ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_cli7z.json.cmake 12 | ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cli7z.json) 13 | 14 | kerfuffle_parse_json_mimetypes(${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cli7z.json) 15 | set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${PLUGIN_SUPPORTED_MIMETYPES}" PARENT_SCOPE) 16 | 17 | kerfuffle_add_plugin(kerfuffle_cli7z ${kerfuffle_cli7z_SRCS}) 18 | 19 | set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_cli7z;" PARENT_SCOPE) 20 | 21 | find_program(7ZIP 7z) 22 | if(7ZIP) 23 | message(STATUS "Found 7-Zip executable: ${7ZIP}") 24 | else() 25 | message(WARNING "Could not find the 7z executable. Ark will only provide limited support for the 7z archive format.") 26 | endif() 27 | -------------------------------------------------------------------------------- /plugins/cli7zplugin/cliplugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2009 Harald Hvaal 3 | SPDX-FileCopyrightText: 2009-2010 Raphael Kubo da Costa 4 | SPDX-FileCopyrightText: 2016 Vladyslav Batyrenko 5 | 6 | SPDX-License-Identifier: GPL-2.0-or-later 7 | */ 8 | 9 | #ifndef CLIPLUGIN_H 10 | #define CLIPLUGIN_H 11 | 12 | #include "cliinterface.h" 13 | 14 | class CliPlugin : public Kerfuffle::CliInterface 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit CliPlugin(QObject *parent, const QVariantList &args); 20 | ~CliPlugin() override; 21 | 22 | void resetParsing() override; 23 | bool readListLine(const QString &line) override; 24 | bool readExtractLine(const QString &line) override; 25 | bool readDeleteLine(const QString &line) override; 26 | bool isPasswordPrompt(const QString &line) override; 27 | bool isWrongPasswordMsg(const QString &line) override; 28 | bool isCorruptArchiveMsg(const QString &line) override; 29 | bool isDiskFullMsg(const QString &line) override; 30 | bool isFileExistsMsg(const QString &line) override; 31 | bool isFileExistsFileName(const QString &line) override; 32 | 33 | private: 34 | enum ArchiveType { 35 | ArchiveType7z = 0, 36 | ArchiveTypeBZip2, 37 | ArchiveTypeGZip, 38 | ArchiveTypeXz, 39 | ArchiveTypeTar, 40 | ArchiveTypeZip, 41 | ArchiveTypeRar, 42 | } m_archiveType; 43 | 44 | enum ParseState { 45 | ParseStateTitle = 0, 46 | ParseStateHeader, 47 | ParseStateArchiveInformation, 48 | ParseStateComment, 49 | ParseStateEntryInformation, 50 | } m_parseState; 51 | 52 | enum BinaryVariant { 53 | Undefined = 0, 54 | P7zip, 55 | Upstream7zip, 56 | } m_binaryVariant; 57 | 58 | void setupCliProperties(); 59 | void handleMethods(const QStringList &methods); 60 | void fixDirectoryFullName(); 61 | 62 | int m_linesComment; 63 | Kerfuffle::Archive::Entry *m_currentArchiveEntry; 64 | bool m_isFirstInformationEntry; 65 | }; 66 | 67 | #endif // CLIPLUGIN_H 68 | -------------------------------------------------------------------------------- /plugins/cliarjplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### next target ############### 2 | 3 | set(kerfuffle_cliarj_SRCS cliplugin.cpp cliplugin.h) 4 | 5 | ecm_qt_declare_logging_category(kerfuffle_cliarj_SRCS 6 | HEADER ark_debug.h 7 | IDENTIFIER ARK_LOG 8 | CATEGORY_NAME ark.cliarj DESCRIPTION "Ark Arj" EXPORT ARK) 9 | 10 | configure_file( 11 | ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_cliarj.json.cmake 12 | ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cliarj.json) 13 | 14 | kerfuffle_parse_json_mimetypes(${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cliarj.json) 15 | set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${PLUGIN_SUPPORTED_MIMETYPES}" PARENT_SCOPE) 16 | 17 | kerfuffle_add_plugin(kerfuffle_cliarj ${kerfuffle_cliarj_SRCS}) 18 | 19 | set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_cliarj;" PARENT_SCOPE) 20 | 21 | find_program(ARJ arj) 22 | if(ARJ) 23 | message(STATUS "Found arj executable: ${ARJ}") 24 | else() 25 | message(WARNING "Could not find the arj executable. Ark won't be able to handle the arj archive format.") 26 | endif() 27 | -------------------------------------------------------------------------------- /plugins/cliarjplugin/cliplugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2022 Ilya Pominov 3 | 4 | SPDX-License-Identifier: GPL-2.0-or-later 5 | */ 6 | 7 | #ifndef CLIPLUGIN_H 8 | #define CLIPLUGIN_H 9 | 10 | #include "cliinterface.h" 11 | 12 | using namespace Kerfuffle; 13 | 14 | struct ArjFileEntry; 15 | 16 | class CliPlugin : public Kerfuffle::CliInterface 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit CliPlugin(QObject *parent, const QVariantList &args); 22 | ~CliPlugin() override; 23 | 24 | bool addFiles(const QList &files, 25 | const Kerfuffle::Archive::Entry *destination, 26 | const Kerfuffle::CompressionOptions &options, 27 | uint numberOfEntriesToAdd = 0) override; 28 | bool 29 | moveFiles(const QList &files, Kerfuffle::Archive::Entry *destination, const Kerfuffle::CompressionOptions &options) override; 30 | 31 | void resetParsing() override; 32 | bool readListLine(const QString &line) override; 33 | bool readExtractLine(const QString &line) override; 34 | bool isFileExistsMsg(const QString &line) override; 35 | bool isFileExistsFileName(const QString &line) override; 36 | bool isNewMovedFileNamesMsg(const QString &line) override; 37 | 38 | protected: 39 | bool handleLine(const QString &line) override; 40 | 41 | protected Q_SLOTS: 42 | void processFinished(int exitCode, QProcess::ExitStatus exitStatus) override; 43 | 44 | private: 45 | enum ParseState { 46 | ParseStateTitle, 47 | ParseStateProcessing, 48 | ParseStateArchiveDateTime, 49 | ParseStateArchiveComments, 50 | ParseStateEntryFileHeader, 51 | ParseStateEntryFileName, 52 | ParseStateEntryFileProperty, 53 | ParseStateEntryFileDTA, 54 | ParseStateEntryFileDTC, 55 | ParseStateEntryTotal, 56 | } m_parseState; 57 | 58 | void setupCliProperties(); 59 | void ignoreLines(int lines, ParseState nextState); 60 | bool tryAddCurFileProperties(const QString &line); 61 | bool tryAddCurFileComment(const QString &line); 62 | void sendCurFileEntry(); 63 | bool readLine(const QString &line); 64 | 65 | int m_remainingIgnoreLines = 0; 66 | QStringList m_headerComment; 67 | QScopedPointer m_currentParsedFile; 68 | bool m_testPassed = true; 69 | QList m_renamedFiles; 70 | }; 71 | 72 | #endif // CLIPLUGIN_H 73 | -------------------------------------------------------------------------------- /plugins/cliplugin-example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(kerfuffle_cli_SRCS cliplugin.cpp) 2 | 3 | ecm_qt_declare_logging_category(kerfuffle_cli_SRCS 4 | HEADER ark_debug.h 5 | IDENTIFIER ARK_LOG 6 | CATEGORY_NAME ark.cliexample) 7 | 8 | kerfuffle_add_plugin(kerfuffle_cli ${kerfuffle_cli_SRCS}) 9 | -------------------------------------------------------------------------------- /plugins/cliplugin-example/cliplugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2008 Claudio Bantaloukas 3 | SPDX-FileCopyrightText: 2007 Henrique Pinto 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef CLIPLUGIN_H 9 | #define CLIPLUGIN_H 10 | 11 | #include "kerfuffle/cliinterface.h" 12 | 13 | using namespace Kerfuffle; 14 | 15 | class CliPlugin : public CliInterface 16 | { 17 | public: 18 | explicit CliPlugin(QObject *parent = 0, const QVariantList &args = QVariantList()); 19 | virtual ~CliPlugin(); 20 | 21 | virtual ParameterList parameterList() const; 22 | bool readListLine(const QString &line); 23 | 24 | private: 25 | bool m_isFirstLine, m_incontent, m_isPasswordProtected; 26 | QString m_entryFilename; 27 | }; 28 | 29 | #endif // CLIPLUGIN_H 30 | -------------------------------------------------------------------------------- /plugins/cliplugin-example/kerfuffle_cli.json_TEMPLATE: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Id": "TODO kerfuffle_cli", 4 | "MimeTypes": [ 5 | "TODO" 6 | ], 7 | "Name": "TODO archive plugin", 8 | "Version": "@RELEASE_SERVICE_VERSION@" 9 | }, 10 | "X-KDE-Kerfuffle-ReadWrite": true, 11 | "X-KDE-Priority": 100 12 | } 13 | -------------------------------------------------------------------------------- /plugins/clirarplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### next target ############### 2 | 3 | set(kerfuffle_clirar_SRCS cliplugin.cpp cliplugin.h) 4 | 5 | ecm_qt_declare_logging_category(kerfuffle_clirar_SRCS 6 | HEADER ark_debug.h 7 | IDENTIFIER ARK_LOG 8 | CATEGORY_NAME ark.clirar DESCRIPTION "Ark Rar plugin" EXPORT ARK) 9 | 10 | configure_file( 11 | ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_clirar.json.cmake 12 | ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_clirar.json) 13 | 14 | kerfuffle_parse_json_mimetypes(${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_clirar.json) 15 | set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${PLUGIN_SUPPORTED_MIMETYPES}" PARENT_SCOPE) 16 | 17 | kerfuffle_add_plugin(kerfuffle_clirar ${kerfuffle_clirar_SRCS}) 18 | 19 | set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_clirar;" PARENT_SCOPE) 20 | 21 | find_program(UNRAR unrar) 22 | if(UNRAR) 23 | message(STATUS "Found unrar executable: ${UNRAR}") 24 | else() 25 | message(WARNING "Could not find the unrar executable. Ark requires unrar or unar to extract RAR archives.") 26 | endif() 27 | 28 | find_program(RAR rar) 29 | if(RAR) 30 | message(STATUS "Found rar executable: ${RAR}") 31 | else() 32 | message(WARNING "Could not find the rar executable. Ark won't be able to create or edit RAR archives.") 33 | endif() 34 | -------------------------------------------------------------------------------- /plugins/clirarplugin/cliplugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2009 Harald Hvaal 3 | SPDX-FileCopyrightText: 2009-2010 Raphael Kubo da Costa 4 | SPDX-FileCopyrightText: 2015-2016 Ragnar Thomsen 5 | SPDX-FileCopyrightText: 2016 Vladyslav Batyrenko 6 | 7 | SPDX-License-Identifier: GPL-2.0-or-later 8 | */ 9 | 10 | #ifndef CLIPLUGIN_H 11 | #define CLIPLUGIN_H 12 | 13 | #include "cliinterface.h" 14 | 15 | class CliPlugin : public Kerfuffle::CliInterface 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit CliPlugin(QObject *parent, const QVariantList &args); 21 | ~CliPlugin() override; 22 | 23 | void resetParsing() override; 24 | bool readListLine(const QString &line) override; 25 | bool readExtractLine(const QString &line) override; 26 | bool hasBatchExtractionProgress() const override; 27 | bool isPasswordPrompt(const QString &line) override; 28 | bool isWrongPasswordMsg(const QString &line) override; 29 | bool isCorruptArchiveMsg(const QString &line) override; 30 | bool isDiskFullMsg(const QString &line) override; 31 | bool isFileExistsMsg(const QString &line) override; 32 | bool isFileExistsFileName(const QString &line) override; 33 | bool isLocked() const override; 34 | 35 | private: 36 | enum ParseState { 37 | ParseStateTitle = 0, 38 | ParseStateComment, 39 | ParseStateHeader, 40 | ParseStateEntryFileName, 41 | ParseStateEntryDetails, 42 | ParseStateLinkTarget, 43 | } m_parseState; 44 | 45 | void setupCliProperties(); 46 | 47 | bool handleUnrar5Line(const QString &line); 48 | void handleUnrar5Entry(); 49 | bool handleUnrar4Line(const QString &line); 50 | void handleUnrar4Entry(); 51 | void ignoreLines(int lines, ParseState nextState); 52 | 53 | QStringList m_unrar4Details; 54 | QHash m_unrar5Details; 55 | 56 | QString m_unrarVersion; 57 | bool m_isUnrar5; 58 | bool m_isPasswordProtected; 59 | bool m_isSolid; 60 | bool m_isRAR5; 61 | bool m_isLocked; 62 | 63 | int m_remainingIgnoreLines; 64 | int m_linesComment; 65 | }; 66 | 67 | #endif // CLIPLUGIN_H 68 | -------------------------------------------------------------------------------- /plugins/cliunarchiverplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### next target ############### 2 | 3 | set(kerfuffle_cliunarchiver_SRCS cliplugin.cpp cliplugin.h) 4 | 5 | ecm_qt_declare_logging_category(kerfuffle_cliunarchiver_SRCS 6 | HEADER ark_debug.h 7 | IDENTIFIER ARK_LOG 8 | CATEGORY_NAME ark.cliunarchiver DESCRIPTION "Ark The Unarchiver plugin" EXPORT ARK) 9 | 10 | configure_file( 11 | ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_cliunarchiver.json.cmake 12 | ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cliunarchiver.json) 13 | 14 | kerfuffle_parse_json_mimetypes(${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_cliunarchiver.json) 15 | set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${PLUGIN_SUPPORTED_MIMETYPES}" PARENT_SCOPE) 16 | 17 | kerfuffle_add_plugin(kerfuffle_cliunarchiver ${kerfuffle_cliunarchiver_SRCS}) 18 | 19 | # This plugin has a catch() block 20 | kde_target_enable_exceptions(kerfuffle_cliunarchiver PRIVATE) 21 | 22 | set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_cliunarchiver;" PARENT_SCOPE) 23 | 24 | find_program(UNAR unar) 25 | if(UNAR) 26 | message(STATUS "Found unar executable: ${UNAR}") 27 | else() 28 | message(WARNING "Could not find the unar executable. Ark requires unar or unrar to extract RAR archives.") 29 | endif() 30 | -------------------------------------------------------------------------------- /plugins/cliunarchiverplugin/cliplugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Luke Shumaker 3 | SPDX-FileCopyrightText: 2016 Elvis Angelaccio 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef CLIPLUGIN_H 9 | #define CLIPLUGIN_H 10 | 11 | #include "cliinterface.h" 12 | 13 | class CliPlugin : public Kerfuffle::CliInterface 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit CliPlugin(QObject *parent, const QVariantList &args); 19 | ~CliPlugin() override; 20 | 21 | bool list() override; 22 | bool 23 | extractFiles(const QList &files, const QString &destinationDirectory, const Kerfuffle::ExtractionOptions &options) override; 24 | void resetParsing() override; 25 | bool readListLine(const QString &line) override; 26 | bool readExtractLine(const QString &line) override; 27 | bool isPasswordPrompt(const QString &line) override; 28 | 29 | /** 30 | * Fill the lsar's json output all in once (useful for unit testing). 31 | */ 32 | void setJsonOutput(const QString &jsonOutput); 33 | 34 | protected Q_SLOTS: 35 | void readStdout(bool handleAll = false) override; 36 | 37 | protected: 38 | bool handleLine(const QString &line) override; 39 | 40 | private Q_SLOTS: 41 | void processFinished(int exitCode, QProcess::ExitStatus exitStatus) override; 42 | 43 | private: 44 | void setupCliProperties(); 45 | void readJsonOutput(); 46 | 47 | QString m_jsonOutput; 48 | }; 49 | 50 | #endif // CLIPLUGIN_H 51 | -------------------------------------------------------------------------------- /plugins/clizipplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ########### next target ############### 2 | 3 | set(kerfuffle_clizip_SRCS cliplugin.cpp cliplugin.h) 4 | 5 | ecm_qt_declare_logging_category(kerfuffle_clizip_SRCS 6 | HEADER ark_debug.h 7 | IDENTIFIER ARK_LOG 8 | CATEGORY_NAME ark.clizip DESCRIPTION "Ark Infozip plugin" EXPORT ARK) 9 | 10 | configure_file( 11 | ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_clizip.json.cmake 12 | ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_clizip.json) 13 | 14 | kerfuffle_parse_json_mimetypes(${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_clizip.json) 15 | set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${PLUGIN_SUPPORTED_MIMETYPES}" PARENT_SCOPE) 16 | 17 | kerfuffle_add_plugin(kerfuffle_clizip ${kerfuffle_clizip_SRCS}) 18 | 19 | set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}kerfuffle_clizip;" PARENT_SCOPE) 20 | 21 | find_program(UNZIP unzip) 22 | if(UNZIP) 23 | message(STATUS "Found unzip executable: ${UNZIP}") 24 | else() 25 | message(WARNING "Could not find the unzip executable. Ark requires unzip or 7z to extract zip archives.") 26 | endif() 27 | 28 | find_program(ZIP zip) 29 | if(ZIP) 30 | message(STATUS "Found zip executable: ${ZIP}") 31 | else() 32 | message(WARNING "Could not find the zip executable. Ark requires zip or 7z to create or edit zip archives.") 33 | endif() 34 | -------------------------------------------------------------------------------- /plugins/clizipplugin/cliplugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2011 Raphael Kubo da Costa 3 | SPDX-FileCopyrightText: 2016 Vladyslav Batyrenko 4 | 5 | SPDX-License-Identifier: GPL-2.0-or-later 6 | */ 7 | 8 | #ifndef CLIPLUGIN_H 9 | #define CLIPLUGIN_H 10 | 11 | #include "cliinterface.h" 12 | 13 | using namespace Kerfuffle; 14 | 15 | class CliPlugin : public Kerfuffle::CliInterface 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit CliPlugin(QObject *parent, const QVariantList &args); 21 | ~CliPlugin() override; 22 | 23 | void resetParsing() override; 24 | QString escapeFileName(const QString &fileName) const override; 25 | bool readListLine(const QString &line) override; 26 | bool readExtractLine(const QString &line) override; 27 | bool isPasswordPrompt(const QString &line) override; 28 | bool isWrongPasswordMsg(const QString &line) override; 29 | bool isCorruptArchiveMsg(const QString &line) override; 30 | bool isDiskFullMsg(const QString &line) override; 31 | bool isFileExistsMsg(const QString &line) override; 32 | bool isFileExistsFileName(const QString &line) override; 33 | 34 | bool moveFiles(const QList &files, Archive::Entry *destination, const CompressionOptions &options) override; 35 | int moveRequiredSignals() const override; 36 | 37 | private Q_SLOTS: 38 | void continueMoving(bool result); 39 | 40 | private: 41 | void setupCliProperties(); 42 | bool setMovingAddedFiles(); 43 | void finishMoving(bool result); 44 | QString convertCompressionMethod(const QString &method); 45 | 46 | enum ParseState { 47 | ParseStateHeader = 0, 48 | ParseStateComment, 49 | ParseStateEntry, 50 | } m_parseState; 51 | 52 | int m_linesComment; 53 | QString m_tempComment; 54 | }; 55 | 56 | #endif // CLIPLUGIN_H 57 | -------------------------------------------------------------------------------- /plugins/libarchive/readonlylibarchiveplugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Henrique Pinto 3 | SPDX-FileCopyrightText: 2008-2009 Harald Hvaal 4 | SPDX-FileCopyrightText: 2010 Raphael Kubo da Costa 5 | 6 | SPDX-License-Identifier: BSD-2-Clause 7 | */ 8 | 9 | #include "readonlylibarchiveplugin.h" 10 | #include "ark_debug.h" 11 | 12 | #include 13 | 14 | K_PLUGIN_CLASS_WITH_JSON(ReadOnlyLibarchivePlugin, "kerfuffle_libarchive_readonly.json") 15 | 16 | ReadOnlyLibarchivePlugin::ReadOnlyLibarchivePlugin(QObject *parent, const QVariantList &args) 17 | : LibarchivePlugin(parent, args) 18 | { 19 | qCDebug(ARK_LOG) << "Loaded libarchive read-only plugin"; 20 | } 21 | 22 | ReadOnlyLibarchivePlugin::~ReadOnlyLibarchivePlugin() 23 | { 24 | } 25 | 26 | #include "moc_readonlylibarchiveplugin.cpp" 27 | #include "readonlylibarchiveplugin.moc" 28 | -------------------------------------------------------------------------------- /plugins/libarchive/readonlylibarchiveplugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2007 Henrique Pinto 3 | SPDX-FileCopyrightText: 2008-2009 Harald Hvaal 4 | 5 | SPDX-License-Identifier: BSD-2-Clause 6 | */ 7 | 8 | #ifndef READONLYLIBARCHIVEPLUGIN_H 9 | #define READONLYLIBARCHIVEPLUGIN_H 10 | 11 | #include "libarchiveplugin.h" 12 | 13 | class ReadOnlyLibarchivePlugin : public LibarchivePlugin 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit ReadOnlyLibarchivePlugin(QObject *parent, const QVariantList &args); 19 | ~ReadOnlyLibarchivePlugin() override; 20 | }; 21 | 22 | #endif // READONLYLIBARCHIVEPLUGIN_H 23 | -------------------------------------------------------------------------------- /plugins/libzipplugin/.test_chrono_cast.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2024 Hannah von Reth 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #include 8 | 9 | int main() 10 | { 11 | std::chrono::clock_cast(std::chrono::system_clock::now()); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /plugins/libzipplugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(INSTALLED_LIBZIP_PLUGINS "") 2 | 3 | # not yet supported on freebsd 4 | try_compile(HAVE_CHRONO_CAST ${CMAKE_CURRENT_BINARY_DIR} SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/.test_chrono_cast.cpp) 5 | 6 | set(kerfuffle_libzip_SRCS libzipplugin.cpp ark_debug.cpp) 7 | 8 | ecm_qt_declare_logging_category(kerfuffle_libzip_SRCS 9 | HEADER ark_debug.h 10 | IDENTIFIER ARK_LOG 11 | CATEGORY_NAME ark.libzip DESCRIPTION "Ark Infozip plugin" EXPORT ARK) 12 | 13 | if(LibZip_VERSION VERSION_GREATER_EQUAL "1.8.0") 14 | set(ZIP_CM_ZSTD_JSON_LINE "\"Zstd\": \"Zstd\",") 15 | set(ZIP_CM_LZMA_JSON_LINE "\"LZMA\": \"LZMA\",") 16 | set(ZIP_CM_XZ_JSON_LINE "\"XZ\": \"XZ\",") 17 | endif() 18 | 19 | find_package(ZLIB REQUIRED) 20 | set_package_properties(ZLIB PROPERTIES 21 | URL "https://www.zlib.net/" 22 | DESCRIPTION "The Zlib compression library" 23 | PURPOSE "Required for integrity check in libzip plugin") 24 | 25 | configure_file( 26 | ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_libzip.json.cmake 27 | ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_libzip.json) 28 | 29 | kerfuffle_parse_json_mimetypes(${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_libzip.json) 30 | set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${PLUGIN_SUPPORTED_MIMETYPES}" PARENT_SCOPE) 31 | 32 | kerfuffle_add_plugin(kerfuffle_libzip ${kerfuffle_libzip_SRCS}) 33 | 34 | if (HAVE_CHRONO_CAST) 35 | target_compile_definitions(kerfuffle_libzip PRIVATE HAVE_CHRONO_CAST=1) 36 | else() 37 | target_compile_definitions(kerfuffle_libzip PRIVATE HAVE_CHRONO_CAST=0) 38 | endif() 39 | 40 | target_link_libraries(kerfuffle_libzip KF6::KIOCore LibZip::LibZip ZLIB::ZLIB) 41 | 42 | set(INSTALLED_LIBZIP_PLUGINS "${INSTALLED_LIBZIP_PLUGINS}kerfuffle_libzip;") 43 | 44 | set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}${INSTALLED_LIBZIP_PLUGINS}" PARENT_SCOPE) 45 | -------------------------------------------------------------------------------- /plugins/libzipplugin/libzipplugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | SPDX-FileCopyrightText: 2017 Ragnar Thomsen 3 | 4 | SPDX-License-Identifier: BSD-2-Clause 5 | */ 6 | 7 | #ifndef LIBZIPPLUGIN_H 8 | #define LIBZIPPLUGIN_H 9 | 10 | #include "archiveinterface.h" 11 | 12 | #include 13 | 14 | using namespace Kerfuffle; 15 | 16 | class ZipSource; 17 | 18 | class LibzipPlugin : public ReadWriteArchiveInterface 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit LibzipPlugin(QObject *parent, const QVariantList &args); 24 | ~LibzipPlugin() override; 25 | 26 | bool list() override; 27 | bool doKill() override; 28 | bool extractFiles(const QList &files, const QString &destinationDirectory, const ExtractionOptions &options) override; 29 | 30 | bool addFiles(const QList &files, 31 | const Archive::Entry *destination, 32 | const CompressionOptions &options, 33 | uint numberOfEntriesToAdd = 0) override; 34 | bool deleteFiles(const QList &files) override; 35 | bool moveFiles(const QList &files, Archive::Entry *destination, const CompressionOptions &options) override; 36 | bool copyFiles(const QList &files, Archive::Entry *destination, const CompressionOptions &options) override; 37 | bool addComment(const QString &comment) override; 38 | bool testArchive() override; 39 | bool hasBatchExtractionProgress() const override; 40 | 41 | bool isReadOnly() const override; 42 | QString multiVolumeName() const override; 43 | 44 | private: 45 | bool extractEntry(zip_t *archive, const QString &entry, const QString &rootNode, const QString &destDir, bool preservePaths, bool removeRootNode); 46 | bool writeEntry(zip_t *archive, const QString &entry, const Archive::Entry *destination, const CompressionOptions &options, bool isDir = false); 47 | bool emitEntryForIndex(zip_t *archive, qlonglong index); 48 | void emitProgress(double percentage); 49 | QString fromUnixSeparator(const QString &path); 50 | QString toUnixSeparator(const QString &path); 51 | static void progressCallback(zip_t *, double progress, void *that); 52 | static int cancelCallback(zip_t *, void *that); 53 | 54 | QList m_emittedEntries; 55 | bool m_overwriteAll; 56 | bool m_skipAll; 57 | bool m_listAfterAdd; 58 | bool m_backslashedZip; 59 | QString m_multiVolumeName; 60 | std::unique_ptr m_zipSource; 61 | }; 62 | 63 | #endif // LIBZIPPLUGIN_H 64 | -------------------------------------------------------------------------------- /po/de/docs/ark/ark-mainwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/de/docs/ark/ark-mainwindow.png -------------------------------------------------------------------------------- /po/fr/docs/ark/ark-mainwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/fr/docs/ark/ark-mainwindow.png -------------------------------------------------------------------------------- /po/it/docs/ark/ark-comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/it/docs/ark/ark-comment.png -------------------------------------------------------------------------------- /po/it/docs/ark/ark-mainwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/it/docs/ark/ark-mainwindow.png -------------------------------------------------------------------------------- /po/it/docs/ark/create-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/it/docs/ark/create-archive.png -------------------------------------------------------------------------------- /po/it/docs/ark/create-protected-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/it/docs/ark/create-protected-archive.png -------------------------------------------------------------------------------- /po/it/docs/ark/extract-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/it/docs/ark/extract-dialog.png -------------------------------------------------------------------------------- /po/pt_BR/docs/ark/ark-mainwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/pt_BR/docs/ark/ark-mainwindow.png -------------------------------------------------------------------------------- /po/pt_BR/docs/ark/create-protected-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/pt_BR/docs/ark/create-protected-archive.png -------------------------------------------------------------------------------- /po/sr/docs/ark/l10n-track: -------------------------------------------------------------------------------- 1 | # Do not edit manually, except to remove complete lines. 2 | 3 | missing ¦ark-mainwindow.png¦ b76cbfd1a8991a792c11b1d49246ef39 1156856 4 | 5 | -------------------------------------------------------------------------------- /po/uk/docs/ark/ark-comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/uk/docs/ark/ark-comment.png -------------------------------------------------------------------------------- /po/uk/docs/ark/ark-mainwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/uk/docs/ark/ark-mainwindow.png -------------------------------------------------------------------------------- /po/uk/docs/ark/create-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/uk/docs/ark/create-archive.png -------------------------------------------------------------------------------- /po/uk/docs/ark/create-protected-archive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/uk/docs/ark/create-protected-archive.png -------------------------------------------------------------------------------- /po/uk/docs/ark/extract-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KDE/ark/ad7423d38a3c8de5fc0a9238c1248d25cba6f4de/po/uk/docs/ark/extract-dialog.png --------------------------------------------------------------------------------