diff -Nru ark-16.12.3/app/ark_dndextract.desktop.cmake ark-17.04.3/app/ark_dndextract.desktop.cmake
--- ark-16.12.3/app/ark_dndextract.desktop.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/ark_dndextract.desktop.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -26,6 +26,7 @@
Name[hu]=Kibontás ide
Name[ia]=Ark Extrahe hic
Name[id]=Ark Ekstrak di Sini
+Name[is]=Ark afþjappa hingað
Name[it]=Ark Estrai qui
Name[ja]=Ark ここに展開
Name[kk]=Мынаған тарқату
diff -Nru ark-16.12.3/app/batchextract.cpp ark-17.04.3/app/batchextract.cpp
--- ark-16.12.3/app/batchextract.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/batchextract.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -28,15 +28,15 @@
#include "batchextract.h"
#include "ark_debug.h"
-#include "kerfuffle/extractiondialog.h"
-#include "kerfuffle/jobs.h"
-#include "kerfuffle/queries.h"
+#include "extractiondialog.h"
+#include "jobs.h"
+#include "queries.h"
#include
#include
#include
#include
-#include
+#include
#include
#include
@@ -139,7 +139,7 @@
void BatchExtract::showFailedFiles()
{
if (!m_failedFiles.isEmpty()) {
- KMessageBox::informationList(0, i18n("The following files could not be extracted:"), m_failedFiles);
+ KMessageBox::informationList(nullptr, i18n("The following files could not be extracted:"), m_failedFiles);
}
}
@@ -156,7 +156,7 @@
removeSubjob(job);
if (job->error() != KJob::KilledJobError) {
- KMessageBox::error(Q_NULLPTR, job->errorString().isEmpty() ?
+ KMessageBox::error(nullptr, job->errorString().isEmpty() ?
i18n("There was an error during extraction.") : job->errorString());
}
@@ -170,7 +170,7 @@
if (openDestinationAfterExtraction()) {
QUrl destination(destinationFolder());
destination.setPath(QDir::cleanPath(destination.path()));
- KRun::runUrl(destination, QStringLiteral("inode/directory"), 0);
+ KRun::runUrl(destination, QStringLiteral("inode/directory"), nullptr, KRun::RunExecutables, QString(), QByteArray());
}
qCDebug(ARK) << "Finished, emitting the result";
@@ -189,8 +189,9 @@
void BatchExtract::forwardProgress(KJob *job, unsigned long percent)
{
Q_UNUSED(job)
- int jobPart = 100 / m_initialJobCount;
- setPercent(jobPart *(m_initialJobCount - subjobs().size()) + percent / m_initialJobCount);
+ auto jobPart = static_cast(100 / m_initialJobCount);
+ auto remainingJobs = static_cast(m_initialJobCount - subjobs().size());
+ setPercent(jobPart * remainingJobs + percent / static_cast(m_initialJobCount));
}
void BatchExtract::addInput(const QUrl& url)
@@ -258,7 +259,7 @@
// Only one archive, we need a LoadJob to get the single-folder and subfolder properties.
// TODO: find a better way (e.g. let the dialog handle everything), otherwise we list
// the archive twice (once here and once in the following BatchExtractJob).
- Kerfuffle::LoadJob *loadJob = Q_NULLPTR;
+ Kerfuffle::LoadJob *loadJob = nullptr;
if (m_inputs.size() == 1) {
loadJob = Kerfuffle::Archive::load(m_inputs.at(0).toLocalFile(), this);
// We need to access the job after result has been emitted, if the user rejects the dialog.
@@ -270,7 +271,7 @@
}
auto archive = qobject_cast(job)->archive();
- dialog->setSingleFolderArchive(archive->isSingleFolder());
+ dialog->setExtractToSubfolder(archive->hasMultipleTopLevelEntries());
dialog->setSubfolder(archive->subfolderName());
});
diff -Nru ark-16.12.3/app/batchextract.h ark-17.04.3/app/batchextract.h
--- ark-16.12.3/app/batchextract.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/batchextract.h 2017-07-09 22:45:29.000000000 +0000
@@ -56,12 +56,12 @@
/**
* Creates a new BatchExtract object.
*/
- explicit BatchExtract(QObject* parent = 0);
+ explicit BatchExtract(QObject* parent = nullptr);
/**
* Destroys a BatchExtract object.
*/
- virtual ~BatchExtract();
+ ~BatchExtract() override;
/**
* Creates a BatchExtractJob for the given @p url and puts it on the queue.
@@ -74,12 +74,12 @@
*/
void addExtraction(const QUrl& url);
- bool doKill() Q_DECL_OVERRIDE;
+ bool doKill() override;
/**
* A wrapper that calls slotStartJob() when the event loop has started.
*/
- void start() Q_DECL_OVERRIDE;
+ void start() override;
/**
* Whether to automatically create a folder inside the destination
@@ -198,7 +198,7 @@
* successfully, and advances to the next extraction job if
* there are more.
*/
- void slotResult(KJob *job) Q_DECL_OVERRIDE;
+ void slotResult(KJob *job) override;
/**
* Shows a query dialog, which may happen when a file already exists.
diff -Nru ark-16.12.3/app/CMakeLists.txt ark-17.04.3/app/CMakeLists.txt
--- ark-16.12.3/app/CMakeLists.txt 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/CMakeLists.txt 2017-07-09 22:45:29.000000000 +0000
@@ -1,5 +1,8 @@
add_subdirectory(icons)
+include_directories(${CMAKE_BINARY_DIR}) # for version.h generated by cmake
+include_directories(${CMAKE_SOURCE_DIR}/part) # for part's interface.h
+
set(ark_SRCS
batchextract.cpp
main.cpp
diff -Nru ark-16.12.3/app/compressfileitemaction.h ark-17.04.3/app/compressfileitemaction.h
--- ark-16.12.3/app/compressfileitemaction.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/compressfileitemaction.h 2017-07-09 22:45:29.000000000 +0000
@@ -43,7 +43,7 @@
public:
CompressFileItemAction(QObject* parent, const QVariantList& args);
- virtual QList actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) Q_DECL_OVERRIDE;
+ QList actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) override;
private:
QAction *createAction(const QIcon& icon, const QString& name, QWidget *parent, const QList& urls, const QString& exec);
diff -Nru ark-16.12.3/app/compressfileitemaction.json ark-17.04.3/app/compressfileitemaction.json
--- ark-16.12.3/app/compressfileitemaction.json 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/compressfileitemaction.json 2017-07-09 22:45:29.000000000 +0000
@@ -1,42 +1,45 @@
{
"KPlugin": {
- "Icon": "ark",
+ "Icon": "ark",
"MimeTypes": [
- "application/octet-stream",
+ "application/octet-stream",
"inode/directory"
- ],
- "Name": "'Compress' service menu",
- "Name[ca@valencia]": "Menú de servei «Comprimeix»",
- "Name[ca]": "Menú de servei «Comprimeix»",
- "Name[cs]": "Servisní nabídka 'Zkomprimovat'",
- "Name[de]": "„Komprimieren“ im Servicemenü",
- "Name[es]": "Menú de servicio para «Comprimir»",
- "Name[et]": "Tihendamise teenusemenüü",
- "Name[eu]": "'Konprimatu' zerbitzu menua",
- "Name[fi]": "Pakkaa-palveluvalikko",
- "Name[fr]": "Menu de service « compresser »",
- "Name[he]": "תפריט שירות \"דחיסה\"",
- "Name[it]": "Menu di servizio «Comprimi»",
- "Name[ko]": "'압축' 서비스 메뉴",
- "Name[nl]": "Servicemenu 'Comprimeren'",
- "Name[nn]": "«Komprimer»-tenestemeny",
- "Name[pl]": "Menu usługi 'Spakuj'",
- "Name[pt]": "Menu do serviço 'Comprimir'",
- "Name[sk]": "Servisná ponuka 'Zbaliť'",
- "Name[sl]": "Meni storitve stiskanja",
- "Name[sr@ijekavian]": "Сервисни мени компресовања",
- "Name[sr@ijekavianlatin]": "Servisni meni kompresovanja",
- "Name[sr@latin]": "Servisni meni kompresovanja",
- "Name[sr]": "Сервисни мени компресовања",
- "Name[sv]": "'Tjänstmeny 'Komprimera'",
- "Name[uk]": "Службове меню «Стиснути»",
- "Name[x-test]": "xx'Compress' service menuxx",
- "Name[zh_CN]": "“压缩”服务菜单",
- "Name[zh_TW]": "「壓縮」服務選單",
+ ],
+ "Name": "'Compress' service menu",
+ "Name[ca@valencia]": "Menú de servei «Comprimeix»",
+ "Name[ca]": "Menú de servei «Comprimeix»",
+ "Name[cs]": "Servisní nabídka 'Zkomprimovat'",
+ "Name[da]": "\"Kompriḿer\"-servicemenu",
+ "Name[de]": "„Komprimieren“ im Servicemenü",
+ "Name[el]": "Μενού υπηρεσίας 'Συμπίεσης'",
+ "Name[es]": "Menú de servicio para «Comprimir»",
+ "Name[et]": "Tihendamise teenusemenüü",
+ "Name[eu]": "'Konprimatu' zerbitzu menua",
+ "Name[fi]": "Pakkaa-palveluvalikko",
+ "Name[fr]": "Menu de service « compresser »",
+ "Name[he]": "תפריט שירות \"דחיסה\"",
+ "Name[it]": "Menu di servizio «Comprimi»",
+ "Name[ko]": "'압축' 서비스 메뉴",
+ "Name[nl]": "Servicemenu 'Comprimeren'",
+ "Name[nn]": "«Komprimer»-tenestemeny",
+ "Name[pl]": "Menu usługi 'Spakuj'",
+ "Name[pt]": "Menu do serviço 'Comprimir'",
+ "Name[sk]": "Servisná ponuka 'Zbaliť'",
+ "Name[sl]": "Meni storitve stiskanja",
+ "Name[sr@ijekavian]": "Сервисни мени компресовања",
+ "Name[sr@ijekavianlatin]": "Servisni meni kompresovanja",
+ "Name[sr@latin]": "Servisni meni kompresovanja",
+ "Name[sr]": "Сервисни мени компресовања",
+ "Name[sv]": "'Tjänstmeny 'Komprimera'",
+ "Name[tr]": "'Sıkıştır' servis menüsü",
+ "Name[uk]": "Службове меню «Стиснути»",
+ "Name[x-test]": "xx'Compress' service menuxx",
+ "Name[zh_CN]": "“压缩”服务菜单",
+ "Name[zh_TW]": "「壓縮」服務選單",
"ServiceTypes": [
"KFileItemAction/Plugin"
]
- },
- "MimeType": "application/octet-stream;inode/directory;",
+ },
+ "MimeType": "application/octet-stream;inode/directory;",
"X-KDE-Require": "Write"
}
diff -Nru ark-16.12.3/app/extractfileitemaction.h ark-17.04.3/app/extractfileitemaction.h
--- ark-16.12.3/app/extractfileitemaction.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/extractfileitemaction.h 2017-07-09 22:45:29.000000000 +0000
@@ -43,7 +43,7 @@
public:
ExtractFileItemAction(QObject* parent, const QVariantList& args);
- virtual QList actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) Q_DECL_OVERRIDE;
+ QList actions(const KFileItemListProperties& fileItemInfos, QWidget* parentWidget) override;
private:
QAction *createAction(const QIcon& icon, const QString& name, QWidget *parent, const QList& urls, const QString& exec);
diff -Nru ark-16.12.3/app/extractfileitemaction.json ark-17.04.3/app/extractfileitemaction.json
--- ark-16.12.3/app/extractfileitemaction.json 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/extractfileitemaction.json 2017-07-09 22:45:29.000000000 +0000
@@ -1,40 +1,43 @@
{
"KPlugin": {
- "Icon": "ark",
+ "Icon": "ark",
"MimeTypes": [
"application/octet-stream"
- ],
- "Name": "'Extract' service menu",
- "Name[ca@valencia]": "Menú de servei «Extreu»",
- "Name[ca]": "Menú de servei «Extreu»",
- "Name[cs]": "Servisní nabídka 'Rozbalit'",
- "Name[de]": "„Entpacken“ im Servicemenü",
- "Name[es]": "Menú de servicio para «Extraer»",
- "Name[et]": "Lahtipakkimise teenusemenüü",
- "Name[eu]": "'Erauzi' zerbitzu menua",
- "Name[fi]": "Pura-palveluvalikko",
- "Name[fr]": "Menu de service « extraire »",
- "Name[he]": "תפריט שירות \"חילוץ\"",
- "Name[it]": "Menu di servizio «Estrai»",
- "Name[ko]": "'압축 풀기' 서비스 메뉴",
- "Name[nl]": "Servicemenu 'Uitpakken'",
- "Name[nn]": "«Pakk ut»-tenestemeny",
- "Name[pl]": "Menu usługi 'Wypakuj'",
- "Name[pt]": "Menu do serviço 'Extrair'",
- "Name[sk]": "Servisná ponuka 'Rozbaliť'",
- "Name[sl]": "Meni storitve razširjanja",
- "Name[sr@ijekavian]": "Сервисни мени распакивања",
- "Name[sr@ijekavianlatin]": "Servisni meni raspakivanja",
- "Name[sr@latin]": "Servisni meni raspakivanja",
- "Name[sr]": "Сервисни мени распакивања",
- "Name[sv]": "'Tjänstmeny 'Packa upp'",
- "Name[uk]": "Службове меню «Видобути»",
- "Name[x-test]": "xx'Extract' service menuxx",
- "Name[zh_CN]": "“解压缩”服务菜单",
- "Name[zh_TW]": "「解壓縮」服務選單",
+ ],
+ "Name": "'Extract' service menu",
+ "Name[ca@valencia]": "Menú de servei «Extreu»",
+ "Name[ca]": "Menú de servei «Extreu»",
+ "Name[cs]": "Servisní nabídka 'Rozbalit'",
+ "Name[da]": "\"Udpak\"-servicemenu",
+ "Name[de]": "„Entpacken“ im Servicemenü",
+ "Name[el]": "Μενού υπηρεσίας 'Αποσυμπίεσης'",
+ "Name[es]": "Menú de servicio para «Extraer»",
+ "Name[et]": "Lahtipakkimise teenusemenüü",
+ "Name[eu]": "'Erauzi' zerbitzu menua",
+ "Name[fi]": "Pura-palveluvalikko",
+ "Name[fr]": "Menu de service « extraire »",
+ "Name[he]": "תפריט שירות \"חילוץ\"",
+ "Name[it]": "Menu di servizio «Estrai»",
+ "Name[ko]": "'압축 풀기' 서비스 메뉴",
+ "Name[nl]": "Servicemenu 'Uitpakken'",
+ "Name[nn]": "«Pakk ut»-tenestemeny",
+ "Name[pl]": "Menu usługi 'Wypakuj'",
+ "Name[pt]": "Menu do serviço 'Extrair'",
+ "Name[sk]": "Servisná ponuka 'Rozbaliť'",
+ "Name[sl]": "Meni storitve razširjanja",
+ "Name[sr@ijekavian]": "Сервисни мени распакивања",
+ "Name[sr@ijekavianlatin]": "Servisni meni raspakivanja",
+ "Name[sr@latin]": "Servisni meni raspakivanja",
+ "Name[sr]": "Сервисни мени распакивања",
+ "Name[sv]": "'Tjänstmeny 'Packa upp'",
+ "Name[tr]": "'Çıkart' servis menüsü",
+ "Name[uk]": "Службове меню «Видобути»",
+ "Name[x-test]": "xx'Extract' service menuxx",
+ "Name[zh_CN]": "“解压缩”服务菜单",
+ "Name[zh_TW]": "「解壓縮」服務選單",
"ServiceTypes": [
"KFileItemAction/Plugin"
]
- },
+ },
"MimeType": "application/octet-stream;"
}
diff -Nru ark-16.12.3/app/extractHereDndPlugin.cpp ark-17.04.3/app/extractHereDndPlugin.cpp
--- ark-16.12.3/app/extractHereDndPlugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/extractHereDndPlugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -22,15 +22,14 @@
#include "extractHereDndPlugin.h"
#include "ark_debug.h"
#include "batchextract.h"
-#include "kerfuffle/archive_kerfuffle.h"
+#include "archive_kerfuffle.h"
#include "pluginmanager.h"
#include
-#include
+#include
#include
#include
-#include
#include
K_PLUGIN_FACTORY_WITH_JSON(ExtractHereDndPluginFactory, "ark_dndextract.json",
@@ -73,7 +72,7 @@
qCDebug(ARK) << "Plugin executed";
QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("archive-extract")),
- extractHereMessage, NULL);
+ extractHereMessage, nullptr);
connect(action, &QAction::triggered, this, &ExtractHereDndPlugin::slotTriggered);
actionList.append(action);
diff -Nru ark-16.12.3/app/extractHereDndPlugin.h ark-17.04.3/app/extractHereDndPlugin.h
--- ark-16.12.3/app/extractHereDndPlugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/extractHereDndPlugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -22,9 +22,10 @@
#ifndef EXTRACTHEREDNDPLUGIN_H
#define EXTRACTHEREDNDPLUGIN_H
-#include
#include
+#include
+
class ExtractHereDndPlugin : public KIO::DndPopupMenuPlugin
{
Q_OBJECT
@@ -35,8 +36,8 @@
public:
ExtractHereDndPlugin(QObject* parent, const QVariantList&);
- virtual QList setup(const KFileItemListProperties& popupMenuInfo,
- const QUrl& destination) Q_DECL_OVERRIDE;
+ QList setup(const KFileItemListProperties& popupMenuInfo,
+ const QUrl& destination) override;
private:
QUrl m_dest;
diff -Nru ark-16.12.3/app/main.cpp ark-17.04.3/app/main.cpp
--- ark-16.12.3/app/main.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/main.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -3,7 +3,7 @@
*
* Copyright (C) 2007 Henrique Pinto
* Copyright (C) 2008-2009 Harald Hvaal
- * Copyright (C) 2015-2016 Ragnar Thomsen
+ * Copyright (C) 2015-2017 Ragnar Thomsen
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -25,8 +25,7 @@
#include "ark_debug.h"
#include "mainwindow.h"
#include "batchextract.h"
-#include "kerfuffle/addtoarchive.h"
-#include "kdelibs4configmigrator.h"
+#include "addtoarchive.h"
#include
#include
@@ -35,8 +34,9 @@
#include
#include
+#include
+#include
#include
-#include
using Kerfuffle::AddToArchive;
@@ -67,7 +67,7 @@
QStringLiteral(ARK_VERSION_STRING),
i18n("KDE Archiving tool"),
KAboutLicense::GPL,
- i18n("(c) 1997-2016, The Ark Developers"),
+ i18n("(c) 1997-2017, The Ark Developers"),
QString(),
QStringLiteral("http://utils.kde.org/projects/ark")
);
@@ -111,6 +111,10 @@
QString(),
QStringLiteral("palm9744@kettering.edu"));
+ aboutData.addCredit(i18n("Vladyslav Batyrenko"),
+ i18n("Advanced editing functionalities"),
+ QString(),
+ QStringLiteral("http://mvlabat.github.io/ark-gsoc-2016/"));
aboutData.addCredit(i18n("Bryce Corkins"),
i18n("Icons"),
QStringLiteral("dbryce@attglobal.net"));
@@ -122,10 +126,10 @@
QString(),
QStringLiteral("http://littlesvr.ca/misc/contactandrew.php"));
+ KAboutData::setApplicationData(aboutData);
application.setWindowIcon(QIcon::fromTheme(QStringLiteral("ark")));
QCommandLineParser parser;
- parser.setApplicationDescription(aboutData.shortDescription());
parser.addHelpOption();
parser.addVersionOption();
@@ -167,8 +171,6 @@
aboutData.setupCommandLine(&parser);
- KAboutData::setApplicationData(aboutData);
-
// Do the command line parsing.
parser.process(application);
@@ -176,7 +178,7 @@
aboutData.processCommandLine(&parser);
// This is needed to prevent Dolphin from freezing when opening an archive.
- KDBusService dbusService(KDBusService::Multiple);
+ KDBusService dbusService(KDBusService::Multiple | KDBusService::NoExitOnFailure);
// Session restoring.
if (application.isSessionRestored()) {
diff -Nru ark-16.12.3/app/mainwindow.cpp ark-17.04.3/app/mainwindow.cpp
--- ark-16.12.3/app/mainwindow.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/mainwindow.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -26,9 +26,10 @@
#include "ark_debug.h"
#include "archive_kerfuffle.h"
#include "createdialog.h"
+#include "settingsdialog.h"
#include "settingspage.h"
#include "pluginmanager.h"
-#include "part/interface.h"
+#include "interface.h"
#include
#include
@@ -73,7 +74,7 @@
guiFactory()->removeClient(m_part);
delete m_part;
- m_part = 0;
+ m_part = nullptr;
}
void MainWindow::dragEnterEvent(QDragEnterEvent * event)
@@ -100,7 +101,7 @@
return;
}
- if ((event->source() == NULL) &&
+ if ((event->source() == nullptr) &&
(isValidArchiveDrag(event->mimeData()))) {
event->acceptProposedAction();
}
@@ -119,7 +120,7 @@
return;
}
- if ((event->source() == NULL) &&
+ if ((event->source() == nullptr) &&
(isValidArchiveDrag(event->mimeData()))) {
event->acceptProposedAction();
}
@@ -127,7 +128,7 @@
bool MainWindow::loadPart()
{
- KPluginFactory *factory = Q_NULLPTR;
+ KPluginFactory *factory = nullptr;
const auto plugins = KPluginLoader::findPlugins(QString(), [](const KPluginMetaData& metaData) {
return metaData.pluginId() == QStringLiteral("arkpart") &&
@@ -139,7 +140,7 @@
factory = KPluginLoader(plugins.first().fileName()).factory();
}
- m_part = factory ? static_cast(factory->create(this)) : Q_NULLPTR;
+ m_part = factory ? static_cast(factory->create(this)) : nullptr;
if (!m_part) {
KMessageBox::error(this, i18n("Unable to find Ark's KPart component, please check your installation."));
@@ -170,7 +171,7 @@
m_openAction = actionCollection()->addAction(KStandardAction::Open, QStringLiteral("ark_file_open"), this, SLOT(openArchive()));
actionCollection()->addAction(KStandardAction::Quit, QStringLiteral("ark_quit"), this, SLOT(quit()));
- m_recentFilesAction = KStandardAction::openRecent(this, SLOT(openUrl(QUrl)), Q_NULLPTR);
+ m_recentFilesAction = KStandardAction::openRecent(this, SLOT(openUrl(QUrl)), nullptr);
actionCollection()->addAction(QStringLiteral("ark_file_open_recent"), m_recentFilesAction);
m_recentFilesAction->setToolBarMode(KRecentFilesAction::MenuMode);
@@ -254,13 +255,19 @@
void MainWindow::showSettings()
{
+ if (KConfigDialog::showDialog(QStringLiteral("settings"))) {
+ return;
+ }
+
Interface *iface = qobject_cast(m_part);
Q_ASSERT(iface);
- KConfigDialog *dialog = new KConfigDialog(this, QStringLiteral("settings"), iface->config());
+ auto dialog = new Kerfuffle::SettingsDialog(this, QStringLiteral("settings"), iface->config());
foreach (Kerfuffle::SettingsPage *page, iface->settingsPages(this)) {
dialog->addPage(page, page->name(), page->iconName());
+ connect(dialog, &KConfigDialog::settingsChanged, page, &Kerfuffle::SettingsPage::slotSettingsChanged);
+ connect(dialog, &Kerfuffle::SettingsDialog::defaultsButtonClicked, page, &Kerfuffle::SettingsPage::slotDefaultsButtonClicked);
}
// Hide the icons list if only one page has been added.
dialog->setFaceType(KPageDialog::Auto);
@@ -285,7 +292,7 @@
Q_UNUSED(iface);
QPointer dialog = new Kerfuffle::CreateDialog(
- Q_NULLPTR, // parent
+ nullptr, // parent
i18n("Create New Archive"), // caption
QUrl()); // startDir
diff -Nru ark-16.12.3/app/mainwindow.h ark-17.04.3/app/mainwindow.h
--- ark-16.12.3/app/mainwindow.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/mainwindow.h 2017-07-09 22:45:29.000000000 +0000
@@ -36,20 +36,20 @@
{
Q_OBJECT
public:
- explicit MainWindow(QWidget *parent = 0);
- ~MainWindow();
+ explicit MainWindow(QWidget *parent = nullptr);
+ ~MainWindow() override;
bool loadPart();
- void dragEnterEvent(class QDragEnterEvent * event) Q_DECL_OVERRIDE;
- void dropEvent(class QDropEvent * event) Q_DECL_OVERRIDE;
- void dragMoveEvent(class QDragMoveEvent * event) Q_DECL_OVERRIDE;
+ void dragEnterEvent(class QDragEnterEvent * event) override;
+ void dropEvent(class QDropEvent * event) override;
+ void dragMoveEvent(class QDragMoveEvent * event) override;
public slots:
void openUrl(const QUrl &url);
void setShowExtractDialog(bool);
protected:
- void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
+ void closeEvent(QCloseEvent *event) override;
private slots:
void updateActions();
diff -Nru ark-16.12.3/app/org.kde.ark.appdata.xml ark-17.04.3/app/org.kde.ark.appdata.xml
--- ark-16.12.3/app/org.kde.ark.appdata.xml 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/org.kde.ark.appdata.xml 2017-07-09 22:45:29.000000000 +0000
@@ -17,11 +17,13 @@
Ark
Ark
Ark
+ Ark
Ark
Ark
Ark
Ark
Ark
+ Ark
Ark
Ark
Ark
@@ -48,7 +50,7 @@
檔案壓縮_Ark
Archiving Tool
أداة أرشفة
- Ferramienta d'archivamientu
+ Ferramienta d'archiváu
Работа с архиви
Alat za arhiviranje
Eina d'arxivament
@@ -60,11 +62,13 @@
Archiving Tool
Herramienta de archivado
Arhiivide haldamise rakendus
+ Artxibatzeko tresna
Pakkausohjelma
Outil d'archivage
Ferramenta para arquivar
כלי לניהול ארכיונים
Fájltömörítő
+ Instrumento per archivar
Strumento di archiviazione
압축 도구
Archyvavimo įrankis
@@ -96,7 +100,7 @@
Ark can be used to browse, extract, create, and modify archives.
آرك أداة رسوميّة لضغط وفكّ ضغط الملفات مع دعم لصيغ متعدّدة، منها tar، وgzip، وbzip2، وrar، وzip، إضافة إلى صور الأقراص الضوئيّة. يمكن استخدام آرك لتصفح، واستخراج، وإنشاء، وتعديل الأرشيفات.
- Ark ye una utilidá gráfica de compresión/descompresión de ficheros con sofitu pa múltiples formatos, incluyendo tar, gzip, bzip2, rar y zip, amás d'imáxenes de CD-ROM. Ark pue usase pa restolar, estrayer, crear y modificar ficheros.
+ Ark ye una utilidá gráfica des/compresora de ficheros con sofitu pa formatos múltiples, incluyendo tar, gzip, bzip2, rar amás d'imáxenes de discu. Ark pue usase pa restolar, estrayer, crear y modificar archivos.
Ark е графичен инструмент за архивиране/разархивиране, поддържащ множество формати, включително tar, gzip, bzip2, rar и zip, както и образи на CD-ROM. Ark може да се използва за разглеждане, извличане, създаване и променяне на архиви.
Ark je grafički alat za kompresiju/dekompresiju s podrškom za više formata, uključujući tar, gzip, bzip2, rar i zip, kao i CD-ROM slike. Ark se može koristiti za kreiranje, izdvjanje i modifikaciju arhiva.
L'Ark és una utilitat gràfica de compressió/descompressió de fitxers que admet múltiples formats, incloent-hi tar, gzip, bzip2, rar i zip, i també imatges de CD-ROM. L'Ark es pot utilitzar per explorar, extreure, crear, i modificar arxius.
@@ -108,6 +112,7 @@
Ark is a graphical file compression/decompression utility with support for multiple formats, including tar, gzip, bzip2, rar and zip, as well as CD-ROM images. Ark can be used to browse, extract, create, and modify archives.
Ark es una utilidad gráfica de compresión y descompresión de archivos que permite usar diversos formatos, como tar, gzip, bzip2, rar y zip, así como imágenes de CD-ROM. Ark se puede usar para explorar, extraer, crear y modificar archivos comprimidos.
Ark on graafiline failide tihendamise ehk kokkupakkimise ja nende lahtipakkimise tööriist, mis toetab väga paljusid vorminguid, sealhulgas tar, gzip, bzip2, rar and zip, samuti CD-ROM-i tõmmised. Arki abil saab arhiivifaile sirvida, lahti pakkida, luua ja muuta.
+ Ark fitxategien konprimatze-lanetarako utilitate grafiko bat da formatu ugari onartzen dituena, hauen artean tar, gzip, bzip2, rar eta zip, baita CD-ROM irudiak ere. Ark erabili daiteke artxiboak arakatu, erauzi, sortu eta aldatzeko.
Ark on graafinen tiedostojen pakkaus-/purkuohjelma, joka tukee useita tiedostomuotoja kuten tar, gzip, bzip2, rar and zip sekä myös CD-ROM-levykuvia. Arkilla voi selata, purkaa, luoda ja muuttaa arkistoja.
Ark est un utilitaire graphique de compression/décompression de fichier prenant en charge de multiples formats, notamment tar, gzip, bzip2, rar et zip, ainsi que les images de CD-ROM. Ark peut être utilisé pour parcourir, extraire, créer et modifier des archives.
Ark é unha ferramenta gráfica de compresión e descompresión de ficheiros compatíbel con múltiplos formatos, como «tar», «gzip», «bzip2», «rar» e «zip», así como imaxes de CD-ROM. Ark pode usarse para navegar, extraer, crear e modificar arquivos.
@@ -149,11 +154,13 @@
Features:
Funcionalidades:
Omadused:
+ Ezaugarriak:
Ominaisuudet:
Fonctionnalités :
Funcionalidades:
תכונות:
Szolgáltatások:
+ Characteristicas:
Funzionalità:
기능:
Galimybės:
@@ -181,7 +188,7 @@
Several formats supported: gzip, bzip2, zip, rar, 7z and more
دعم صيغ متعدّدة: مثل gzip، و bzip2، و zip، و rar، و 7z وغيرها
- Sofítense dellos formatos: gzip, bzip2, zip, rar, 7z y más
+ Dellos formatos sofitaos: gzip, bzip2, zip, rar, 7z y más
Поддържани са много формати: gzip, bzip2, zip, rar, 7z и други
Više podržanih formata: gzip, bzip2, zip, rar, 7z i drui
Diversos formats admesos: gzip, bzip2, zip, rar, 7z i més
@@ -193,6 +200,7 @@
Several formats supported: gzip, bzip2, zip, rar, 7z and more
Permite el uso de diversos formatos: gzip, bzip2, zip, rar, 7z y más
Paljude vormingute toetus: gzip, bzip2, zip, rar, 7z ja veel paljud.
+ Hainbat formatu onartuak: gzip, bzip2, zip, rar, 7z eta gehiago
Tukee useita tiedostomuotoja: gzip, bzip2, zip, rar, 7z ja monia muita
Plusieurs formats sont pris en charge : gzip, bzip2, zip, rar, 7z et d'autres
Compatíbel con moitos formatos: gzip, bzip2, zip, rar, 7z e máis.
@@ -222,7 +230,7 @@
支援格式:gzip, bzip2, zip, rar, 7z 等等
Preview file contents without extracting files
استعراض محتوى الملف دون استخراج الملفات منه
- Previsualización del conteníu de los ficheros ensin estrayelos
+ Previsualización de conteníos de ficheros ensin estrayer los ficheros
Преглеждане съдържанието на файла, без извличане на файловете
Pregled sadržaja datoteka bez njihovog izdvajanja
Vista prèvia del contingut de fitxers sense extreure'ls
@@ -234,6 +242,7 @@
Preview file contents without extracting files
Vista previa del contenido de archivos sin extraerlos
Failide sisu näitamine ilma neid lahti pakkimata.
+ Aurreikusi fitxategiaren edukia fitxategiak erauzi gabe
Tiedoston sisällön esikatselu purkamatta tiedostoa
Affichage du contenu des fichiers sans les extraire
Obteña unha vista previa dos ficheiros comprimidos sen extraelos.
@@ -265,7 +274,7 @@
- http://kde.org/images/screenshots/ark.png
+ https://cdn.kde.org/screenshots/ark/ark.png
http://kde.org/applications/utilities/ark/
diff -Nru ark-16.12.3/app/org.kde.ark.desktop.cmake ark-17.04.3/app/org.kde.ark.desktop.cmake
--- ark-16.12.3/app/org.kde.ark.desktop.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/app/org.kde.ark.desktop.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -3,7 +3,7 @@
GenericName=Archiving Tool
GenericName[af]=Argiveer Program
GenericName[ar]=أداة أرشفة
-GenericName[ast]=Ferramienta d'archivamientu
+GenericName[ast]=Ferramienta d'archiváu
GenericName[bg]=Работа с архиви
GenericName[br]=Ostilh merañ an Dielloù
GenericName[bs]=Alatka za arhiviranje
@@ -30,7 +30,7 @@
GenericName[hu]=Fájltömörítő
GenericName[ia]=Instrumento per archivar
GenericName[id]=Perkakas Pengarsip
-GenericName[is]=Vinna með safnskrár
+GenericName[is]=Safnskráaverkfæri
GenericName[it]=Strumento di archiviazione
GenericName[ja]=アーカイブツール
GenericName[kk]=Архивтеу құралы
@@ -172,6 +172,7 @@
Comment[fr]=Travailler avec des archives
Comment[gl]=Traballa con arquivos de ficheiros
Comment[he]=עבוד עם קבצי ארכיונים
+Comment[is]=Vinna með safnskrár
Comment[it]=Lavora con gli archivi di file
Comment[ko]=압축 파일로 작업하기
Comment[lt]=Darbas su archyvais
diff -Nru ark-16.12.3/autotests/app/batchextracttest.cpp ark-17.04.3/autotests/app/batchextracttest.cpp
--- ark-16.12.3/autotests/app/batchextracttest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/app/batchextracttest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -43,13 +43,44 @@
{
QTest::addColumn("archivePath");
QTest::addColumn("autoSubfolder");
+ // Expected numbers of entries (files + folders) in the temporary extraction folder.
+ // This is the number of entries in the archive (+ 1, if the autosubfolder is expected).
QTest::addColumn("expectedExtractedEntriesCount");
- QString archivePath = QFINDTESTDATA("data/simple%archive.tar.gz");
QTest::newRow("extract the whole simple%archive.tar.gz (bug #365798)")
- << archivePath
+ << QFINDTESTDATA("data/simple%archive.tar.gz")
<< true
+ << 5;
+
+ QTest::newRow("single-folder, no autosubfolder")
+ << QFINDTESTDATA("../kerfuffle/data/one_toplevel_folder.zip")
+ << false
+ << 9;
+
+ QTest::newRow("single-folder, autosubfolder")
+ << QFINDTESTDATA("../kerfuffle/data/one_toplevel_folder.zip")
+ << true
+ << 9;
+
+ QTest::newRow("non single-folder, no autosubfolder")
+ << QFINDTESTDATA("../kerfuffle/data/simplearchive.tar.gz")
+ << false
<< 4;
+
+ QTest::newRow("non single-folder, autosubfolder")
+ << QFINDTESTDATA("../kerfuffle/data/simplearchive.tar.gz")
+ << true
+ << 5;
+
+ QTest::newRow("single-file, no autosubfolder")
+ << QFINDTESTDATA("data/test.txt.gz")
+ << false
+ << 1;
+
+ QTest::newRow("single-file, autosubfolder")
+ << QFINDTESTDATA("data/test.txt.gz")
+ << true
+ << 2;
}
void BatchExtractTest::testBatchExtraction()
@@ -83,12 +114,7 @@
dirIt.next();
}
- if (autoSubfolder) {
- // Also take into account the automatically created subfolder.
- QCOMPARE(extractedEntriesCount, expectedExtractedEntriesCount + 1);
- } else {
- QCOMPARE(extractedEntriesCount, expectedExtractedEntriesCount);
- }
+ QCOMPARE(extractedEntriesCount, expectedExtractedEntriesCount);
}
#include "batchextracttest.moc"
Binary files /tmp/tmpiSrnrC/ul8puBLOkM/ark-16.12.3/autotests/app/data/test.txt.gz and /tmp/tmpiSrnrC/WaZbqhmGtW/ark-17.04.3/autotests/app/data/test.txt.gz differ
diff -Nru ark-16.12.3/autotests/kerfuffle/adddialogtest.cpp ark-17.04.3/autotests/kerfuffle/adddialogtest.cpp
--- ark-16.12.3/autotests/kerfuffle/adddialogtest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/adddialogtest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -69,7 +69,6 @@
QTest::newRow("tarZ") << QStringLiteral("application/x-tarz") << false << -1 << -1;
QTest::newRow("tarxz") << QStringLiteral("application/x-xz-compressed-tar") << true << 3 << 7;
QTest::newRow("tarlzma") << QStringLiteral("application/x-lzma-compressed-tar") << true << 3 << 7;
- QTest::newRow("tarlzop") << QStringLiteral("application/x-tzo") << true << 3 << 7;
QTest::newRow("tarlzip") << QStringLiteral("application/x-lzip-compressed-tar") << true << 3 << 7;
const auto writeMimeTypes = m_pluginManager.supportedWriteMimeTypes();
@@ -97,6 +96,12 @@
} else {
qDebug() << "tar.lrzip format not available, skipping test.";
}
+
+ if (writeMimeTypes.contains(QStringLiteral("application/x-tzo"))) {
+ QTest::newRow("tarlzop") << QStringLiteral("application/x-tzo") << true << 3 << 7;
+ } else {
+ qDebug() << "tar.lzo format not available, skipping test.";
+ }
}
void AddDialogTest::testBasicWidgets()
@@ -107,24 +112,24 @@
QFETCH(int, initialCompLevel);
QFETCH(int, changeToCompLevel);
- AddDialog *dialog = new AddDialog(Q_NULLPTR, QString(), QUrl(), mime);
+ AddDialog *dialog = new AddDialog(nullptr, QString(), QUrl(), mime);
dialog->slotOpenOptions();
auto collapsibleCompression = dialog->optionsDialog->findChild(QStringLiteral("collapsibleCompression"));
QVERIFY(collapsibleCompression);
- if (supportsCompLevel) {
+ const KPluginMetaData metadata = PluginManager().preferredPluginFor(mime)->metaData();
+ const ArchiveFormat archiveFormat = ArchiveFormat::fromMetadata(mime, metadata);
+ QVERIFY(archiveFormat.isValid());
+
+ if (archiveFormat.defaultCompressionLevel() > 0 && supportsCompLevel) {
// Test that collapsiblegroupbox is enabled for mimetypes that support compression levels.
QVERIFY(collapsibleCompression->isEnabled());
auto compLevelSlider = dialog->optionsDialog->findChild(QStringLiteral("compLevelSlider"));
QVERIFY(compLevelSlider);
- const KPluginMetaData metadata = PluginManager().preferredPluginFor(mime)->metaData();
- const ArchiveFormat archiveFormat = ArchiveFormat::fromMetadata(mime, metadata);
- QVERIFY(archiveFormat.isValid());
-
// Test that min/max of slider are correct.
QCOMPARE(compLevelSlider->minimum(), archiveFormat.minCompressionLevel());
QCOMPARE(compLevelSlider->maximum(), archiveFormat.maxCompressionLevel());
@@ -142,7 +147,7 @@
dialog->optionsDialog->accept();
dialog->accept();
- if (supportsCompLevel) {
+ if (archiveFormat.defaultCompressionLevel() > 0 && supportsCompLevel) {
// Test that the value set by slider is exported from AddDialog.
QCOMPARE(dialog->compressionOptions().compressionLevel(), changeToCompLevel);
}
@@ -151,10 +156,10 @@
CompressionOptions opts;
opts.setCompressionLevel(initialCompLevel);
- dialog = new AddDialog(Q_NULLPTR, QString(), QUrl(), mime, opts);
+ dialog = new AddDialog(nullptr, QString(), QUrl(), mime, opts);
dialog->slotOpenOptions();
- if (supportsCompLevel) {
+ if (archiveFormat.defaultCompressionLevel() > 0 && supportsCompLevel) {
auto compLevelSlider = dialog->optionsDialog->findChild(QStringLiteral("compLevelSlider"));
QVERIFY(compLevelSlider);
diff -Nru ark-16.12.3/autotests/kerfuffle/createdialogtest.cpp ark-17.04.3/autotests/kerfuffle/createdialogtest.cpp
--- ark-16.12.3/autotests/kerfuffle/createdialogtest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/createdialogtest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -61,7 +61,6 @@
QTest::newRow("tarZ") << QStringLiteral("application/x-tarz");
QTest::newRow("tarxz") << QStringLiteral("application/x-xz-compressed-tar");
QTest::newRow("tarlzma") << QStringLiteral("application/x-lzma-compressed-tar");
- QTest::newRow("tarlzop") << QStringLiteral("application/x-tzo");
QTest::newRow("tarlzip") << QStringLiteral("application/x-lzip-compressed-tar");
const auto writeMimeTypes = m_pluginManager.supportedWriteMimeTypes();
@@ -89,11 +88,17 @@
} else {
qDebug() << "tar.lrzip format not available in CreateDialog, skipping test.";
}
+
+ if (writeMimeTypes.contains(QStringLiteral("application/x-tzo"))) {
+ QTest::newRow("tarlzop") << QStringLiteral("application/x-tzo");
+ } else {
+ qDebug() << "tar.lzo format not available in CreateDialog, skipping test.";
+ }
}
void CreateDialogTest::testBasicWidgets()
{
- CreateDialog *dialog = new CreateDialog(Q_NULLPTR, QString(), QUrl());
+ CreateDialog *dialog = new CreateDialog(nullptr, QString(), QUrl());
auto fileNameLineEdit = dialog->findChild(QStringLiteral("filenameLineEdit"));
auto archiveTypeComboBox = dialog->findChild(QStringLiteral("mimeComboBox"));
@@ -142,7 +147,7 @@
void CreateDialogTest::testEncryption()
{
- CreateDialog *dialog = new CreateDialog(Q_NULLPTR, QString(), QUrl());
+ CreateDialog *dialog = new CreateDialog(nullptr, QString(), QUrl());
QFETCH(QString, filter);
QFETCH(bool, isEncryptionAvailable);
@@ -193,7 +198,7 @@
QSKIP("zip format not available in CreateDialog, skipping test.", SkipSingle);
}
- CreateDialog *dialog = new CreateDialog(Q_NULLPTR, QString(), QUrl());
+ CreateDialog *dialog = new CreateDialog(nullptr, QString(), QUrl());
auto collapsibleEncryption = dialog->findChild(QStringLiteral("collapsibleEncryption"));
auto encryptHeaderCheckBox = dialog->findChild(QStringLiteral("encryptHeaderCheckBox"));
Binary files /tmp/tmpiSrnrC/ul8puBLOkM/ark-16.12.3/autotests/kerfuffle/data/single-empty-folder.zip and /tmp/tmpiSrnrC/WaZbqhmGtW/ark-17.04.3/autotests/kerfuffle/data/single-empty-folder.zip differ
diff -Nru ark-16.12.3/autotests/kerfuffle/extracttest.cpp ark-17.04.3/autotests/kerfuffle/extracttest.cpp
--- ark-16.12.3/autotests/kerfuffle/extracttest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/extracttest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -25,6 +25,7 @@
*/
#include "archive_kerfuffle.h"
+#include "pluginmanager.h"
#include "jobs.h"
#include "testhelper.h"
@@ -269,22 +270,25 @@
<< optionsPreservePaths
<< 7;
- archivePath = QFINDTESTDATA("data/simplearchive.tar.lzo");
- QTest::newRow("extract selected entries from a lzop-compressed tarball without path")
- << archivePath
- << QVector {
- new Archive::Entry(this, QStringLiteral("file3.txt"), QString()),
- new Archive::Entry(this, QStringLiteral("dir2/file22.txt"), QString())
- }
- << optionsNoPaths
- << 2;
-
- archivePath = QFINDTESTDATA("data/simplearchive.tar.lzo");
- QTest::newRow("extract all entries from a lzop-compressed tarball with path")
- << archivePath
- << QVector()
- << optionsPreservePaths
- << 7;
+ // Only run tests if tar.lzo format is available
+ if (PluginManager().supportedMimeTypes().contains(QStringLiteral("application/x-tzo"))) {
+ archivePath = QFINDTESTDATA("data/simplearchive.tar.lzo");
+ QTest::newRow("extract selected entries from a lzop-compressed tarball without path")
+ << archivePath
+ << QVector {
+ new Archive::Entry(this, QStringLiteral("file3.txt"), QString()),
+ new Archive::Entry(this, QStringLiteral("dir2/file22.txt"), QString())
+ }
+ << optionsNoPaths
+ << 2;
+
+ archivePath = QFINDTESTDATA("data/simplearchive.tar.lzo");
+ QTest::newRow("extract all entries from a lzop-compressed tarball with path")
+ << archivePath
+ << QVector()
+ << optionsPreservePaths
+ << 7;
+ }
// Only run test for lrzipped tar if lrzip executable is found in path.
if (!QStandardPaths::findExecutable(QStringLiteral("lrzip")).isEmpty()) {
diff -Nru ark-16.12.3/autotests/kerfuffle/jobstest.cpp ark-17.04.3/autotests/kerfuffle/jobstest.cpp
--- ark-16.12.3/autotests/kerfuffle/jobstest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/jobstest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -25,8 +25,7 @@
*/
#include "jsonarchiveinterface.h"
-#include "kerfuffle/jobs.h"
-#include "kerfuffle/archiveentry.h"
+#include "jobs.h"
#include
@@ -76,7 +75,7 @@
QTEST_GUILESS_MAIN(JobsTest)
JobsTest::JobsTest()
- : QObject(Q_NULLPTR)
+ : QObject(nullptr)
, m_eventLoop(this)
{
}
@@ -97,7 +96,7 @@
QVariant().fromValue(KPluginMetaData())});
if (!iface->open()) {
qDebug() << "Could not open" << filePath;
- return Q_NULLPTR;
+ return nullptr;
}
return iface;
diff -Nru ark-16.12.3/autotests/kerfuffle/jsonarchiveinterface.cpp ark-17.04.3/autotests/kerfuffle/jsonarchiveinterface.cpp
--- ark-16.12.3/autotests/kerfuffle/jsonarchiveinterface.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/jsonarchiveinterface.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -24,9 +24,9 @@
*/
#include "jsonarchiveinterface.h"
+#include "archiveentry.h"
-#include
-#include "kerfuffle/archiveentry.h"
+#include
JSONArchiveInterface::JSONArchiveInterface(QObject *parent, const QVariantList& args)
: Kerfuffle::ReadWriteArchiveInterface(parent, args)
@@ -75,7 +75,7 @@
return false;
}
- Kerfuffle::Archive::Entry *e = new Kerfuffle::Archive::Entry(Q_NULLPTR);
+ Kerfuffle::Archive::Entry *e = new Kerfuffle::Archive::Entry(nullptr);
e->setProperty("fullPath", path);
m_archive[path] = e;
diff -Nru ark-16.12.3/autotests/kerfuffle/jsonarchiveinterface.h ark-17.04.3/autotests/kerfuffle/jsonarchiveinterface.h
--- ark-16.12.3/autotests/kerfuffle/jsonarchiveinterface.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/jsonarchiveinterface.h 2017-07-09 22:45:29.000000000 +0000
@@ -27,8 +27,7 @@
#define JSONARCHIVEINTERFACE_H
#include "jsonparser.h"
-#include "kerfuffle/archiveinterface.h"
-#include "kerfuffle/archive_kerfuffle.h"
+#include "archiveinterface.h"
/**
* A dummy archive interface used by our test cases.
@@ -50,18 +49,18 @@
public:
explicit JSONArchiveInterface(QObject *parent, const QVariantList& args);
- virtual ~JSONArchiveInterface();
+ ~JSONArchiveInterface() override;
- virtual bool list() Q_DECL_OVERRIDE;
- virtual bool open() Q_DECL_OVERRIDE;
+ bool list() override;
+ bool open() override;
- virtual bool addFiles(const QVector& files, const Kerfuffle::Archive::Entry *destination, const Kerfuffle::CompressionOptions& options, uint numberOfEntriesToAdd = 0) Q_DECL_OVERRIDE;
- virtual bool moveFiles(const QVector& files, Kerfuffle::Archive::Entry *destination, const Kerfuffle::CompressionOptions& options) Q_DECL_OVERRIDE;
- virtual bool copyFiles(const QVector& files, Kerfuffle::Archive::Entry *destination, const Kerfuffle::CompressionOptions& options) Q_DECL_OVERRIDE;
- virtual bool extractFiles(const QVector& files, const QString &destinationDirectory, const Kerfuffle::ExtractionOptions& options) Q_DECL_OVERRIDE;
- virtual bool deleteFiles(const QVector& files) Q_DECL_OVERRIDE;
- virtual bool addComment(const QString& comment) Q_DECL_OVERRIDE;
- virtual bool testArchive() Q_DECL_OVERRIDE;
+ bool addFiles(const QVector& files, const Kerfuffle::Archive::Entry *destination, const Kerfuffle::CompressionOptions& options, uint numberOfEntriesToAdd = 0) override;
+ bool moveFiles(const QVector& files, Kerfuffle::Archive::Entry *destination, const Kerfuffle::CompressionOptions& options) override;
+ bool copyFiles(const QVector& files, Kerfuffle::Archive::Entry *destination, const Kerfuffle::CompressionOptions& options) override;
+ bool extractFiles(const QVector& files, const QString &destinationDirectory, const Kerfuffle::ExtractionOptions& options) override;
+ bool deleteFiles(const QVector& files) override;
+ bool addComment(const QString& comment) override;
+ bool testArchive() override;
private:
JSONParser::JSONArchive m_archive;
diff -Nru ark-16.12.3/autotests/kerfuffle/jsonparser.cpp ark-17.04.3/autotests/kerfuffle/jsonparser.cpp
--- ark-16.12.3/autotests/kerfuffle/jsonparser.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/jsonparser.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -24,8 +24,7 @@
*/
#include "jsonparser.h"
-#include "kerfuffle/archiveinterface.h"
-#include "kerfuffle/archiveentry.h"
+#include "archiveinterface.h"
#include
#include
diff -Nru ark-16.12.3/autotests/kerfuffle/jsonparser.h ark-17.04.3/autotests/kerfuffle/jsonparser.h
--- ark-16.12.3/autotests/kerfuffle/jsonparser.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/jsonparser.h 2017-07-09 22:45:29.000000000 +0000
@@ -26,7 +26,7 @@
#ifndef JSONPARSER_H
#define JSONPARSER_H
-#include "kerfuffle/archive_kerfuffle.h"
+#include "archiveentry.h"
#include
#include
diff -Nru ark-16.12.3/autotests/kerfuffle/loadtest.cpp ark-17.04.3/autotests/kerfuffle/loadtest.cpp
--- ark-16.12.3/autotests/kerfuffle/loadtest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/loadtest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -26,6 +26,7 @@
#include "archive_kerfuffle.h"
#include "jobs.h"
+#include "pluginmanager.h"
#include "testhelper.h"
#include
@@ -50,6 +51,7 @@
QTest::addColumn("expectedBaseName");
QTest::addColumn("isReadOnly");
QTest::addColumn("canFallbackOnReadOnly");
+ QTest::addColumn("isSingleFile");
QTest::addColumn("isSingleFolder");
QTest::addColumn("isMultiVolume");
QTest::addColumn("numberOfVolumes");
@@ -60,89 +62,93 @@
QTest::newRow("non-existent tar archive")
<< QStringLiteral("/tmp/foo.tar.gz")
<< QStringLiteral("foo")
- << false << false << true << false << 0 << Archive::Unencrypted
+ << false << false << false << true << false << 0 << Archive::Unencrypted
<< QStringLiteral("foo");
// Test non-archive file
QTest::newRow("not an archive")
<< QStringLiteral("/tmp/foo.pdf")
<< QString()
- << false << false << false << false << 0 << Archive::Unencrypted
+ << false << false << false << false << false << 0 << Archive::Unencrypted
<< QString();
// Test dummy source code tarball.
QTest::newRow("dummy source code tarball")
<< QFINDTESTDATA("data/code-x.y.z.tar.gz")
<< QStringLiteral("code-x.y.z")
- << false << false << true << false << 0 << Archive::Unencrypted
+ << false << false << false << true << false << 0 << Archive::Unencrypted
<< QStringLiteral("awesome_project");
QTest::newRow("simple compressed tar archive")
<< QFINDTESTDATA("data/simplearchive.tar.gz")
<< QStringLiteral("simplearchive")
- << false << false << false << false << 0 << Archive::Unencrypted
+ << false << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("simplearchive");
QTest::newRow("encrypted zip, single entry")
<< QFINDTESTDATA("data/archivetest_encrypted.zip")
<< QStringLiteral("archivetest_encrypted")
- << false << true << false << false << 0 << Archive::Encrypted
+ << false << true << true << false << false << 0 << Archive::Encrypted
<< QStringLiteral("archivetest_encrypted");
QTest::newRow("simple zip, one unencrypted entry")
<< QFINDTESTDATA("data/archivetest_unencrypted.zip")
<< QStringLiteral("archivetest_unencrypted")
- << false << true << false << false << 0 << Archive::Unencrypted
+ << false << true << true << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("archivetest_unencrypted");
QTest::newRow("rpm archive, no single folder")
<< QFINDTESTDATA("data/wget.rpm")
<< QStringLiteral("wget")
- << true << false << false << false << 0 << Archive::Unencrypted
+ << true << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("wget");
QTest::newRow("bzip2-compressed tarball")
<< QFINDTESTDATA("data/simplearchive.tar.bz2")
<< QStringLiteral("simplearchive")
- << false << false << false << false << 0 << Archive::Unencrypted
+ << false << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("simplearchive");
QTest::newRow("xz-compressed tarball")
<< QFINDTESTDATA("data/simplearchive.tar.xz")
<< QStringLiteral("simplearchive")
- << false << false << false << false << 0 << Archive::Unencrypted
+ << false << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("simplearchive");
QTest::newRow("lzma-compressed tarball")
<< QFINDTESTDATA("data/simplearchive.tar.lzma")
<< QStringLiteral("simplearchive")
- << false << false << false << false << 0 << Archive::Unencrypted
+ << false << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("simplearchive");
QTest::newRow("compress (.Z) tarball")
<< QFINDTESTDATA("data/simplearchive.tar.Z")
<< QStringLiteral("simplearchive")
- << false << false << false << false << 0 << Archive::Unencrypted
+ << false << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("simplearchive");
QTest::newRow("lzipped tarball")
<< QFINDTESTDATA("data/simplearchive.tar.lz")
<< QStringLiteral("simplearchive")
- << false << false << false << false << 0 << Archive::Unencrypted
+ << false << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("simplearchive");
- QTest::newRow("lzop-compressed tarball")
- << QFINDTESTDATA("data/simplearchive.tar.lzo")
- << QStringLiteral("simplearchive")
- << false << false << false << false << 0 << Archive::Unencrypted
- << QStringLiteral("simplearchive");
+ if (PluginManager().supportedMimeTypes().contains(QStringLiteral("application/x-tzo"))) {
+ QTest::newRow("lzop-compressed tarball")
+ << QFINDTESTDATA("data/simplearchive.tar.lzo")
+ << QStringLiteral("simplearchive")
+ << false << false << false << false << false << 0 << Archive::Unencrypted
+ << QStringLiteral("simplearchive");
+ } else {
+ qDebug() << "tar.lzo format not available. Skipping lzo test.";
+ }
// Only run test for lrzipped tar if lrzip executable is found in path.
if (!QStandardPaths::findExecutable(QStringLiteral("lrzip")).isEmpty()) {
QTest::newRow("lrzipped tarball")
<< QFINDTESTDATA("data/simplearchive.tar.lrz")
<< QStringLiteral("simplearchive")
- << false << false << false << false << 0 << Archive::Unencrypted
+ << false << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("simplearchive");
} else {
qDebug() << "lrzip executable not found in path. Skipping lrzip test.";
@@ -153,7 +159,7 @@
QTest::newRow("lz4-compressed tarball")
<< QFINDTESTDATA("data/simplearchive.tar.lz4")
<< QStringLiteral("simplearchive")
- << false << false << false << false << 0 << Archive::Unencrypted
+ << false << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("simplearchive");
} else {
qDebug() << "lz4 executable not found in path. Skipping lz4 test.";
@@ -162,32 +168,38 @@
QTest::newRow("xar archive")
<< QFINDTESTDATA("data/simplearchive.xar")
<< QStringLiteral("simplearchive")
- << true << false << false << false << 0 << Archive::Unencrypted
+ << true << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("simplearchive");
QTest::newRow("mimetype child of application/zip")
<< QFINDTESTDATA("data/test.odt")
<< QStringLiteral("test")
- << false << true << false << false << 0 << Archive::Unencrypted
+ << false << true << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("test");
QTest::newRow("AppImage")
<< QFINDTESTDATA("data/hello-1.0-x86_64.AppImage")
<< QStringLiteral("hello-1.0-x86_64")
- << true << false << false << false << 0 << Archive::Unencrypted
+ << true << false << false << false << false << 0 << Archive::Unencrypted
<< QStringLiteral("hello-1.0-x86_64");
QTest::newRow("7z multivolume")
<< QFINDTESTDATA("data/archive-multivolume.7z.001")
<< QStringLiteral("archive-multivolume")
- << true << false << false << true << 3 << Archive::Unencrypted
+ << true << false << false << false << true << 3 << Archive::Unencrypted
<< QStringLiteral("archive-multivolume");
QTest::newRow("rar multivolume")
<< QFINDTESTDATA("data/archive-multivolume.part1.rar")
<< QStringLiteral("archive-multivolume")
- << true << false << false << true << 3 << Archive::Unencrypted
+ << true << false << false << false << true << 3 << Archive::Unencrypted
<< QStringLiteral("archive-multivolume");
+
+ QTest::newRow("zip with only an empty folder")
+ << QFINDTESTDATA("data/single-empty-folder.zip")
+ << QStringLiteral("single-empty-folder")
+ << false << true << false << true << false << 0 << Archive::Unencrypted
+ << QStringLiteral("empty");
}
void LoadTest::testProperties()
@@ -221,9 +233,16 @@
QCOMPARE(archive->isReadOnly(), isReadOnly);
}
+ QFETCH(bool, isSingleFile);
+ QCOMPARE(archive->isSingleFile(), isSingleFile);
+
QFETCH(bool, isSingleFolder);
QCOMPARE(archive->isSingleFolder(), isSingleFolder);
+ if (isSingleFile || isSingleFolder) {
+ QVERIFY(!archive->hasMultipleTopLevelEntries());
+ }
+
QFETCH(bool, isMultiVolume);
QCOMPARE(archive->isMultiVolume(), isMultiVolume);
diff -Nru ark-16.12.3/autotests/kerfuffle/mimetypetest.cpp ark-17.04.3/autotests/kerfuffle/mimetypetest.cpp
--- ark-16.12.3/autotests/kerfuffle/mimetypetest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/kerfuffle/mimetypetest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -23,7 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "kerfuffle/archive_kerfuffle.h"
+#include "archive_kerfuffle.h"
#include "mimetypes.h"
#include
diff -Nru ark-16.12.3/autotests/plugins/cli7zplugin/cli7ztest.cpp ark-17.04.3/autotests/plugins/cli7zplugin/cli7ztest.cpp
--- ark-16.12.3/autotests/plugins/cli7zplugin/cli7ztest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/plugins/cli7zplugin/cli7ztest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -24,6 +24,9 @@
*/
#include "cli7ztest.h"
+#include "cliplugin.h"
+#include "archive_kerfuffle.h"
+#include "jobs.h"
#include "testhelper.h"
#include
diff -Nru ark-16.12.3/autotests/plugins/cli7zplugin/cli7ztest.h ark-17.04.3/autotests/plugins/cli7zplugin/cli7ztest.h
--- ark-16.12.3/autotests/plugins/cli7zplugin/cli7ztest.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/plugins/cli7zplugin/cli7ztest.h 2017-07-09 22:45:29.000000000 +0000
@@ -26,10 +26,7 @@
#ifndef CLI7ZTEST_H
#define CLI7ZTEST_H
-#include "cliplugin.h"
#include "pluginmanager.h"
-#include "autotests/testhelper/testhelper.h"
-#include "kerfuffle/jobs.h"
using namespace Kerfuffle;
diff -Nru ark-16.12.3/autotests/plugins/clirarplugin/clirartest.cpp ark-17.04.3/autotests/plugins/clirarplugin/clirartest.cpp
--- ark-16.12.3/autotests/plugins/clirarplugin/clirartest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/plugins/clirarplugin/clirartest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -25,6 +25,10 @@
*/
#include "clirartest.h"
+#include "cliplugin.h"
+#include "archive_kerfuffle.h"
+#include "jobs.h"
+#include "testhelper.h"
#include
diff -Nru ark-16.12.3/autotests/plugins/clirarplugin/clirartest.h ark-17.04.3/autotests/plugins/clirarplugin/clirartest.h
--- ark-16.12.3/autotests/plugins/clirarplugin/clirartest.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/plugins/clirarplugin/clirartest.h 2017-07-09 22:45:29.000000000 +0000
@@ -27,10 +27,7 @@
#ifndef CLIRARTEST_H
#define CLIRARTEST_H
-#include "cliplugin.h"
#include "pluginmanager.h"
-#include "autotests/testhelper/testhelper.h"
-#include "kerfuffle/jobs.h"
using namespace Kerfuffle;
diff -Nru ark-16.12.3/autotests/plugins/clizipplugin/cliziptest.cpp ark-17.04.3/autotests/plugins/clizipplugin/cliziptest.cpp
--- ark-16.12.3/autotests/plugins/clizipplugin/cliziptest.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/plugins/clizipplugin/cliziptest.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -24,6 +24,8 @@
*/
#include "cliziptest.h"
+#include "cliplugin.h"
+
#include
QTEST_GUILESS_MAIN(CliZipTest)
diff -Nru ark-16.12.3/autotests/plugins/clizipplugin/cliziptest.h ark-17.04.3/autotests/plugins/clizipplugin/cliziptest.h
--- ark-16.12.3/autotests/plugins/clizipplugin/cliziptest.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/autotests/plugins/clizipplugin/cliziptest.h 2017-07-09 22:45:29.000000000 +0000
@@ -26,9 +26,6 @@
#ifndef CLIZIPTEST_H
#define CLIZIPTEST_H
-#include "cliplugin.h"
-#include "autotests/testhelper/testhelper.h"
-#include "kerfuffle/jobs.h"
#include "pluginmanager.h"
using namespace Kerfuffle;
diff -Nru ark-16.12.3/cmake/modules/FindLibZip.cmake ark-17.04.3/cmake/modules/FindLibZip.cmake
--- ark-16.12.3/cmake/modules/FindLibZip.cmake 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/cmake/modules/FindLibZip.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,36 @@
+# Find libzip library and headers
+#
+# The module defines the following variables:
+#
+# ::
+#
+# LibZip_FOUND - true if libzip was found
+# LibZip_INCLUDE_DIRS - include search path
+# LibZip_LIBRARIES - libraries to link
+# LibZip_VERSION - libzip 3-component version number
+
+find_package(PkgConfig)
+pkg_check_modules(PC_LIBZIP QUIET libzip)
+
+set(LibZip_VERSION ${PC_LIBZIP_VERSION})
+
+find_path(LibZip_INCLUDE_DIR zip.h
+ HINTS ${PC_LIBZIP_INCLUDEDIR})
+
+# Contains the version of libzip:
+find_path(LibZip_INCLUDE_CONF_DIR zipconf.h
+ HINTS ${PC_LIBZIP_INCLUDE_DIRS})
+
+find_library(LibZip_LIBRARIES
+ NAMES zip libzip
+ HINTS ${PC_LIBZIP_LIBDIR})
+
+set(LibZip_INCLUDE_DIRS ${LibZip_INCLUDE_DIR} ${LibZip_INCLUDE_CONF_DIR})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LibZip
+ FOUND_VAR LibZip_FOUND
+ REQUIRED_VARS LibZip_LIBRARIES LibZip_INCLUDE_DIR LibZip_INCLUDE_CONF_DIR
+ VERSION_VAR LibZip_VERSION)
+
+mark_as_advanced(LibZip_INCLUDE_DIR LibZip_INCLUDE_CONF_DIR)
diff -Nru ark-16.12.3/CMakeLists.txt ark-17.04.3/CMakeLists.txt
--- ark-16.12.3/CMakeLists.txt 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/CMakeLists.txt 2017-07-09 22:45:29.000000000 +0000
@@ -1,19 +1,19 @@
project(ark)
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
-set(QT_MIN_VERSION 5.5.0)
-set(KF5_MIN_VERSION 5.16.0)
+set(QT_MIN_VERSION 5.6.0)
+set(KF5_MIN_VERSION 5.31.0)
# KDE Application Version, managed by release script
-set (KDE_APPLICATIONS_VERSION_MAJOR "16")
-set (KDE_APPLICATIONS_VERSION_MINOR "12")
+set (KDE_APPLICATIONS_VERSION_MAJOR "17")
+set (KDE_APPLICATIONS_VERSION_MINOR "04")
set (KDE_APPLICATIONS_VERSION_MICRO "3")
set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake)
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
-set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
+set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
include(KDEInstallDirs)
include(KDECMakeSettings)
@@ -46,6 +46,7 @@
DocTools
I18n
IconThemes
+ ItemModels
KIO
Service
Parts
@@ -61,12 +62,18 @@
set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
endif()
-find_package(LibArchive 3.1.0 REQUIRED)
+find_package(LibArchive 3.2.0 REQUIRED)
set_package_properties(LibArchive PROPERTIES
URL "http://www.libarchive.org/"
DESCRIPTION "A library for dealing with a wide variety of archive file formats"
PURPOSE "Required for among others tar, tar.gz, tar.bz2 formats in Ark.")
+find_package(LibZip 1.2.0)
+set_package_properties(LibZip PROPERTIES
+ URL "https://nih.at/libzip/"
+ DESCRIPTION "A library for handling zip archives"
+ PURPOSE "Optional for zip archives.")
+
find_package(SharedMimeInfo QUIET)
set_package_properties(SharedMimeInfo PROPERTIES
TYPE OPTIONAL
@@ -82,11 +89,6 @@
set(SUPPORTED_ARK_MIMETYPES "")
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_BINARY_DIR}
-)
-
add_definitions(-DTRANSLATION_DOMAIN="ark")
add_subdirectory(plugins)
@@ -100,6 +102,7 @@
endif()
ki18n_install(po)
+kdoctools_install(po)
install( FILES ark.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
diff -Nru ark-16.12.3/debian/ark.lintian-overrides ark-17.04.3/debian/ark.lintian-overrides
--- ark-16.12.3/debian/ark.lintian-overrides 2017-03-10 21:27:56.000000000 +0000
+++ ark-17.04.3/debian/ark.lintian-overrides 2017-08-19 11:02:37.000000000 +0000
@@ -1 +1 @@
-ark: package-name-doesnt-match-sonames libkerfuffle16
+ark: package-name-doesnt-match-sonames libkerfuffle17
diff -Nru ark-16.12.3/debian/changelog ark-17.04.3/debian/changelog
--- ark-16.12.3/debian/changelog 2017-03-10 21:27:56.000000000 +0000
+++ ark-17.04.3/debian/changelog 2017-08-19 11:02:37.000000000 +0000
@@ -1,3 +1,26 @@
+ark (4:17.04.3-0ubuntu3) artful; urgency=medium
+
+ * Add 'unzip' to testsuite depends
+
+ -- Rik Mills Sat, 19 Aug 2017 12:02:37 +0100
+
+ark (4:17.04.3-0ubuntu2) artful; urgency=medium
+
+ * d/p: Add upstream_use_qtest_main_in_batchextracttest.patch to
+ address similar failure on ubuntu autotests
+
+ -- Rik Mills Fri, 18 Aug 2017 14:10:07 +0100
+
+ark (4:17.04.3-0ubuntu1) artful; urgency=low
+
+ * New upstream release (17.04.1)
+ * Add pkg-config and libzip-dev to Build-Depends
+ * Install translations and add Breaks/Replaces against kde-l10n
+ * New upstream release (17.04.2)
+ * New upstream release (17.04.3)
+
+ -- José Manuel Santamaría Lema Fri, 18 Aug 2017 08:31:58 +0100
+
ark (4:16.12.3-0ubuntu1) zesty; urgency=low
[ Darin Miller ]
diff -Nru ark-16.12.3/debian/control ark-17.04.3/debian/control
--- ark-16.12.3/debian/control 2017-03-10 21:27:56.000000000 +0000
+++ ark-17.04.3/debian/control 2017-08-19 11:02:37.000000000 +0000
@@ -29,6 +29,8 @@
libkf5widgetsaddons-dev (>= 5.31.0~),
liblzma-dev,
libqjson-dev,
+ libzip-dev,
+ pkg-config,
pkg-kde-tools (>= 0.15.15ubuntu1~),
qtbase5-dev (>= 5.6.1~),
zlib1g-dev
@@ -42,6 +44,8 @@
Architecture: any
Recommends: bzip2, p7zip-full, unzip, zip
Suggests: rar, unrar | unrar-free
+Breaks: ${kde-l10n:all}
+Replaces: ${kde-l10n:all}
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: archive utility
Ark manages various archive formats, including tar, gzip, bzip2, rar and zip,
diff -Nru ark-16.12.3/debian/patches/series ark-17.04.3/debian/patches/series
--- ark-16.12.3/debian/patches/series 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/debian/patches/series 2017-08-19 11:02:37.000000000 +0000
@@ -0,0 +1 @@
+upstream_use_qtest_main_in_batchextracttest.patch
diff -Nru ark-16.12.3/debian/patches/upstream_use_qtest_main_in_batchextracttest.patch ark-17.04.3/debian/patches/upstream_use_qtest_main_in_batchextracttest.patch
--- ark-16.12.3/debian/patches/upstream_use_qtest_main_in_batchextracttest.patch 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/debian/patches/upstream_use_qtest_main_in_batchextracttest.patch 2017-08-19 11:02:37.000000000 +0000
@@ -0,0 +1,26 @@
+From 4034352715075469def5507e1b4172bb04aa8694 Mon Sep 17 00:00:00 2001
+From: Elvis Angelaccio
+Date: Thu, 29 Jun 2017 19:18:19 +0200
+Subject: Use QTEST_MAIN in batchextracttest
+
+It should fix "QWidget: Cannot create a QWidget without QApplication" on
+the FreeBSD CI.
+---
+ autotests/app/batchextracttest.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/autotests/app/batchextracttest.cpp b/autotests/app/batchextracttest.cpp
+index d9e9811..18e7de3 100644
+--- a/autotests/app/batchextracttest.cpp
++++ b/autotests/app/batchextracttest.cpp
+@@ -37,7 +37,7 @@ private Q_SLOTS:
+ void testBatchExtraction();
+ };
+
+-QTEST_GUILESS_MAIN(BatchExtractTest)
++QTEST_MAIN(BatchExtractTest)
+
+ void BatchExtractTest::testBatchExtraction_data()
+ {
+--
+cgit v0.11.2
diff -Nru ark-16.12.3/debian/rules ark-17.04.3/debian/rules
--- ark-16.12.3/debian/rules 2017-03-10 21:27:56.000000000 +0000
+++ ark-17.04.3/debian/rules 2017-08-19 11:02:37.000000000 +0000
@@ -1,6 +1,9 @@
#!/usr/bin/make -f
+l10npkgs_firstversion_ok := 4:17.03.90-0~
+
include /usr/share/pkg-kde-tools/qt-kde-team/3/debian-qt-kde.mk
+include /usr/share/pkg-kde-tools/qt-kde-team/2/l10n-packages.mk
override_dh_strip:
$(overridden_command) --ddeb-migration='ark-dbg (<= 4:15.12.1-1~~)'
diff -Nru ark-16.12.3/debian/tests/control ark-17.04.3/debian/tests/control
--- ark-16.12.3/debian/tests/control 2017-03-10 21:27:56.000000000 +0000
+++ ark-17.04.3/debian/tests/control 2017-08-19 11:02:37.000000000 +0000
@@ -1,3 +1,3 @@
Tests: testsuite
-Depends: @, @builddeps@, build-essential, xvfb
+Depends: @, @builddeps@, build-essential, xvfb, unzip
Restrictions: build-needed
diff -Nru ark-16.12.3/kerfuffle/adddialog.h ark-17.04.3/kerfuffle/adddialog.h
--- ark-16.12.3/kerfuffle/adddialog.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/adddialog.h 2017-07-09 22:45:29.000000000 +0000
@@ -50,7 +50,7 @@
const QUrl &startDir,
const QMimeType &mimeType,
const CompressionOptions &opts = {});
- virtual ~AddDialog();
+ ~AddDialog() override;
QStringList selectedFiles() const;
CompressionOptions compressionOptions() const;
QDialog *optionsDialog;
diff -Nru ark-16.12.3/kerfuffle/addtoarchive.cpp ark-17.04.3/kerfuffle/addtoarchive.cpp
--- ark-16.12.3/kerfuffle/addtoarchive.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/addtoarchive.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -34,10 +34,10 @@
#include "jobs.h"
#include
-#include
-#include
+#include
+#include
#include
-#include
+#include
#include
#include
@@ -93,7 +93,7 @@
qCDebug(ARK) << "Opening add dialog";
QPointer dialog = new Kerfuffle::CreateDialog(
- Q_NULLPTR, // parent
+ nullptr, // parent
i18n("Compress to Archive"), // caption
QUrl::fromLocalFile(m_firstPath)); // startDir
@@ -146,14 +146,14 @@
void AddToArchive::slotStartJob()
{
if (m_entries.isEmpty()) {
- KMessageBox::error(NULL, i18n("No input files were given."));
+ KMessageBox::error(nullptr, i18n("No input files were given."));
emitResult();
return;
}
if (m_filename.isEmpty()) {
if (m_autoFilenameSuffix.isEmpty()) {
- KMessageBox::error(Q_NULLPTR, xi18n("You need to either supply a filename for the archive or a suffix (such as rar, tar.gz) with the --autofilename argument."));
+ KMessageBox::error(nullptr, xi18n("You need to either supply a filename for the archive or a suffix (such as rar, tar.gz) with the --autofilename argument."));
emitResult();
return;
}
@@ -213,7 +213,7 @@
qCDebug(ARK) << "AddToArchive job finished";
if (job->error() && !job->errorString().isEmpty()) {
- KMessageBox::error(Q_NULLPTR, job->errorString());
+ KMessageBox::error(nullptr, job->errorString());
}
emitResult();
diff -Nru ark-16.12.3/kerfuffle/addtoarchive.h ark-17.04.3/kerfuffle/addtoarchive.h
--- ark-16.12.3/kerfuffle/addtoarchive.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/addtoarchive.h 2017-07-09 22:45:29.000000000 +0000
@@ -55,8 +55,8 @@
Q_OBJECT
public:
- explicit AddToArchive(QObject *parent = 0);
- ~AddToArchive();
+ explicit AddToArchive(QObject *parent = nullptr);
+ ~AddToArchive() override;
bool showAddDialog();
void setPreservePaths(bool value);
@@ -70,10 +70,10 @@
void setMimeType(const QString & mimeType);
void setPassword(const QString &password);
void setHeaderEncryptionEnabled(bool enabled);
- void start() Q_DECL_OVERRIDE;
+ void start() override;
protected:
- bool doKill() Q_DECL_OVERRIDE;
+ bool doKill() override;
private slots:
void slotFinished(KJob*);
diff -Nru ark-16.12.3/kerfuffle/archiveentry.cpp ark-17.04.3/kerfuffle/archiveentry.cpp
--- ark-16.12.3/kerfuffle/archiveentry.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/archiveentry.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -149,13 +149,13 @@
return entry;
}
}
- return Q_NULLPTR;
+ return nullptr;
}
Archive::Entry *Archive::Entry::findByPath(const QStringList &pieces, int index) const
{
if (index == pieces.count()) {
- return Q_NULLPTR;
+ return nullptr;
}
Entry *next = find(pieces.at(index));
@@ -165,15 +165,21 @@
if (next && next->isDir()) {
return next->findByPath(pieces, index + 1);
}
- return Q_NULLPTR;
+ return nullptr;
}
-void Archive::Entry::returnDirEntries(QVector *store)
+void Archive::Entry::countChildren(uint &dirs, uint &files) const
{
- foreach(Entry *entry, m_entries) {
+ dirs = files = 0;
+ if (!isDir()) {
+ return;
+ }
+
+ foreach (auto entry, entries()) {
if (entry->isDir()) {
- store->prepend(entry);
- entry->returnDirEntries(store);
+ dirs++;
+ } else {
+ files++;
}
}
}
diff -Nru ark-16.12.3/kerfuffle/archiveentry.h ark-17.04.3/kerfuffle/archiveentry.h
--- ark-16.12.3/kerfuffle/archiveentry.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/archiveentry.h 2017-07-09 22:45:29.000000000 +0000
@@ -27,7 +27,6 @@
#define ARCHIVEENTRY_H
#include "archive_kerfuffle.h"
-#include "app/ark_debug.h"
#include
@@ -72,8 +71,8 @@
public:
- explicit Entry(QObject *parent = Q_NULLPTR, const QString &fullPath = {}, const QString &rootNode = {});
- ~Entry();
+ explicit Entry(QObject *parent = nullptr, const QString &fullPath = {}, const QString &rootNode = {});
+ ~Entry() override;
void copyMetaData(const Archive::Entry *sourceEntry);
@@ -92,7 +91,12 @@
int row() const;
Entry *find(const QString &name) const;
Entry *findByPath(const QStringList & pieces, int index = 0) const;
- void returnDirEntries(QVector *store);
+
+ /**
+ * Fills @p dirs and @p files with the number of directories and files
+ * in the entry (both will be 0 if the entry is not a directory).
+ */
+ void countChildren(uint &dirs, uint &files) const;
bool operator==(const Archive::Entry &right) const;
diff -Nru ark-16.12.3/kerfuffle/archiveinterface.cpp ark-17.04.3/kerfuffle/archiveinterface.cpp
--- ark-16.12.3/kerfuffle/archiveinterface.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/archiveinterface.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -30,8 +30,6 @@
#include "ark_debug.h"
#include "mimetypes.h"
-#include
-
#include
#include
#include
@@ -216,7 +214,7 @@
QStringList paths = QStringList();
entries.sort();
QString lastFolder;
- const QString destinationPath = (destination == Q_NULLPTR) ? QString() : destination->fullPath();
+ const QString destinationPath = (destination == nullptr) ? QString() : destination->fullPath();
QString newPath;
int nameLength = 0;
@@ -285,7 +283,7 @@
}
}
-int ReadOnlyArchiveInterface::numberOfEntries() const
+uint ReadOnlyArchiveInterface::numberOfEntries() const
{
return m_numberOfEntries;
}
diff -Nru ark-16.12.3/kerfuffle/archiveinterface.h ark-17.04.3/kerfuffle/archiveinterface.h
--- ark-16.12.3/kerfuffle/archiveinterface.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/archiveinterface.h 2017-07-09 22:45:29.000000000 +0000
@@ -30,9 +30,8 @@
#define ARCHIVEINTERFACE_H
#include "archive_kerfuffle.h"
-#include "archive_entry.h"
#include "kerfuffle_export.h"
-#include "kerfuffle/archiveentry.h"
+#include "archiveentry.h"
#include
#include
@@ -48,7 +47,7 @@
Q_OBJECT
public:
explicit ReadOnlyArchiveInterface(QObject *parent, const QVariantList &args);
- virtual ~ReadOnlyArchiveInterface();
+ ~ReadOnlyArchiveInterface() override;
/**
* Returns the filename of the archive currently being handled.
@@ -156,7 +155,7 @@
bool isHeaderEncryptionEnabled() const;
virtual QString multiVolumeName() const;
void setMultiVolume(bool value);
- int numberOfEntries() const;
+ uint numberOfEntries() const;
QMimeType mimetype() const;
/**
@@ -192,7 +191,7 @@
bool isCorrupt() const;
QString m_comment;
int m_numberOfVolumes;
- int m_numberOfEntries;
+ uint m_numberOfEntries;
KPluginMetaData m_metaData;
private:
@@ -217,9 +216,9 @@
};
explicit ReadWriteArchiveInterface(QObject *parent, const QVariantList &args);
- virtual ~ReadWriteArchiveInterface();
+ ~ReadWriteArchiveInterface() override;
- bool isReadOnly() const Q_DECL_OVERRIDE;
+ bool isReadOnly() const override;
virtual bool addFiles(const QVector &files, const Archive::Entry *destination, const CompressionOptions& options, uint numberOfEntriesToAdd = 0) = 0;
virtual bool moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions& options) = 0;
diff -Nru ark-16.12.3/kerfuffle/archive_kerfuffle.cpp ark-17.04.3/kerfuffle/archive_kerfuffle.cpp
--- ark-16.12.3/kerfuffle/archive_kerfuffle.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/archive_kerfuffle.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -27,7 +27,7 @@
*/
#include "archive_kerfuffle.h"
-#include "archiveentry.h"
+#include "ark_debug.h"
#include "archiveinterface.h"
#include "jobs.h"
#include "mimetypes.h"
@@ -61,7 +61,7 @@
return new Archive(NoPlugin, parent);
}
- Archive *archive = Q_NULLPTR;
+ Archive *archive = nullptr;
foreach (Plugin *plugin, offers) {
archive = create(fileName, plugin, parent);
// Use the first valid plugin, according to the priority sorting.
@@ -88,7 +88,7 @@
const QVariantList args = {QVariant(QFileInfo(fileName).absoluteFilePath()),
QVariant().fromValue(plugin->metaData())};
- ReadOnlyArchiveInterface *iface = factory->create(Q_NULLPTR, args);
+ ReadOnlyArchiveInterface *iface = factory->create(nullptr, args);
if (!iface) {
qCWarning(ARK) << "Could not create plugin instance" << plugin->metaData().pluginId();
return new Archive(FailedPlugin, parent);
@@ -150,7 +150,7 @@
Archive::Archive(ArchiveError errorCode, QObject *parent)
: QObject(parent)
- , m_iface(Q_NULLPTR)
+ , m_iface(nullptr)
, m_error(errorCode)
{
qCDebug(ARK) << "Created archive instance with error";
@@ -242,7 +242,7 @@
CommentJob* Archive::addComment(const QString &comment)
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
qCDebug(ARK) << "Going to add comment:" << comment;
@@ -254,7 +254,7 @@
TestJob* Archive::testArchive()
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
qCDebug(ARK) << "Going to test archive";
@@ -287,6 +287,12 @@
(isMultiVolume() && (numberOfEntries() > 0))) : false;
}
+bool Archive::isSingleFile() const
+{
+ // If the only entry is a folder, isSingleFolder() is true.
+ return numberOfEntries() == 1 && !isSingleFolder();
+}
+
bool Archive::isSingleFolder() const
{
if (!isValid()) {
@@ -354,7 +360,7 @@
qulonglong Archive::packedSize() const
{
- return isValid() ? QFileInfo(fileName()).size() : 0;
+ return isValid() ? static_cast(QFileInfo(fileName()).size()) : 0;
}
QString Archive::subfolderName() const
@@ -379,13 +385,13 @@
DeleteJob* Archive::deleteFiles(QVector &entries)
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
qCDebug(ARK) << "Going to delete" << entries.size() << "entries";
if (m_iface->isReadOnly()) {
- return 0;
+ return nullptr;
}
DeleteJob *newJob = new DeleteJob(entries, static_cast(m_iface));
@@ -395,7 +401,7 @@
AddJob* Archive::addFiles(const QVector &files, const Archive::Entry *destination, const CompressionOptions& options)
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
CompressionOptions newOptions = options;
@@ -414,7 +420,7 @@
MoveJob* Archive::moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions& options)
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
CompressionOptions newOptions = options;
@@ -432,7 +438,7 @@
CopyJob* Archive::copyFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions &options)
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
CompressionOptions newOptions = options;
@@ -450,7 +456,7 @@
ExtractJob* Archive::extractFiles(const QVector &files, const QString &destinationDir, const ExtractionOptions &options)
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
ExtractionOptions newOptions = options;
@@ -465,7 +471,7 @@
PreviewJob *Archive::preview(Archive::Entry *entry)
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
PreviewJob *job = new PreviewJob(entry, (encryptionType() != Unencrypted), m_iface);
@@ -475,7 +481,7 @@
OpenJob *Archive::open(Archive::Entry *entry)
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
OpenJob *job = new OpenJob(entry, (encryptionType() != Unencrypted), m_iface);
@@ -485,7 +491,7 @@
OpenWithJob *Archive::openWith(Archive::Entry *entry)
{
if (!isValid()) {
- return Q_NULLPTR;
+ return nullptr;
}
OpenWithJob *job = new OpenWithJob(entry, (encryptionType() != Unencrypted), m_iface);
@@ -531,4 +537,9 @@
return m_iface;
}
+bool Archive::hasMultipleTopLevelEntries() const
+{
+ return !isSingleFile() && !isSingleFolder();
+}
+
} // namespace Kerfuffle
diff -Nru ark-16.12.3/kerfuffle/archive_kerfuffle.h ark-17.04.3/kerfuffle/archive_kerfuffle.h
--- ark-16.12.3/kerfuffle/archive_kerfuffle.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/archive_kerfuffle.h 2017-07-09 22:45:29.000000000 +0000
@@ -76,6 +76,7 @@
Q_PROPERTY(QMimeType mimeType READ mimeType CONSTANT)
Q_PROPERTY(bool isEmpty READ isEmpty)
Q_PROPERTY(bool isReadOnly READ isReadOnly CONSTANT)
+ Q_PROPERTY(bool isSingleFile READ isSingleFile)
Q_PROPERTY(bool isSingleFolder MEMBER m_isSingleFolder READ isSingleFolder)
Q_PROPERTY(bool isMultiVolume READ isMultiVolume WRITE setMultiVolume)
Q_PROPERTY(bool numberOfVolumes READ numberOfVolumes)
@@ -106,6 +107,7 @@
QMimeType mimeType();
bool isEmpty() const;
bool isReadOnly() const;
+ bool isSingleFile() const;
bool isSingleFolder() const;
bool isMultiVolume() const;
void setMultiVolume(bool value);
@@ -121,44 +123,49 @@
ReadOnlyArchiveInterface *interface();
/**
+ * @return Whether the archive has more than one top-level entry.
+ */
+ bool hasMultipleTopLevelEntries() const;
+
+ /**
* @return Batch extraction job for @p filename to @p destination.
* @param autoSubfolder Whether the job will extract into a subfolder.
* @param preservePaths Whether the job will preserve paths.
* @param parent The parent for the archive.
*/
- static BatchExtractJob *batchExtract(const QString &fileName, const QString &destination, bool autoSubfolder, bool preservePaths, QObject *parent = Q_NULLPTR);
+ static BatchExtractJob *batchExtract(const QString &fileName, const QString &destination, bool autoSubfolder, bool preservePaths, QObject *parent = nullptr);
/**
* @return Job to create an archive for the given @p entries.
* @param fileName The name of the new archive.
* @param mimeType The mimetype of the new archive.
*/
- static CreateJob* create(const QString &fileName, const QString &mimeType, const QVector &entries, const CompressionOptions& options, QObject *parent = Q_NULLPTR);
+ static CreateJob* create(const QString &fileName, const QString &mimeType, const QVector &entries, const CompressionOptions& options, QObject *parent = nullptr);
/**
* @return An empty archive with name @p fileName, mimetype @p mimeType and @p parent as parent.
*/
- static Archive *createEmpty(const QString &fileName, const QString &mimeType, QObject *parent = Q_NULLPTR);
+ static Archive *createEmpty(const QString &fileName, const QString &mimeType, QObject *parent = nullptr);
/**
* @return Job to load the archive @p fileName.
* @param parent The parent of the archive that will be loaded.
*/
- static LoadJob* load(const QString &fileName, QObject *parent = Q_NULLPTR);
+ static LoadJob* load(const QString &fileName, QObject *parent = nullptr);
/**
* @return Job to load the archive @p fileName with mimetype @p mimeType.
* @param parent The parent of the archive that will be loaded.
*/
- static LoadJob* load(const QString &fileName, const QString &mimeType, QObject *parent = Q_NULLPTR);
+ static LoadJob* load(const QString &fileName, const QString &mimeType, QObject *parent = nullptr);
/**
* @return Job to load the archive @p fileName by using @p plugin.
* @param parent The parent of the archive that will be loaded.
*/
- static LoadJob* load(const QString &fileName, Plugin *plugin, QObject *parent = Q_NULLPTR);
+ static LoadJob* load(const QString &fileName, Plugin *plugin, QObject *parent = nullptr);
- ~Archive();
+ ~Archive() override;
ArchiveError error() const;
bool isValid() const;
@@ -215,18 +222,18 @@
void onEncryptionMethodFound(const QString &method);
private:
- Archive(ReadOnlyArchiveInterface *archiveInterface, bool isReadOnly, QObject *parent = 0);
- Archive(ArchiveError errorCode, QObject *parent = 0);
+ Archive(ReadOnlyArchiveInterface *archiveInterface, bool isReadOnly, QObject *parent = nullptr);
+ Archive(ArchiveError errorCode, QObject *parent = nullptr);
- static Archive *create(const QString &fileName, QObject *parent = 0);
- static Archive *create(const QString &fileName, const QString &fixedMimeType, QObject *parent = 0);
+ static Archive *create(const QString &fileName, QObject *parent = nullptr);
+ static Archive *create(const QString &fileName, const QString &fixedMimeType, QObject *parent = nullptr);
/**
* Create an archive instance from a given @p plugin.
* @param fileName The name of the archive.
* @return A valid archive if the plugin could be loaded, an invalid one otherwise (with the FailedPlugin error set).
*/
- static Archive *create(const QString &fileName, Plugin *plugin, QObject *parent = Q_NULLPTR);
+ static Archive *create(const QString &fileName, Plugin *plugin, QObject *parent = nullptr);
ReadOnlyArchiveInterface *m_iface;
bool m_isReadOnly;
bool m_isSingleFolder;
@@ -236,8 +243,6 @@
qulonglong m_extractedFilesSize;
ArchiveError m_error;
EncryptionType m_encryptionType;
- qulonglong m_numberOfFiles;
- qulonglong m_numberOfFolders;
QMimeType m_mimeType;
QStringList m_compressionMethods;
QStringList m_encryptionMethods;
diff -Nru ark-16.12.3/kerfuffle/ark.kcfg ark-17.04.3/kerfuffle/ark.kcfg
--- ark-16.12.3/kerfuffle/ark.kcfg 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/ark.kcfg 2017-07-09 22:45:29.000000000 +0000
@@ -46,6 +46,10 @@
true
+
+
+
+
Whether to limit the preview according to file size.
diff -Nru ark-16.12.3/kerfuffle/cliinterface.cpp ark-17.04.3/kerfuffle/cliinterface.cpp
--- ark-16.12.3/kerfuffle/cliinterface.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/cliinterface.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -93,7 +93,7 @@
m_numberOfEntries = 0;
// To compute progress.
- m_archiveSizeOnDisk = QFileInfo(filename()).size();
+ m_archiveSizeOnDisk = static_cast(QFileInfo(filename()).size());
connect(this, &ReadOnlyArchiveInterface::entry, this, &CliInterface::onEntry);
return runProcess(m_cliProps->property("listProgram").toString(), m_cliProps->listArgs(filename(), password()));
@@ -110,7 +110,7 @@
- if (!m_cliProps->property("passwordSwitch").toString().isEmpty() && options.encryptedArchiveHint() && password().isEmpty()) {
+ if (!m_cliProps->property("passwordSwitch").toStringList().isEmpty() && options.encryptedArchiveHint() && password().isEmpty()) {
qCDebug(ARK) << "Password hint enabled, querying user";
if (!passwordQuery()) {
return false;
@@ -153,7 +153,7 @@
QVector filesToPass = QVector();
// If destination path is specified, we have recreate its structure inside the temp directory
// and then place symlinks of targeted files there.
- const QString destinationPath = (destination == Q_NULLPTR)
+ const QString destinationPath = (destination == nullptr)
? QString()
: destination->fullPath();
@@ -166,11 +166,11 @@
QDir qDir;
qDir.mkpath(absoluteDestinationPath);
- QObject *preservedParent = Q_NULLPTR;
+ QObject *preservedParent = nullptr;
foreach (Archive::Entry *file, files) {
// The entries may have parent. We have to save and apply it to our new entry in order to prevent memory
// leaks.
- if (preservedParent == Q_NULLPTR) {
+ if (preservedParent == nullptr) {
preservedParent = file->parent();
}
@@ -269,7 +269,7 @@
QString programPath = QStandardPaths::findExecutable(programName);
if (programPath.isEmpty()) {
- emit error(xi18nc("@info", "Failed to locate program %2 on disk.", programName));
+ emit error(xi18nc("@info", "Failed to locate program %1 on disk.", programName));
emit finished(false);
return false;
}
@@ -315,7 +315,7 @@
readStdout(true);
delete m_process;
- m_process = Q_NULLPTR;
+ m_process = nullptr;
}
// #193908 - #222392
@@ -365,7 +365,7 @@
readStdout(true);
delete m_process;
- m_process = Q_NULLPTR;
+ m_process = nullptr;
}
// Don't emit finished() if the job was killed quietly.
@@ -665,7 +665,7 @@
lastFolder = QString();
}
}
- Archive::Entry *newEntry = new Archive::Entry(Q_NULLPTR);
+ Archive::Entry *newEntry = new Archive::Entry(nullptr);
newEntry->copyMetaData(entry);
newEntry->setFullPath(newPath);
m_newMovedFiles << newEntry;
@@ -816,7 +816,7 @@
if (!QFile::rename(oldPath, newPath)) {
return false;
}
- m_tempAddedFiles << new Archive::Entry(Q_NULLPTR, file->name());
+ m_tempAddedFiles << new Archive::Entry(nullptr, file->name());
}
return true;
}
@@ -917,6 +917,10 @@
return readListLine(line);
}
+ if (m_operationMode == Delete) {
+ return readDeleteLine(line);
+ }
+
if (m_operationMode == Test) {
if (m_cliProps->isPasswordPrompt(line)) {
@@ -936,6 +940,12 @@
return true;
}
+bool CliInterface::readDeleteLine(const QString &line)
+{
+ Q_UNUSED(line);
+ return true;
+}
+
bool CliInterface::handleFileExistsMessage(const QString& line)
{
// Check for a filename and store it.
@@ -1083,7 +1093,7 @@
void CliInterface::onEntry(Archive::Entry *archiveEntry)
{
if (archiveEntry->compressedSizeIsSet) {
- m_listedSize += archiveEntry->property("compressedSize").toUInt();
+ m_listedSize += archiveEntry->property("compressedSize").toULongLong();
if (m_listedSize <= m_archiveSizeOnDisk) {
emit progress(float(m_listedSize)/float(m_archiveSizeOnDisk));
} else {
diff -Nru ark-16.12.3/kerfuffle/cliinterface.h ark-17.04.3/kerfuffle/cliinterface.h
--- ark-16.12.3/kerfuffle/cliinterface.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/cliinterface.h 2017-07-09 22:45:29.000000000 +0000
@@ -33,7 +33,6 @@
#include "archiveentry.h"
#include "cliproperties.h"
#include "kerfuffle_export.h"
-#include "part/archivemodel.h"
#include
#include
@@ -56,25 +55,26 @@
OperationMode m_operationMode = List;
explicit CliInterface(QObject *parent, const QVariantList & args);
- virtual ~CliInterface();
+ ~CliInterface() override;
- virtual int copyRequiredSignals() const Q_DECL_OVERRIDE;
+ int copyRequiredSignals() const override;
- virtual bool list() Q_DECL_OVERRIDE;
- virtual bool extractFiles(const QVector &files, const QString &destinationDirectory, const ExtractionOptions &options) Q_DECL_OVERRIDE;
- virtual bool addFiles(const QVector &files, const Archive::Entry *destination, const CompressionOptions& options, uint numberOfEntriesToAdd = 0) Q_DECL_OVERRIDE;
- virtual bool moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions& options) Q_DECL_OVERRIDE;
- virtual bool copyFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions& options) Q_DECL_OVERRIDE;
- virtual bool deleteFiles(const QVector &files) Q_DECL_OVERRIDE;
- virtual bool addComment(const QString &comment) Q_DECL_OVERRIDE;
- virtual bool testArchive() Q_DECL_OVERRIDE;
+ bool list() override;
+ bool extractFiles(const QVector &files, const QString &destinationDirectory, const ExtractionOptions &options) override;
+ bool addFiles(const QVector &files, const Archive::Entry *destination, const CompressionOptions& options, uint numberOfEntriesToAdd = 0) override;
+ bool moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions& options) override;
+ bool copyFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions& options) override;
+ bool deleteFiles(const QVector &files) override;
+ bool addComment(const QString &comment) override;
+ bool testArchive() override;
virtual void resetParsing() = 0;
virtual bool readListLine(const QString &line) = 0;
virtual bool readExtractLine(const QString &line) = 0;
- bool doKill() Q_DECL_OVERRIDE;
- bool doSuspend() Q_DECL_OVERRIDE;
- bool doResume() Q_DECL_OVERRIDE;
+ virtual bool readDeleteLine(const QString &line);
+ bool doKill() override;
+ bool doSuspend() override;
+ bool doResume() override;
/**
* Sets if the listing should include empty lines.
@@ -99,7 +99,7 @@
*/
QStringList extractFilesList(const QVector &files) const;
- QString multiVolumeName() const Q_DECL_OVERRIDE;
+ QString multiVolumeName() const override;
CliProperties *cliProperties() const;
@@ -138,20 +138,20 @@
void cleanUp();
- CliProperties *m_cliProps = Q_NULLPTR;
+ CliProperties *m_cliProps = nullptr;
QString m_oldWorkingDir;
QScopedPointer m_tempWorkingDir;
QScopedPointer m_tempAddDir;
OperationMode m_subOperation = List;
QVector m_passedFiles;
QVector m_tempAddedFiles;
- Archive::Entry *m_passedDestination = Q_NULLPTR;
+ Archive::Entry *m_passedDestination = nullptr;
CompressionOptions m_passedOptions;
#ifdef Q_OS_WIN
- KProcess *m_process = Q_NULLPTR;
+ KProcess *m_process = nullptr;
#else
- KPtyProcess *m_process = Q_NULLPTR;
+ KPtyProcess *m_process = nullptr;
#endif
bool m_abortingOperation = false;
@@ -215,8 +215,8 @@
QScopedPointer m_extractTempDir;
QScopedPointer m_commentTempFile;
QVector m_extractedFiles;
- uint m_archiveSizeOnDisk = 0;
- uint m_listedSize = 0;
+ qulonglong m_archiveSizeOnDisk = 0;
+ qulonglong m_listedSize = 0;
protected slots:
virtual void processFinished(int exitCode, QProcess::ExitStatus exitStatus);
diff -Nru ark-16.12.3/kerfuffle/cliproperties.cpp ark-17.04.3/kerfuffle/cliproperties.cpp
--- ark-16.12.3/kerfuffle/cliproperties.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/cliproperties.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -40,7 +40,7 @@
{
}
-QStringList CliProperties::addArgs(const QString &archive, const QStringList &files, const QString &password, bool headerEncryption, int compressionLevel, const QString &compressionMethod, const QString &encryptionMethod, uint volumeSize)
+QStringList CliProperties::addArgs(const QString &archive, const QStringList &files, const QString &password, bool headerEncryption, int compressionLevel, const QString &compressionMethod, const QString &encryptionMethod, ulong volumeSize)
{
if (!encryptionMethod.isEmpty()) {
Q_ASSERT(!password.isEmpty());
@@ -270,7 +270,7 @@
return encMethodSwitch;
}
-QString CliProperties::substituteMultiVolumeSwitch(uint volumeSize) const
+QString CliProperties::substituteMultiVolumeSwitch(ulong volumeSize) const
{
// The maximum value we allow in the QDoubleSpinBox is 1000MB. Converted to
// KB this is 1024000.
diff -Nru ark-16.12.3/kerfuffle/cliproperties.h ark-17.04.3/kerfuffle/cliproperties.h
--- ark-16.12.3/kerfuffle/cliproperties.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/cliproperties.h 2017-07-09 22:45:29.000000000 +0000
@@ -85,7 +85,7 @@
int compressionLevel,
const QString &compressionMethod,
const QString &encryptionMethod,
- uint volumeSize);
+ ulong volumeSize);
QStringList commentArgs(const QString &archive, const QString &commentfile);
QStringList deleteArgs(const QString &archive, const QVector &files, const QString &password);
QStringList extractArgs(const QString &archive, const QStringList &files, bool preservePaths, const QString &password);
@@ -107,7 +107,7 @@
QString substituteCompressionLevelSwitch(int level) const;
QString substituteCompressionMethodSwitch(const QString &method) const;
QString substituteEncryptionMethodSwitch(const QString &method) const;
- QString substituteMultiVolumeSwitch(uint volumeSize) const;
+ QString substituteMultiVolumeSwitch(ulong volumeSize) const;
QString m_addProgram;
QString m_deleteProgram;
diff -Nru ark-16.12.3/kerfuffle/CMakeLists.txt ark-17.04.3/kerfuffle/CMakeLists.txt
--- ark-16.12.3/kerfuffle/CMakeLists.txt 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/CMakeLists.txt 2017-07-09 22:45:29.000000000 +0000
@@ -7,6 +7,7 @@
extractionsettingspage.cpp
generalsettingspage.cpp
previewsettingspage.cpp
+ settingsdialog.cpp
settingspage.cpp
jobs.cpp
adddialog.cpp
@@ -21,6 +22,7 @@
mimetypes.cpp
plugin.cpp
pluginmanager.cpp
+ pluginsettingspage.cpp
archiveentry.cpp
options.cpp
)
@@ -30,9 +32,10 @@
ki18n_wrap_ui(kerfuffle_SRCS
createdialog.ui
extractiondialog.ui
- extractionsettings.ui
- generalsettings.ui
- previewsettings.ui
+ extractionsettingspage.ui
+ generalsettingspage.ui
+ pluginsettingspage.ui
+ previewsettingspage.ui
propertiesdialog.ui
compressionoptionswidget.ui
)
diff -Nru ark-16.12.3/kerfuffle/compressionoptionswidget.cpp ark-17.04.3/kerfuffle/compressionoptionswidget.cpp
--- ark-16.12.3/kerfuffle/compressionoptionswidget.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/compressionoptionswidget.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -94,7 +94,7 @@
{
if (collapsibleMultiVolume->isEnabled() && multiVolumeCheckbox->isChecked()) {
// Convert to kilobytes.
- return volumeSizeSpinbox->value() * 1024;
+ return static_cast(volumeSizeSpinbox->value()) * 1024;
} else {
return 0;
}
diff -Nru ark-16.12.3/kerfuffle/compressionoptionswidget.h ark-17.04.3/kerfuffle/compressionoptionswidget.h
--- ark-16.12.3/kerfuffle/compressionoptionswidget.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/compressionoptionswidget.h 2017-07-09 22:45:29.000000000 +0000
@@ -42,7 +42,7 @@
Q_OBJECT
public:
- explicit CompressionOptionsWidget(QWidget *parent = Q_NULLPTR,
+ explicit CompressionOptionsWidget(QWidget *parent = nullptr,
const CompressionOptions &opts = {});
int compressionLevel() const;
QString compressionMethod() const;
diff -Nru ark-16.12.3/kerfuffle/compressionoptionswidget.ui ark-17.04.3/kerfuffle/compressionoptionswidget.ui
--- ark-16.12.3/kerfuffle/compressionoptionswidget.ui 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/compressionoptionswidget.ui 2017-07-09 22:45:29.000000000 +0000
@@ -6,7 +6,7 @@
0
0
- 450
+ 551
433
@@ -232,7 +232,7 @@
1000.000000000000000
- 0.500000000000000
+ 0.100000000000000
1.000000000000000
diff -Nru ark-16.12.3/kerfuffle/createdialog.cpp ark-17.04.3/kerfuffle/createdialog.cpp
--- ark-16.12.3/kerfuffle/createdialog.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/createdialog.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -32,7 +32,6 @@
#include "archiveformat.h"
#include "ark_debug.h"
#include "ui_createdialog.h"
-#include "kerfuffle/archive_kerfuffle.h"
#include "mimetypes.h"
#include
@@ -50,7 +49,7 @@
Q_OBJECT
public:
- CreateDialogUI(QWidget *parent = 0)
+ CreateDialogUI(QWidget *parent = nullptr)
: QWidget(parent) {
setupUi(this);
}
@@ -206,7 +205,7 @@
QDialog::accept();
break;
case KNewPasswordWidget::PasswordNotVerified:
- KMessageBox::error(Q_NULLPTR, i18n("The chosen password does not match the given verification password."));
+ KMessageBox::error(nullptr, i18n("The chosen password does not match the given verification password."));
break;
default:
break;
diff -Nru ark-16.12.3/kerfuffle/createdialog.h ark-17.04.3/kerfuffle/createdialog.h
--- ark-16.12.3/kerfuffle/createdialog.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/createdialog.h 2017-07-09 22:45:29.000000000 +0000
@@ -84,7 +84,7 @@
bool isHeaderEncryptionEnabled() const;
public slots:
- virtual void accept() Q_DECL_OVERRIDE;
+ void accept() override;
private:
void loadConfiguration();
@@ -94,7 +94,6 @@
KConfigGroup m_config;
QStringList m_supportedMimeTypes;
PluginManager m_pluginManger;
- CompressionOptions m_compOptions;
private slots:
void slotFileNameEdited(const QString &text);
diff -Nru ark-16.12.3/kerfuffle/extractiondialog.cpp ark-17.04.3/kerfuffle/extractiondialog.cpp
--- ark-16.12.3/kerfuffle/extractiondialog.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/extractiondialog.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -49,7 +49,7 @@
Q_OBJECT
public:
- ExtractionDialogUI(QWidget *parent = 0)
+ ExtractionDialogUI(QWidget *parent = nullptr)
: QFrame(parent) {
setupUi(this);
}
@@ -91,8 +91,6 @@
m_ui->allFilesButton->setChecked(true);
m_ui->extractAllLabel->show();
- setSingleFolderArchive(false);
-
m_ui->autoSubfolders->hide();
loadSettings();
@@ -179,9 +177,9 @@
setPreservePaths(ArkSettings::preservePaths());
}
-void ExtractionDialog::setSingleFolderArchive(bool value)
+void ExtractionDialog::setExtractToSubfolder(bool extractToSubfolder)
{
- m_ui->singleFolderGroup->setChecked(!value && ArkSettings::extractToSubfolder());
+ m_ui->singleFolderGroup->setChecked(extractToSubfolder && ArkSettings::extractToSubfolder());
}
void ExtractionDialog::batchModeOption()
@@ -220,7 +218,7 @@
ExtractionDialog::~ExtractionDialog()
{
delete m_ui;
- m_ui = 0;
+ m_ui = nullptr;
}
void ExtractionDialog::setShowSelectedFiles(bool value)
diff -Nru ark-16.12.3/kerfuffle/extractiondialog.h ark-17.04.3/kerfuffle/extractiondialog.h
--- ark-16.12.3/kerfuffle/extractiondialog.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/extractiondialog.h 2017-07-09 22:45:29.000000000 +0000
@@ -42,11 +42,11 @@
{
Q_OBJECT
public:
- explicit ExtractionDialog(QWidget *parent = 0);
- virtual ~ExtractionDialog();
+ explicit ExtractionDialog(QWidget *parent = nullptr);
+ ~ExtractionDialog() override;
void setShowSelectedFiles(bool);
- void setSingleFolderArchive(bool);
+ void setExtractToSubfolder(bool);
void setPreservePaths(bool);
void batchModeOption();
void setOpenDestinationFolderAfterExtraction(bool);
diff -Nru ark-16.12.3/kerfuffle/extractionsettingspage.h ark-17.04.3/kerfuffle/extractionsettingspage.h
--- ark-16.12.3/kerfuffle/extractionsettingspage.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/extractionsettingspage.h 2017-07-09 22:45:29.000000000 +0000
@@ -29,16 +29,16 @@
#define EXTRACTIONSETTINGSPAGE_H
#include "settingspage.h"
-#include "ui_extractionsettings.h"
+#include "ui_extractionsettingspage.h"
namespace Kerfuffle
{
-class KERFUFFLE_EXPORT ExtractionSettingsPage : public SettingsPage, public Ui::ExtractionSettings
+class KERFUFFLE_EXPORT ExtractionSettingsPage : public SettingsPage, public Ui::ExtractionSettingsPage
{
Q_OBJECT
public:
- explicit ExtractionSettingsPage(QWidget *parent = 0, const QString &name = QString(), const QString &iconName = QString());
+ explicit ExtractionSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString());
};
}
diff -Nru ark-16.12.3/kerfuffle/extractionsettingspage.ui ark-17.04.3/kerfuffle/extractionsettingspage.ui
--- ark-16.12.3/kerfuffle/extractionsettingspage.ui 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/kerfuffle/extractionsettingspage.ui 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,68 @@
+
+
+ ExtractionSettingsPage
+
+
+
+ 0
+ 0
+ 544
+ 487
+
+
+
+ -
+
+
+ Open destination folder after extraction
+
+
+
+ -
+
+
+ Close Ark after extraction
+
+
+
+ -
+
+
+ Preserve paths when extracting
+
+
+ true
+
+
+
+ -
+
+
+ Whether to check by default the extraction into subfolder checkbox in the Extraction Dialog, when the archive has more than one top-level entry.
+
+
+ Extract to a subfolder if the archive has more than one top-level entry
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 388
+
+
+
+
+
+
+
+
+
diff -Nru ark-16.12.3/kerfuffle/extractionsettings.ui ark-17.04.3/kerfuffle/extractionsettings.ui
--- ark-16.12.3/kerfuffle/extractionsettings.ui 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/extractionsettings.ui 1970-01-01 00:00:00.000000000 +0000
@@ -1,68 +0,0 @@
-
-
- ExtractionSettings
-
-
-
- 0
- 0
- 544
- 487
-
-
-
- -
-
-
- Open destination folder after extraction
-
-
-
- -
-
-
- Close Ark after extraction
-
-
-
- -
-
-
- Preserve paths when extracting
-
-
- true
-
-
-
- -
-
-
- Whether to check by default the extraction into subfolder checkbox in the Extraction Dialog, when the archive has more than one top-level entry.
-
-
- Extract to a subfolder if the archive has more than one top-level entry
-
-
- true
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 388
-
-
-
-
-
-
-
-
-
diff -Nru ark-16.12.3/kerfuffle/generalsettingspage.h ark-17.04.3/kerfuffle/generalsettingspage.h
--- ark-16.12.3/kerfuffle/generalsettingspage.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/generalsettingspage.h 2017-07-09 22:45:29.000000000 +0000
@@ -29,16 +29,16 @@
#define GENERALSETTINGSPAGE_H
#include "settingspage.h"
-#include "ui_generalsettings.h"
+#include "ui_generalsettingspage.h"
namespace Kerfuffle
{
-class KERFUFFLE_EXPORT GeneralSettingsPage : public SettingsPage, public Ui::GeneralSettings
+class KERFUFFLE_EXPORT GeneralSettingsPage : public SettingsPage, public Ui::GeneralSettingsPage
{
Q_OBJECT
public:
- explicit GeneralSettingsPage(QWidget *parent = 0, const QString &name = QString(), const QString &iconName = QString());
+ explicit GeneralSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString());
};
}
diff -Nru ark-16.12.3/kerfuffle/generalsettingspage.ui ark-17.04.3/kerfuffle/generalsettingspage.ui
--- ark-16.12.3/kerfuffle/generalsettingspage.ui 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/kerfuffle/generalsettingspage.ui 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,84 @@
+
+
+ GeneralSettingsPage
+
+
+
+ 0
+ 0
+ 547
+ 487
+
+
+
+ -
+
+
+ When clicking a file in an archive or pressing the Return key:
+
+
+
+ -
+
+
+
+
+
+ true
+
+
+ -
+
+
+ Pre&view the file with internal previewer
+
+
+ true
+
+
+
+ -
+
+
+ Open the fi&le with associated application
+
+
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+ Show a warning when creating zip archives with AES encryption
+
+
+ true
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+
diff -Nru ark-16.12.3/kerfuffle/generalsettings.ui ark-17.04.3/kerfuffle/generalsettings.ui
--- ark-16.12.3/kerfuffle/generalsettings.ui 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/generalsettings.ui 1970-01-01 00:00:00.000000000 +0000
@@ -1,84 +0,0 @@
-
-
- GeneralSettings
-
-
-
- 0
- 0
- 547
- 487
-
-
-
- -
-
-
- When clicking a file in an archive or pressing the Return key:
-
-
-
- -
-
-
-
-
-
- true
-
-
- -
-
-
- Pre&view the file with internal previewer
-
-
- true
-
-
-
- -
-
-
- Ope&n the file with associated application
-
-
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- -
-
-
- Show a warning when creating zip archives with AES encryption
-
-
- true
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
-
diff -Nru ark-16.12.3/kerfuffle/jobs.cpp ark-17.04.3/kerfuffle/jobs.cpp
--- ark-16.12.3/kerfuffle/jobs.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/jobs.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -49,13 +49,13 @@
Q_OBJECT
public:
- Private(Job *job, QObject *parent = 0)
+ Private(Job *job, QObject *parent = nullptr)
: QThread(parent)
, q(job)
{
}
- virtual void run() Q_DECL_OVERRIDE;
+ void run() override;
private:
Job *q;
@@ -76,11 +76,11 @@
}
Job::Job(Archive *archive)
- : Job(archive, Q_NULLPTR)
+ : Job(archive, nullptr)
{}
Job::Job(ReadOnlyArchiveInterface *interface)
- : Job(Q_NULLPTR, interface)
+ : Job(nullptr, interface)
{}
Job::~Job()
@@ -249,11 +249,11 @@
}
LoadJob::LoadJob(Archive *archive)
- : LoadJob(archive, Q_NULLPTR)
+ : LoadJob(archive, nullptr)
{}
LoadJob::LoadJob(ReadOnlyArchiveInterface *interface)
- : LoadJob(Q_NULLPTR, interface)
+ : LoadJob(nullptr, interface)
{}
void LoadJob::doWork()
@@ -631,7 +631,7 @@
}
// Count total number of entries to be added.
- qulonglong totalCount = 0;
+ uint totalCount = 0;
QElapsedTimer timer;
timer.start();
foreach (const Archive::Entry* entry, m_entries) {
@@ -647,7 +647,7 @@
qCDebug(ARK) << "AddJob: going to add" << totalCount << "entries, counted in" << timer.elapsed() << "ms";
- QString desc = i18np("Adding a file", "Adding %1 files", totalCount);
+ const QString desc = i18np("Compressing a file", "Compressing %1 files", totalCount);
emit description(this, desc, qMakePair(i18n("Archive"), archiveInterface()->filename()));
ReadWriteArchiveInterface *m_writeInterface =
diff -Nru ark-16.12.3/kerfuffle/jobs.h ark-17.04.3/kerfuffle/jobs.h
--- ark-16.12.3/kerfuffle/jobs.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/jobs.h 2017-07-09 22:45:29.000000000 +0000
@@ -54,15 +54,15 @@
* @warning This method should not be called before start().
*/
Archive *archive() const;
- QString errorString() const Q_DECL_OVERRIDE;
- void start() Q_DECL_OVERRIDE;
+ QString errorString() const override;
+ void start() override;
protected:
Job(Archive *archive, ReadOnlyArchiveInterface *interface);
Job(Archive *archive);
Job(ReadOnlyArchiveInterface *interface);
- virtual ~Job();
- virtual bool doKill() Q_DECL_OVERRIDE;
+ ~Job() override;
+ bool doKill() override;
ReadOnlyArchiveInterface *archiveInterface();
QVector m_archiveEntries;
@@ -127,10 +127,10 @@
QString subfolderName() const;
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
protected slots:
- virtual void onFinished(bool result) Q_DECL_OVERRIDE;
+ void onFinished(bool result) override;
private:
explicit LoadJob(Archive *archive, ReadOnlyArchiveInterface *interface);
@@ -164,10 +164,10 @@
void userQuery(Query *query);
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
protected:
- virtual bool doKill() Q_DECL_OVERRIDE;
+ bool doKill() override;
private slots:
void slotLoadingProgress(double progress);
@@ -184,7 +184,7 @@
void setupDestination();
Step m_step = Loading;
- ExtractJob *m_extractJob = Q_NULLPTR;
+ ExtractJob *m_extractJob = nullptr;
LoadJob *m_loadJob;
QString m_destination;
bool m_autoSubfolder;
@@ -214,13 +214,13 @@
void setMultiVolume(bool isMultiVolume);
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
protected:
- virtual bool doKill() Q_DECL_OVERRIDE;
+ bool doKill() override;
private:
- AddJob *m_addJob = Q_NULLPTR;
+ AddJob *m_addJob = nullptr;
QVector m_entries;
CompressionOptions m_options;
};
@@ -236,7 +236,7 @@
ExtractionOptions extractionOptions() const;
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
private:
@@ -272,7 +272,7 @@
QTemporaryDir *tempDir() const;
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
private:
QString extractionDir() const;
@@ -322,10 +322,10 @@
AddJob(const QVector &files, const Archive::Entry *destination, const CompressionOptions& options, ReadWriteArchiveInterface *interface);
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
protected slots:
- virtual void onFinished(bool result) Q_DECL_OVERRIDE;
+ void onFinished(bool result) override;
private:
QString m_oldWorkingDir;
@@ -346,10 +346,10 @@
MoveJob(const QVector &files, Archive::Entry *destination, const CompressionOptions& options, ReadWriteArchiveInterface *interface);
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
protected slots:
- virtual void onFinished(bool result) Q_DECL_OVERRIDE;
+ void onFinished(bool result) override;
private:
int m_finishedSignalsCount;
@@ -370,10 +370,10 @@
CopyJob(const QVector &entries, Archive::Entry *destination, const CompressionOptions& options, ReadWriteArchiveInterface *interface);
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
protected slots:
- virtual void onFinished(bool result) Q_DECL_OVERRIDE;
+ void onFinished(bool result) override;
private:
int m_finishedSignalsCount;
@@ -390,7 +390,7 @@
DeleteJob(const QVector &files, ReadWriteArchiveInterface *interface);
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
private:
QVector m_entries;
@@ -404,7 +404,7 @@
CommentJob(const QString& comment, ReadWriteArchiveInterface *interface);
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
private:
QString m_comment;
@@ -419,7 +419,7 @@
bool testSucceeded();
public slots:
- virtual void doWork() Q_DECL_OVERRIDE;
+ void doWork() override;
private slots:
virtual void onTestSuccess();
diff -Nru ark-16.12.3/kerfuffle/kerfufflePlugin.desktop ark-17.04.3/kerfuffle/kerfufflePlugin.desktop
--- ark-16.12.3/kerfuffle/kerfufflePlugin.desktop 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/kerfufflePlugin.desktop 2017-07-09 22:45:29.000000000 +0000
@@ -3,7 +3,7 @@
X-KDE-ServiceType=Kerfuffle/Plugin
Comment=Plugin for handling of archive formats for the Kerfuffle library
Comment[ar]=ملحق للتحكم بهيئات الأرشيف لمكتبة Kerfuffle
-Comment[ast]=Plugin pal remanamientu de formatos d'archivu pa la biblioteca Kerfuffle
+Comment[ast]=Complementu pa remanar formatos d'archivu pa la biblioteca Kerfuffle
Comment[bg]=Приствка за работа с архиви за Kerfuffle
Comment[bs]=Priključak za rukovanje formatima arhiva za biblioteku Kerfafl
Comment[ca]=Connector per a gestionar els formats d'arxiu per a la biblioteca Kerfuffle
@@ -26,6 +26,7 @@
Comment[hu]=Archívumkezelő modul a Kerfuffle programkönyvtárhoz
Comment[ia]=Plugin per manear formatos de archivo per le libreria Kerfuffle
Comment[id]=Pengaya untuk menangani format arsip pustaka Kerfuffle
+Comment[is]=Viðbót til meðhöndlunar á safnskráasniðum fyrir Kerfuffle aðgerðasafnið
Comment[it]=Estensione per gestire formati di archivio per la libreria Kerfuffle
Comment[ja]=Kerfuffle ライブラリのアーカイブ形式を扱うプラグイン
Comment[kk]=Kerfuffle жиын файлға арналған архив пішіндерімен айналасу плагині
diff -Nru ark-16.12.3/kerfuffle/mime/kerfuffle.xml ark-17.04.3/kerfuffle/mime/kerfuffle.xml
--- ark-16.12.3/kerfuffle/mime/kerfuffle.xml 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/mime/kerfuffle.xml 2017-07-09 22:45:29.000000000 +0000
@@ -6,9 +6,11 @@
Arxiu tar (comprimit amb LZIP)
Archiv Tar (komprimovaný lzip)
Tar-Archiv (lzip-komprimiert)
+ Αρχειοθήκη Tar (lzrip-συμπίεση)
Tar archive (lzip-compressed)
Archivo comprimido Tar (comprimido con lzip)
Tar-arhiiv (lzip-tihendusega)
+ Tar artxiboa (lzip bidez konprimatua)
Archivio Tar (compressione lzip)
TAR 압축 파일(LZIP 압축)
Tar-archief (lzip-gecomprimeerd)
@@ -29,13 +31,16 @@
XAR archive
+ Archivu XAR
Arxiu XAR
Arxiu XAR
Archiv XAR
XAR-Archiv
+ Αρχειοθήκη XAR
XAR archive
Archivo comprimido XAR
XAR-arhiiv
+ XAR artxiboa
Archivio XAR
XAR 압축 파일
XAR-archief
@@ -65,9 +70,11 @@
Arxiu tar (comprimit amb LZ4)
Archiv Tar (komprimovaný LZ4)
Tar-Archiv (LZ4-komprimiert)
+ Αρχειοθήκη Tar (LZ4-συμπίεση)
Tar archive (LZ4-compressed)
Archivo comprimido Tar (comprimido con LZ4)
Tar-arhiiv (LZ4 tihendusega)
+ Tar artxiboa (LZ4 bidez konprimatua)
Archivio Tar (compressione LZ4)
TAR 압축 파일(LZ4 압축)
Tar-archief (lz4-gecomprimeerd)
@@ -90,10 +97,13 @@
AppImage application bundle
Paquet d'aplicació «AppImage»
Paquet d'aplicació «AppImage»
+ Balíček aplikací AppImage
AppImage-Anwendungspaket
+ AppImage δέσμη εφαρμογής
AppImage application bundle
Paquete de aplicación AppImage
AppImage rakendusekimp
+ AppImage aplikazioaren paketea
Pacchetto applicazione AppImage
AppImage 프로그램 번들
Toepassingsbundel AppImage
diff -Nru ark-16.12.3/kerfuffle/options.cpp ark-17.04.3/kerfuffle/options.cpp
--- ark-16.12.3/kerfuffle/options.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/options.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -90,12 +90,12 @@
m_compressionLevel = level;
}
-int CompressionOptions::volumeSize() const
+ulong CompressionOptions::volumeSize() const
{
return m_volumeSize;
}
-void CompressionOptions::setVolumeSize(int size)
+void CompressionOptions::setVolumeSize(ulong size)
{
m_volumeSize = size;
}
diff -Nru ark-16.12.3/kerfuffle/options.h ark-17.04.3/kerfuffle/options.h
--- ark-16.12.3/kerfuffle/options.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/options.h 2017-07-09 22:45:29.000000000 +0000
@@ -67,8 +67,8 @@
int compressionLevel() const;
void setCompressionLevel(int level);
- int volumeSize() const;
- void setVolumeSize(int size);
+ ulong volumeSize() const;
+ void setVolumeSize(ulong size);
QString compressionMethod() const;
void setCompressionMethod(const QString &method);
QString encryptionMethod() const;
@@ -78,7 +78,7 @@
private:
int m_compressionLevel = -1;
- int m_volumeSize = 0;
+ ulong m_volumeSize = 0;
QString m_compressionMethod;
QString m_encryptionMethod;
QString m_globalWorkDir;
diff -Nru ark-16.12.3/kerfuffle/plugin.cpp ark-17.04.3/kerfuffle/plugin.cpp
--- ark-16.12.3/kerfuffle/plugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/plugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -41,7 +41,7 @@
{
}
-unsigned int Plugin::priority() const
+int Plugin::priority() const
{
const int priority = m_metaData.rawData()[QStringLiteral("X-KDE-Priority")].toInt();
return (priority > 0 ? priority : 0);
@@ -93,9 +93,14 @@
return m_metaData;
}
+bool Plugin::hasRequiredExecutables() const
+{
+ return findExecutables(readOnlyExecutables());
+}
+
bool Plugin::isValid() const
{
- return isEnabled() && m_metaData.isValid() && findExecutables(readOnlyExecutables());
+ return isEnabled() && m_metaData.isValid() && hasRequiredExecutables();
}
bool Plugin::findExecutables(const QStringList &executables)
diff -Nru ark-16.12.3/kerfuffle/plugin.h ark-17.04.3/kerfuffle/plugin.h
--- ark-16.12.3/kerfuffle/plugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/plugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -44,7 +44,7 @@
/**
* The priority of the plugin. The higher the better.
*/
- Q_PROPERTY(unsigned int priority READ priority CONSTANT)
+ Q_PROPERTY(int priority READ priority CONSTANT)
/**
* Whether the plugin has been enabled in the settings.
@@ -74,10 +74,10 @@
Q_PROPERTY(KPluginMetaData metaData READ metaData MEMBER m_metaData CONSTANT)
public:
- explicit Plugin(QObject *parent = Q_NULLPTR, const KPluginMetaData& metaData = KPluginMetaData());
+ explicit Plugin(QObject *parent = nullptr, const KPluginMetaData& metaData = KPluginMetaData());
- unsigned int priority() const;
+ int priority() const;
bool isEnabled() const;
void setEnabled(bool enabled);
bool isReadWrite() const;
@@ -86,6 +86,12 @@
KPluginMetaData metaData() const;
/**
+ * @return Whether the executables required for a functional plugin are installed.
+ * This is true if all the read-only executables are found in the path.
+ */
+ bool hasRequiredExecutables() const;
+
+ /**
* @return Whether the plugin is ready to be used.
* This implies isEnabled(), while an enabled plugin may not be valid.
* A read-write plugin downgraded to read-only is still valid.
diff -Nru ark-16.12.3/kerfuffle/pluginmanager.cpp ark-17.04.3/kerfuffle/pluginmanager.cpp
--- ark-16.12.3/kerfuffle/pluginmanager.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/pluginmanager.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -26,12 +26,17 @@
*/
#include "pluginmanager.h"
+#include "ark_debug.h"
+#include "settings.h"
#include
#include
#include
+#include
#include
+#include
+#include
#include
#include
@@ -136,6 +141,11 @@
supported.remove(QStringLiteral("application/x-lz4-compressed-tar"));
}
+ // Remove entry for lzo-compressed tar if libarchive not linked against lzo and lzop executable not found in path.
+ if (!libarchiveHasLzo() && QStandardPaths::findExecutable(QStringLiteral("lzop")).isEmpty()) {
+ supported.remove(QStringLiteral("application/x-tzo"));
+ }
+
if (mode == SortByComment) {
return sortByComment(supported);
}
@@ -165,6 +175,11 @@
supported.remove(QStringLiteral("application/x-lz4-compressed-tar"));
}
+ // Remove entry for lzo-compressed tar if libarchive not linked against lzo and lzop executable not found in path.
+ if (!libarchiveHasLzo() && QStandardPaths::findExecutable(QStringLiteral("lzop")).isEmpty()) {
+ supported.remove(QStringLiteral("application/x-tzo"));
+ }
+
if (mode == SortByComment) {
return sortByComment(supported);
}
@@ -195,12 +210,6 @@
void PluginManager::loadPlugins()
{
const QVector plugins = KPluginLoader::findPlugins(QStringLiteral("kerfuffle"));
- // This class might be used from executables other than ark (e.g. the tests),
- // so we need to specify the name of the config file.
- // TODO: once we have a GUI in the settings dialog,
- // use this group to write whether a plugin gets disabled.
- const KConfigGroup conf(KSharedConfig::openConfig(QStringLiteral("arkrc")), "EnabledPlugins");
-
QSet addedPlugins;
foreach (const KPluginMetaData &metaData, plugins) {
const auto pluginId = metaData.pluginId();
@@ -210,7 +219,7 @@
}
Plugin *plugin = new Plugin(this, metaData);
- plugin->setEnabled(conf.readEntry(pluginId, true));
+ plugin->setEnabled(!ArkSettings::disabledPlugins().contains(pluginId));
addedPlugins << pluginId;
m_plugins << plugin;
}
@@ -246,4 +255,35 @@
return sortedMimeTypes;
}
+bool PluginManager::libarchiveHasLzo()
+{
+ // Step 1: look for the libarchive plugin, which is built against libarchive.
+ const QString pluginPath = []() {
+ foreach (const QString &path, QCoreApplication::libraryPaths()) {
+ const QString pluginPath = QStringLiteral("%1/kerfuffle/kerfuffle_libarchive.so").arg(path);
+ if (QFileInfo::exists(pluginPath)) {
+ return pluginPath;
+ }
+ }
+
+ return QString();
+ }();
+
+ // Step 2: ldd the libarchive plugin to figure out the absolute libarchive path.
+ QProcess ldd;
+ ldd.start(QStringLiteral("ldd"), {pluginPath});
+ ldd.waitForFinished();
+ const QString output = QString::fromUtf8(ldd.readAllStandardOutput());
+ QRegularExpression regex(QStringLiteral("/.*/libarchive.so"));
+ if (!regex.match(output).hasMatch()) {
+ return false;
+ }
+
+ // Step 3: check whether libarchive links against liblzo.
+ const QString libarchivePath = regex.match(output).captured(0);
+ ldd.start(QStringLiteral("ldd"), {libarchivePath});
+ ldd.waitForFinished();
+ return ldd.readAllStandardOutput().contains(QByteArrayLiteral("lzo"));
+}
+
}
diff -Nru ark-16.12.3/kerfuffle/pluginmanager.h ark-17.04.3/kerfuffle/pluginmanager.h
--- ark-16.12.3/kerfuffle/pluginmanager.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/pluginmanager.h 2017-07-09 22:45:29.000000000 +0000
@@ -50,7 +50,7 @@
SortByComment
};
- explicit PluginManager(QObject *parent = Q_NULLPTR);
+ explicit PluginManager(QObject *parent = nullptr);
/**
* @return The list of all installed plugins.
@@ -130,6 +130,11 @@
*/
static QStringList sortByComment(const QSet &mimeTypes);
+ /**
+ * Workaround for libarchive >= 3.3 not linking against liblzo.
+ */
+ static bool libarchiveHasLzo();
+
QVector m_plugins;
QHash> m_preferredPluginsCache;
};
diff -Nru ark-16.12.3/kerfuffle/pluginsettingspage.cpp ark-17.04.3/kerfuffle/pluginsettingspage.cpp
--- ark-16.12.3/kerfuffle/pluginsettingspage.cpp 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/kerfuffle/pluginsettingspage.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,111 @@
+/*
+ * ark -- archiver for the KDE project
+ *
+ * Copyright (C) 2016 Elvis Angelaccio
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "pluginsettingspage.h"
+#include "ark_debug.h"
+
+#include
+
+#include
+
+namespace Kerfuffle
+{
+
+PluginSettingsPage::PluginSettingsPage(QWidget *parent, const QString &name, const QString &iconName)
+ : SettingsPage(parent, name, iconName)
+{
+ setupUi(this);
+
+ foreach (const auto plugin, m_pluginManager.installedPlugins()) {
+ const auto metaData = plugin->metaData();
+ auto item = new QTreeWidgetItem(kcfg_disabledPlugins);
+ item->setData(0, Qt::UserRole, QVariant::fromValue(plugin));
+ item->setText(0, metaData.name());
+ item->setText(1, metaData.description());
+ item->setCheckState(0, plugin->isEnabled() ? Qt::Checked : Qt::Unchecked);
+ if (!plugin->isEnabled()) {
+ m_toBeDisabled << metaData.pluginId();
+ }
+ if (!plugin->hasRequiredExecutables()) {
+ item->setDisabled(true);
+ for (int i : {0, 1}) {
+ item->setToolTip(i, i18n("The plugin cannot be used because one or more required executables are missing. Check your installation."));
+ }
+ }
+ }
+
+ for (int i : {0, 1}) {
+ kcfg_disabledPlugins->resizeColumnToContents(i);
+ }
+ kcfg_disabledPlugins->sortItems(0, Qt::AscendingOrder);
+ connect(kcfg_disabledPlugins, &QTreeWidget::itemChanged, this, &PluginSettingsPage::slotItemChanged);
+
+ // Set the custom property that KConfigDialogManager will use to update the settings.
+ kcfg_disabledPlugins->setProperty("kcfg_property", QByteArray("disabledPlugins"));
+ // Tell KConfigDialogManager to monitor the itemChanged signal for a QTreeWidget instance in the dialog.
+ KConfigDialogManager::changedMap()->insert(QString::fromLatin1(QTreeWidget::staticMetaObject.className()),
+ SIGNAL(itemChanged(QTreeWidgetItem*,int)));
+}
+
+void PluginSettingsPage::slotSettingsChanged()
+{
+ m_toBeDisabled.clear();
+}
+
+void PluginSettingsPage::slotDefaultsButtonClicked()
+{
+ // KConfigDialogManager doesn't know how to reset the QTreeWidget, we need to do it manually.
+ QTreeWidgetItemIterator iterator(kcfg_disabledPlugins);
+ while (*iterator) {
+ auto item = *iterator;
+ // By default every plugin is enabled.
+ item->setCheckState(0, Qt::Checked);
+ iterator++;
+ }
+}
+
+void PluginSettingsPage::slotItemChanged(QTreeWidgetItem *item)
+{
+ auto plugin = item->data(0, Qt::UserRole).value();
+ if (!plugin) {
+ return;
+ }
+
+ const auto pluginId = plugin->metaData().pluginId();
+ plugin->setEnabled(item->checkState(0) == Qt::Checked);
+ // If unchecked, add to the list of plugins that will be disabled.
+ m_toBeDisabled.removeAll(pluginId);
+ if (!plugin->isEnabled()) {
+ m_toBeDisabled << pluginId;
+ }
+ // Enable the Apply button by setting the property.
+ qCDebug(ARK) << "Going to disable the following plugins:" << m_toBeDisabled;
+ kcfg_disabledPlugins->setProperty("disabledPlugins", m_toBeDisabled);
+}
+
+}
+
diff -Nru ark-16.12.3/kerfuffle/pluginsettingspage.h ark-17.04.3/kerfuffle/pluginsettingspage.h
--- ark-16.12.3/kerfuffle/pluginsettingspage.h 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/kerfuffle/pluginsettingspage.h 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,59 @@
+/*
+ * ark -- archiver for the KDE project
+ *
+ * Copyright (C) 2016 Elvis Angelaccio
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PLUGINSETTINGSPAGE_H
+#define PLUGINSETTINGSPAGE_H
+
+#include "settingspage.h"
+#include "pluginmanager.h"
+#include "ui_pluginsettingspage.h"
+
+class QTreeWidgetItem;
+
+namespace Kerfuffle
+{
+class KERFUFFLE_EXPORT PluginSettingsPage : public SettingsPage, public Ui::PluginSettingsPage
+{
+ Q_OBJECT
+
+public:
+ explicit PluginSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString());
+
+public slots:
+ void slotSettingsChanged() override;
+ void slotDefaultsButtonClicked() override;
+
+private slots:
+ void slotItemChanged(QTreeWidgetItem *item);
+
+private:
+ QStringList m_toBeDisabled; // List of plugins that will be disabled upon clicking the Apply button.
+ PluginManager m_pluginManager;
+};
+}
+
+#endif
diff -Nru ark-16.12.3/kerfuffle/pluginsettingspage.ui ark-17.04.3/kerfuffle/pluginsettingspage.ui
--- ark-16.12.3/kerfuffle/pluginsettingspage.ui 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/kerfuffle/pluginsettingspage.ui 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,38 @@
+
+
+ PluginSettingsPage
+
+
+
+ 0
+ 0
+ 547
+ 487
+
+
+
+ -
+
+
+ false
+
+
+ 2
+
+
+
+ Name
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+
diff -Nru ark-16.12.3/kerfuffle/previewsettingspage.h ark-17.04.3/kerfuffle/previewsettingspage.h
--- ark-16.12.3/kerfuffle/previewsettingspage.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/previewsettingspage.h 2017-07-09 22:45:29.000000000 +0000
@@ -29,16 +29,16 @@
#define PREVIEWSETTINGSPAGE_H
#include "settingspage.h"
-#include "ui_previewsettings.h"
+#include "ui_previewsettingspage.h"
namespace Kerfuffle
{
-class KERFUFFLE_EXPORT PreviewSettingsPage : public SettingsPage, public Ui::PreviewSettings
+class KERFUFFLE_EXPORT PreviewSettingsPage : public SettingsPage, public Ui::PreviewSettingsPage
{
Q_OBJECT
public:
- explicit PreviewSettingsPage(QWidget *parent = 0, const QString &name = QString(), const QString &iconName = QString());
+ explicit PreviewSettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString());
private slots:
void slotToggled(bool enabled);
diff -Nru ark-16.12.3/kerfuffle/previewsettingspage.ui ark-17.04.3/kerfuffle/previewsettingspage.ui
--- ark-16.12.3/kerfuffle/previewsettingspage.ui 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/kerfuffle/previewsettingspage.ui 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,67 @@
+
+
+ PreviewSettingsPage
+
+
+
+ 0
+ 0
+ 547
+ 487
+
+
+
+ -
+
+ -
+
+
+ true
+
+
+ Disable preview for files larger than:
+
+
+ true
+
+
+
+ -
+
+
+ megabytes
+
+
+ 10
+
+
+ 10000
+
+
+ 10
+
+
+ 200
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+
diff -Nru ark-16.12.3/kerfuffle/previewsettings.ui ark-17.04.3/kerfuffle/previewsettings.ui
--- ark-16.12.3/kerfuffle/previewsettings.ui 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/previewsettings.ui 1970-01-01 00:00:00.000000000 +0000
@@ -1,67 +0,0 @@
-
-
- PreviewSettings
-
-
-
- 0
- 0
- 547
- 487
-
-
-
- -
-
- -
-
-
- true
-
-
- Disable preview for files larger than:
-
-
- true
-
-
-
- -
-
-
- megabytes
-
-
- 10
-
-
- 10000
-
-
- 10
-
-
- 200
-
-
-
-
-
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 40
-
-
-
-
-
-
-
-
-
diff -Nru ark-16.12.3/kerfuffle/propertiesdialog.cpp ark-17.04.3/kerfuffle/propertiesdialog.cpp
--- ark-16.12.3/kerfuffle/propertiesdialog.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/propertiesdialog.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -26,6 +26,7 @@
*/
#include "propertiesdialog.h"
+#include "archive_kerfuffle.h"
#include "ark_debug.h"
#include "ui_propertiesdialog.h"
@@ -45,7 +46,7 @@
Q_OBJECT
public:
- PropertiesDialogUI(QWidget *parent = 0)
+ PropertiesDialogUI(QWidget *parent = nullptr)
: QWidget(parent) {
setupUi(this);
}
diff -Nru ark-16.12.3/kerfuffle/propertiesdialog.h ark-17.04.3/kerfuffle/propertiesdialog.h
--- ark-16.12.3/kerfuffle/propertiesdialog.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/propertiesdialog.h 2017-07-09 22:45:29.000000000 +0000
@@ -28,7 +28,7 @@
#ifndef PROPERTIESDIALOG_H
#define PROPERTIESDIALOG_H
-#include "kerfuffle/archive_kerfuffle.h"
+#include "kerfuffle_export.h"
#include
#include
@@ -37,6 +37,9 @@
namespace Kerfuffle
{
+
+class Archive;
+
class KERFUFFLE_EXPORT PropertiesDialog : public QDialog
{
Q_OBJECT
diff -Nru ark-16.12.3/kerfuffle/queries.cpp ark-17.04.3/kerfuffle/queries.cpp
--- ark-16.12.3/kerfuffle/queries.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/queries.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -91,7 +91,7 @@
QUrl destUrl = QUrl::fromLocalFile(QDir::cleanPath(m_data.value(QStringLiteral("filename")).toString()));
QPointer dialog = new KIO::RenameDialog(
- Q_NULLPTR,
+ nullptr,
i18nc("@title:window", "File Already Exists"),
sourceUrl,
destUrl,
@@ -213,7 +213,7 @@
qCDebug(ARK) << "Executing LoadCorrupt prompt";
QApplication::setOverrideCursor(QCursor(Qt::ArrowCursor));
- setResponse(KMessageBox::warningYesNo(Q_NULLPTR,
+ setResponse(KMessageBox::warningYesNo(nullptr,
xi18nc("@info", "The archive you're trying to open is corrupt. "
"Some files may be missing or damaged."),
i18nc("@title:window", "Corrupt archive"),
diff -Nru ark-16.12.3/kerfuffle/queries.h ark-17.04.3/kerfuffle/queries.h
--- ark-16.12.3/kerfuffle/queries.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/queries.h 2017-07-09 22:45:29.000000000 +0000
@@ -82,7 +82,7 @@
{
public:
explicit OverwriteQuery(const QString& filename);
- void execute() Q_DECL_OVERRIDE;
+ void execute() override;
bool responseCancelled();
bool responseOverwriteAll();
bool responseOverwrite();
@@ -108,7 +108,7 @@
{
public:
explicit PasswordNeededQuery(const QString& archiveFilename, bool incorrectTryAgain = false);
- void execute() Q_DECL_OVERRIDE;
+ void execute() override;
bool responseCancelled();
QString password();
@@ -122,7 +122,7 @@
{
public:
explicit LoadCorruptQuery(const QString& archiveFilename);
- void execute() Q_DECL_OVERRIDE;
+ void execute() override;
bool responseYes();
};
@@ -131,7 +131,7 @@
{
public:
explicit ContinueExtractionQuery(const QString& error, const QString& archiveEntry);
- void execute() Q_DECL_OVERRIDE;
+ void execute() override;
bool responseCancelled();
bool dontAskAgain();
diff -Nru ark-16.12.3/kerfuffle/settingsdialog.cpp ark-17.04.3/kerfuffle/settingsdialog.cpp
--- ark-16.12.3/kerfuffle/settingsdialog.cpp 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/kerfuffle/settingsdialog.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,43 @@
+/*
+ * ark -- archiver for the KDE project
+ *
+ * Copyright (C) 2016 Elvis Angelaccio
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "settingsdialog.h"
+
+namespace Kerfuffle
+{
+
+SettingsDialog::SettingsDialog(QWidget *parent, const QString &name, KCoreConfigSkeleton *config)
+ : KConfigDialog(parent, name, config)
+{}
+
+void SettingsDialog::updateWidgetsDefault()
+{
+ emit defaultsButtonClicked();
+}
+
+}
+
diff -Nru ark-16.12.3/kerfuffle/settingsdialog.h ark-17.04.3/kerfuffle/settingsdialog.h
--- ark-16.12.3/kerfuffle/settingsdialog.h 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/kerfuffle/settingsdialog.h 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,58 @@
+/*
+ * ark -- archiver for the KDE project
+ *
+ * Copyright (C) 2016 Elvis Angelaccio
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SETTINGSDIALOG_H
+#define SETTINGSDIALOG_H
+
+#include "kerfuffle_export.h"
+
+#include
+
+namespace Kerfuffle
+{
+
+/**
+ * A custom KConfigDialog that emits a signal when the Default button has been clicked.
+ */
+class KERFUFFLE_EXPORT SettingsDialog : public KConfigDialog
+{
+ Q_OBJECT
+
+public:
+ explicit SettingsDialog(QWidget *parent, const QString &name, KCoreConfigSkeleton *config);
+
+signals:
+ void defaultsButtonClicked();
+
+protected slots:
+ void updateWidgetsDefault() override;
+
+};
+
+}
+
+#endif
diff -Nru ark-16.12.3/kerfuffle/settings.kcfgc ark-17.04.3/kerfuffle/settings.kcfgc
--- ark-16.12.3/kerfuffle/settings.kcfgc 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/settings.kcfgc 2017-07-09 22:45:29.000000000 +0000
@@ -3,6 +3,6 @@
Singleton=true
Mutators=true
SetUserTexts=true
-IncludeFiles=\"kerfuffle/kerfuffle_export.h\"
+IncludeFiles=\"kerfuffle_export.h\"
Visibility=KERFUFFLE_EXPORT
GenerateProperties=true
diff -Nru ark-16.12.3/kerfuffle/settingspage.cpp ark-17.04.3/kerfuffle/settingspage.cpp
--- ark-16.12.3/kerfuffle/settingspage.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/settingspage.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -44,5 +44,14 @@
{
return m_iconName;
}
+
+void SettingsPage::slotSettingsChanged()
+{
+}
+
+void SettingsPage::slotDefaultsButtonClicked()
+{
+}
+
}
diff -Nru ark-16.12.3/kerfuffle/settingspage.h ark-17.04.3/kerfuffle/settingspage.h
--- ark-16.12.3/kerfuffle/settingspage.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/kerfuffle/settingspage.h 2017-07-09 22:45:29.000000000 +0000
@@ -39,11 +39,15 @@
Q_OBJECT
public:
- explicit SettingsPage(QWidget *parent = 0, const QString &name = QString(), const QString &iconName = QString());
+ explicit SettingsPage(QWidget *parent = nullptr, const QString &name = QString(), const QString &iconName = QString());
QString name() const;
QString iconName() const;
+public slots:
+ virtual void slotSettingsChanged();
+ virtual void slotDefaultsButtonClicked();
+
private:
QString m_name;
QString m_iconName;
diff -Nru ark-16.12.3/part/archivemodel.cpp ark-17.04.3/part/archivemodel.cpp
--- ark-16.12.3/part/archivemodel.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/archivemodel.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -23,10 +23,11 @@
*/
#include "archivemodel.h"
+#include "ark_debug.h"
#include "jobs.h"
+#include
#include
-#include
#include
#include
@@ -37,29 +38,9 @@
using namespace Kerfuffle;
// Used to speed up the loading of large archives.
-static Archive::Entry *s_previousMatch = Q_NULLPTR;
+static Archive::Entry *s_previousMatch = nullptr;
Q_GLOBAL_STATIC(QStringList, s_previousPieces)
-/**
- * Meta data related to one entry in a compressed archive.
- *
- * This is used for indexing entry properties as numbers
- * and for determining data displaying order in part's view.
- */
-enum EntryMetaDataType {
- FullPath, /**< The entry's file name */
- Size, /**< The entry's original size */
- CompressedSize, /**< The compressed size for the entry */
- Permissions, /**< The entry's permissions */
- Owner, /**< The user the entry belongs to */
- Group, /**< The user group the entry belongs to */
- Ratio, /**< The compression ratio for the entry */
- CRC, /**< The entry's CRC */
- Method, /**< The compression method used on the entry */
- Version, /**< The archiver version needed to extract the entry */
- Timestamp /**< The timestamp for the current entry */
-};
-
ArchiveModel::ArchiveModel(const QString &dbusPathName, QObject *parent)
: QAbstractItemModel(parent)
, m_dbusPathName(dbusPathName)
@@ -101,10 +82,10 @@
return entry->name();
case Size:
if (entry->isDir()) {
- int dirs;
- int files;
- const int children = childCount(index, dirs, files);
- return KIO::itemsSummaryString(children, files, dirs, 0, false);
+ uint dirs;
+ uint files;
+ entry->countChildren(dirs, files);
+ return KIO::itemsSummaryString(dirs + files, files, dirs, 0, false);
} else if (!entry->property("link").toString().isEmpty()) {
return QVariant();
} else {
@@ -171,7 +152,7 @@
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | defaultFlags;
}
- return 0;
+ return nullptr;
}
QVariant ArchiveModel::headerData(int section, Qt::Orientation, int role) const
@@ -225,8 +206,8 @@
Q_ASSERT(parentEntry->isDir());
- const Archive::Entry *item = parentEntry->entries().value(row, Q_NULLPTR);
- if (item != Q_NULLPTR) {
+ const Archive::Entry *item = parentEntry->entries().value(row, nullptr);
+ if (item != nullptr) {
return createIndex(row, column, const_cast(item));
}
}
@@ -253,29 +234,7 @@
Q_ASSERT(item);
return item;
}
- return Q_NULLPTR;
-}
-
-int ArchiveModel::childCount(const QModelIndex &index, int &dirs, int &files) const
-{
- if (index.isValid()) {
- dirs = files = 0;
- Archive::Entry *item = static_cast(index.internalPointer());
- Q_ASSERT(item);
- if (item->isDir()) {
- const QVector entries = item->entries();
- foreach(const Archive::Entry *entry, entries) {
- if (entry->isDir()) {
- dirs++;
- } else {
- files++;
- }
- }
- return entries.count();
- }
- return 0;
- }
- return -1;
+ return nullptr;
}
int ArchiveModel::rowCount(const QModelIndex &parent) const
@@ -298,80 +257,6 @@
return m_showColumns.size();
}
-void ArchiveModel::sort(int column, Qt::SortOrder order)
-{
- if (m_showColumns.size() <= column) {
- return;
- }
-
- emit layoutAboutToBeChanged();
-
- QVector dirEntries;
- m_rootEntry->returnDirEntries(&dirEntries);
- dirEntries.append(m_rootEntry.data());
-
- foreach(Archive::Entry *dir, dirEntries) {
- QVector < QPair > sorting(dir->entries().count());
- for (int i = 0; i < dir->entries().count(); ++i) {
- Archive::Entry *item = dir->entries().at(i);
- sorting[i].first = item;
- sorting[i].second = i;
- }
-
- std::stable_sort(sorting.begin(), sorting.end(), [=](const QPair &left, const QPair &right) {
- const auto leftEntry = left.first;
- const auto rightEntry = right.first;
- bool isLessThan = false; // Whether the left entry is less than the right entry.
-
- // #234373: sort folders before files.
- if ((leftEntry->isDir()) && (!rightEntry->isDir())) {
- isLessThan = true;
- } else if ((!leftEntry->isDir()) && (rightEntry->isDir())) {
- isLessThan = false;
- } else {
- const QVariant leftEntryMetaData = leftEntry->property(m_propertiesMap[column]);
- const QVariant rightEntryMetaData = rightEntry->property(m_propertiesMap[column]);
-
- switch (column) {
- case FullPath:
- isLessThan = leftEntry->name() < rightEntry->name();
- break;
- case Size:
- case CompressedSize:
- isLessThan = leftEntryMetaData.toInt() < rightEntryMetaData.toInt();
- break;
- default:
- isLessThan = leftEntryMetaData.toString() < rightEntryMetaData.toString();
- break;
- }
- }
-
- if (order == Qt::AscendingOrder) {
- return isLessThan;
- }
- // Descending order.
- return !isLessThan;
- });
-
- QModelIndexList fromIndexes;
- QModelIndexList toIndexes;
- for (int r = 0; r < sorting.count(); ++r) {
- Archive::Entry *item = sorting.at(r).first;
- toIndexes.append(createIndex(r, 0, item));
- fromIndexes.append(createIndex(sorting.at(r).second, 0, sorting.at(r).first));
- dir->setEntryAt(r, sorting.at(r).first);
- }
-
- changePersistentIndexList(fromIndexes, toIndexes);
-
- emit dataChanged(
- index(0, 0, indexForEntry(dir)),
- index(dir->entries().size() - 1, 0, indexForEntry(dir)));
- }
-
- emit layoutChanged();
-}
-
Qt::DropActions ArchiveModel::supportedDropActions() const
{
return Qt::CopyAction | Qt::MoveAction;
@@ -426,7 +311,7 @@
paths << url.toLocalFile();
}
- const Archive::Entry *entry = Q_NULLPTR;
+ const Archive::Entry *entry = nullptr;
QModelIndex droppedOnto = index(row, column, parent);
if (droppedOnto.isValid()) {
entry = entryForIndex(droppedOnto);
@@ -467,7 +352,7 @@
{
QStringList pieces = entry->fullPath().split(QLatin1Char('/'), QString::SkipEmptyParts);
if (pieces.isEmpty()) {
- return Q_NULLPTR;
+ return nullptr;
}
pieces.removeLast();
@@ -694,8 +579,8 @@
void ArchiveModel::reset()
{
- m_archive.reset(Q_NULLPTR);
- s_previousMatch = Q_NULLPTR;
+ m_archive.reset(nullptr);
+ s_previousMatch = nullptr;
s_previousPieces->clear();
initRootEntry();
@@ -766,7 +651,7 @@
AddJob* ArchiveModel::addFiles(QVector &entries, const Archive::Entry *destination, const CompressionOptions& options)
{
if (!m_archive) {
- return Q_NULLPTR;
+ return nullptr;
}
if (!m_archive->isReadOnly()) {
@@ -777,13 +662,13 @@
return job;
}
- return Q_NULLPTR;
+ return nullptr;
}
Kerfuffle::MoveJob *ArchiveModel::moveFiles(QVector &entries, Archive::Entry *destination, const CompressionOptions &options)
{
if (!m_archive) {
- return Q_NULLPTR;
+ return nullptr;
}
if (!m_archive->isReadOnly()) {
@@ -796,12 +681,12 @@
return job;
}
- return Q_NULLPTR;
+ return nullptr;
}
Kerfuffle::CopyJob *ArchiveModel::copyFiles(QVector &entries, Archive::Entry *destination, const CompressionOptions &options)
{
if (!m_archive) {
- return Q_NULLPTR;
+ return nullptr;
}
if (!m_archive->isReadOnly()) {
@@ -812,7 +697,7 @@
return job;
}
- return Q_NULLPTR;
+ return nullptr;
}
DeleteJob* ArchiveModel::deleteFiles(QVector entries)
@@ -827,7 +712,7 @@
connect(job, &DeleteJob::userQuery, this, &ArchiveModel::slotUserQuery);
return job;
}
- return Q_NULLPTR;
+ return nullptr;
}
void ArchiveModel::encryptArchive(const QString &password, bool encryptHeader)
@@ -871,7 +756,7 @@
bool isDir = entry.right(1) == QLatin1String("/");
const Archive::Entry *archiveEntry = lastDirEntry->find(entry.split(QLatin1Char('/'), QString::SkipEmptyParts).last());
- if (archiveEntry != Q_NULLPTR) {
+ if (archiveEntry != nullptr) {
if (archiveEntry->isDir() != isDir || !allowMerging) {
if (isDir) {
skippedDirPath = lastDirEntry->fullPath();
@@ -1008,3 +893,13 @@
{
return m_uncompressedSize;
}
+
+QList ArchiveModel::shownColumns() const
+{
+ return m_showColumns;
+}
+
+QMap ArchiveModel::propertiesMap() const
+{
+ return m_propertiesMap;
+}
diff -Nru ark-16.12.3/part/archivemodel.h ark-17.04.3/part/archivemodel.h
--- ark-16.12.3/part/archivemodel.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/archivemodel.h 2017-07-09 22:45:29.000000000 +0000
@@ -37,38 +37,58 @@
class Query;
}
+/**
+ * Meta data related to one entry in a compressed archive.
+ *
+ * This is used for indexing entry properties as numbers
+ * and for determining data displaying order in part's view.
+ */
+enum EntryMetaDataType {
+ FullPath, /**< The entry's file name */
+ Size, /**< The entry's original size */
+ CompressedSize, /**< The compressed size for the entry */
+ Permissions, /**< The entry's permissions */
+ Owner, /**< The user the entry belongs to */
+ Group, /**< The user group the entry belongs to */
+ Ratio, /**< The compression ratio for the entry */
+ CRC, /**< The entry's CRC */
+ Method, /**< The compression method used on the entry */
+ Version, /**< The archiver version needed to extract the entry */
+ Timestamp /**< The timestamp for the current entry */
+};
+
class ArchiveModel: public QAbstractItemModel
{
Q_OBJECT
public:
- explicit ArchiveModel(const QString &dbusPathName, QObject *parent = 0);
- ~ArchiveModel();
+ explicit ArchiveModel(const QString &dbusPathName, QObject *parent = nullptr);
+ ~ArchiveModel() override;
- QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
- Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex &index, int role) const override;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant headerData(int section, Qt::Orientation orientation,
- int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
+ int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column,
- const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE;
- int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
- int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
-
- virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) Q_DECL_OVERRIDE;
+ const QModelIndex &parent = QModelIndex()) const override;
+ QModelIndex parent(const QModelIndex &index) const override;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
//drag and drop related
- Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
- QStringList mimeTypes() const Q_DECL_OVERRIDE;
- QMimeData *mimeData(const QModelIndexList & indexes) const Q_DECL_OVERRIDE;
- bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) Q_DECL_OVERRIDE;
+ Qt::DropActions supportedDropActions() const override;
+ QStringList mimeTypes() const override;
+ QMimeData *mimeData(const QModelIndexList & indexes) const override;
+ bool dropMimeData(const QMimeData * data, Qt::DropAction action, int row, int column, const QModelIndex & parent) override;
void reset();
void createEmptyArchive(const QString &path, const QString &mimeType, QObject *parent);
KJob* loadArchive(const QString &path, const QString &mimeType, QObject *parent);
Kerfuffle::Archive *archive() const;
+ QList shownColumns() const;
+ QMap propertiesMap() const;
+
Archive::Entry *entryForIndex(const QModelIndex &index);
- int childCount(const QModelIndex &index, int &dirs, int &files) const;
Kerfuffle::ExtractJob* extractFile(Archive::Entry *file, const QString& destinationDir, const Kerfuffle::ExtractionOptions& options = Kerfuffle::ExtractionOptions()) const;
Kerfuffle::ExtractJob* extractFiles(const QVector& files, const QString& destinationDir, const Kerfuffle::ExtractionOptions& options = Kerfuffle::ExtractionOptions()) const;
diff -Nru ark-16.12.3/part/archivesortfiltermodel.cpp ark-17.04.3/part/archivesortfiltermodel.cpp
--- ark-16.12.3/part/archivesortfiltermodel.cpp 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/part/archivesortfiltermodel.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,66 @@
+/*
+ * ark -- archiver for the KDE project
+ *
+ * Copyright (c) 2016 Ragnar Thomsen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "archivesortfiltermodel.h"
+#include "archiveentry.h"
+#include "archivemodel.h"
+
+using namespace Kerfuffle;
+
+ArchiveSortFilterModel::ArchiveSortFilterModel(QObject *parent)
+ : KRecursiveFilterProxyModel(parent)
+{
+}
+
+ArchiveSortFilterModel::~ArchiveSortFilterModel()
+{
+}
+
+bool ArchiveSortFilterModel::lessThan(const QModelIndex &leftIndex,
+ const QModelIndex &rightIndex) const
+{
+ ArchiveModel *srcModel = qobject_cast(sourceModel());
+ const int col = srcModel->shownColumns().at(leftIndex.column());
+ const QByteArray property = srcModel->propertiesMap().value(col);
+
+ const Archive::Entry *left = srcModel->entryForIndex(leftIndex);
+ const Archive::Entry *right = srcModel->entryForIndex(rightIndex);
+
+ if (left->isDir() && !right->isDir()) {
+ return true;
+ } else if (!left->isDir() && right->isDir()) {
+ return false;
+ } else {
+ switch (col) {
+ case Size:
+ case CompressedSize:
+ if (left->property(property).toULongLong() < right->property(property).toULongLong()) {
+ return true;
+ }
+ break;
+ default:
+ if (left->property(property).toString() < right->property(property).toString()) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
diff -Nru ark-16.12.3/part/archivesortfiltermodel.h ark-17.04.3/part/archivesortfiltermodel.h
--- ark-16.12.3/part/archivesortfiltermodel.h 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/part/archivesortfiltermodel.h 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,37 @@
+/*
+ * ark -- archiver for the KDE project
+ *
+ * Copyright (c) 2016 Ragnar Thomsen
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+#ifndef ARCHIVESORTFILTERMODEL_H
+#define ARCHIVESORTFILTERMODEL_H
+
+#include
+
+class ArchiveSortFilterModel: public KRecursiveFilterProxyModel
+{
+ Q_OBJECT
+
+public:
+ explicit ArchiveSortFilterModel(QObject *parent = nullptr);
+ ~ArchiveSortFilterModel() override;
+
+ bool lessThan(const QModelIndex &leftIndex, const QModelIndex &rightIndex) const override;
+};
+
+#endif // ARCHIVESORTFILTERMODEL_H
diff -Nru ark-16.12.3/part/archiveview.cpp ark-17.04.3/part/archiveview.cpp
--- ark-16.12.3/part/archiveview.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/archiveview.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -59,6 +59,13 @@
QTreeView::startDrag(supportedActions);
}
+void ArchiveView::expandIfSingleFolder()
+{
+ if (model()->rowCount() == 1) {
+ expandToDepth(0);
+ }
+}
+
void ArchiveView::setDropsEnabled(bool enabled)
{
setAcceptDrops(enabled);
diff -Nru ark-16.12.3/part/archiveview.h ark-17.04.3/part/archiveview.h
--- ark-16.12.3/part/archiveview.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/archiveview.h 2017-07-09 22:45:29.000000000 +0000
@@ -32,11 +32,17 @@
Q_OBJECT
public:
- explicit ArchiveView(QWidget *parent = 0);
- virtual void dragEnterEvent(class QDragEnterEvent * event) Q_DECL_OVERRIDE;
- virtual void dropEvent(class QDropEvent * event) Q_DECL_OVERRIDE;
- virtual void dragMoveEvent(class QDragMoveEvent * event) Q_DECL_OVERRIDE;
- virtual void startDrag(Qt::DropActions supportedActions) Q_DECL_OVERRIDE;
+ explicit ArchiveView(QWidget *parent = nullptr);
+ void dragEnterEvent(class QDragEnterEvent * event) override;
+ void dropEvent(class QDropEvent * event) override;
+ void dragMoveEvent(class QDragMoveEvent * event) override;
+ void startDrag(Qt::DropActions supportedActions) override;
+
+ /**
+ * Expand the first level in the view if there is only one root folder.
+ * Typical use case: an archive with source code.
+ */
+ void expandIfSingleFolder();
/**
* Set whether the view should accept drop events.
@@ -46,9 +52,9 @@
void openEntryEditor(const QModelIndex &index);
protected:
- virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
- virtual void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
+ bool eventFilter(QObject *object, QEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
signals:
void entryChanged(const QString &name);
@@ -56,7 +62,7 @@
private:
void closeEntryEditor();
QModelIndex m_editorIndex;
- QLineEdit *m_entryEditor = Q_NULLPTR;
+ QLineEdit *m_entryEditor = nullptr;
};
#endif /* ARCHIVEVIEW_H */
diff -Nru ark-16.12.3/part/ark_part.rc ark-17.04.3/part/ark_part.rc
--- ark-16.12.3/part/ark_part.rc 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/ark_part.rc 2017-07-09 22:45:29.000000000 +0000
@@ -1,5 +1,5 @@
-
+
&Archive
@@ -7,8 +7,9 @@
-
+
+
&File
@@ -34,6 +35,7 @@
+
diff -Nru ark-16.12.3/part/arkviewer.cpp ark-17.04.3/part/arkviewer.cpp
--- ark-16.12.3/part/arkviewer.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/arkviewer.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -105,7 +105,7 @@
const QList fileUrlList = {QUrl::fromLocalFile(fileName)};
// The last argument (tempFiles) set to true means that the temporary
// file will be removed when the viewer application exits.
- KRun::runService(*viewer, fileUrlList, Q_NULLPTR, true);
+ KRun::runService(*viewer, fileUrlList, nullptr, true);
return;
}
@@ -122,7 +122,7 @@
// File has a defined MIME type, and not the default
// application/octet-stream. So it could be viewable as
// plain text, ask the user.
- response = KMessageBox::warningContinueCancel(Q_NULLPTR,
+ response = KMessageBox::warningContinueCancel(nullptr,
xi18n("The internal viewer cannot preview this type of file (%1). Do you want to try to view it as plain text?", mimeType.name()),
i18nc("@title:window", "Cannot Preview File"),
KGuiItem(i18nc("@action:button", "Preview as Text"), QIcon::fromTheme(QStringLiteral("text-plain"))),
@@ -134,7 +134,7 @@
// There is still a possibility that it could be viewable as plain
// text, so ask the user. Not the same as the message/question
// above, because the wording and default are different.
- response = KMessageBox::warningContinueCancel(Q_NULLPTR,
+ response = KMessageBox::warningContinueCancel(nullptr,
xi18n("The internal viewer cannot preview this unknown type of file. Do you want to try to view it as plain text?"),
i18nc("@title:window", "Cannot Preview File"),
KGuiItem(i18nc("@action:button", "Preview as Text"), QIcon::fromTheme(QStringLiteral("text-plain"))),
@@ -162,7 +162,7 @@
return;
}
else {
- KMessageBox::sorry(Q_NULLPTR, i18n("The internal viewer cannot preview this file."));
+ KMessageBox::sorry(nullptr, i18n("The internal viewer cannot preview this file."));
delete internalViewer;
}
}
diff -Nru ark-16.12.3/part/arkviewer.h ark-17.04.3/part/arkviewer.h
--- ark-16.12.3/part/arkviewer.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/arkviewer.h 2017-07-09 22:45:29.000000000 +0000
@@ -37,7 +37,7 @@
Q_OBJECT
public:
- virtual ~ArkViewer();
+ ~ArkViewer() override;
static void view(const QString& fileName);
diff -Nru ark-16.12.3/part/CMakeLists.txt ark-17.04.3/part/CMakeLists.txt
--- ark-16.12.3/part/CMakeLists.txt 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/CMakeLists.txt 2017-07-09 22:45:29.000000000 +0000
@@ -1,10 +1,9 @@
-include_directories(${CMAKE_SOURCE_DIR}/app)
-
set(arkpart_PART_SRCS
part.cpp
infopanel.cpp
arkviewer.cpp
archivemodel.cpp
+ archivesortfiltermodel.cpp
archiveview.cpp
jobtracker.cpp
overwritedialog.cpp
@@ -24,7 +23,7 @@
add_library(arkpart MODULE ${arkpart_PART_SRCS})
-target_link_libraries(arkpart kerfuffle KF5::Parts KF5::KIOFileWidgets)
+target_link_libraries(arkpart kerfuffle KF5::Parts KF5::KIOFileWidgets KF5::ItemModels)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/ark_part.desktop.cmake
diff -Nru ark-16.12.3/part/infopanel.cpp ark-17.04.3/part/infopanel.cpp
--- ark-16.12.3/part/infopanel.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/infopanel.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -20,10 +20,10 @@
*/
#include "infopanel.h"
-#include "kerfuffle/archiveentry.h"
+#include "archiveentry.h"
+#include
#include
-#include
#include
#include
@@ -95,6 +95,9 @@
updateWithDefaults();
} else {
const Archive::Entry *entry = m_model->entryForIndex(index);
+ if (!entry) {
+ return;
+ }
QMimeDatabase db;
QMimeType mimeType;
@@ -106,10 +109,10 @@
iconLabel->setPixmap(getDesktopIconForName(mimeType.iconName()));
if (entry->isDir()) {
- int dirs;
- int files;
- const int children = m_model->childCount(index, dirs, files);
- additionalInfo->setText(KIO::itemsSummaryString(children, files, dirs, 0, false));
+ uint dirs;
+ uint files;
+ entry->countChildren(dirs, files);
+ additionalInfo->setText(KIO::itemsSummaryString(dirs + files, files, dirs, 0, false));
} else if (!entry->property("link").toString().isEmpty()) {
additionalInfo->setText(i18n("Symbolic Link"));
} else {
diff -Nru ark-16.12.3/part/infopanel.h ark-17.04.3/part/infopanel.h
--- ark-16.12.3/part/infopanel.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/infopanel.h 2017-07-09 22:45:29.000000000 +0000
@@ -22,7 +22,6 @@
#ifndef INFOPANEL_H
#define INFOPANEL_H
-#include "kerfuffle/archive_kerfuffle.h"
#include "archivemodel.h"
#include "ui_infopanel.h"
@@ -32,8 +31,8 @@
{
Q_OBJECT
public:
- explicit InfoPanel(ArchiveModel *model, QWidget *parent = 0);
- virtual ~InfoPanel();
+ explicit InfoPanel(ArchiveModel *model, QWidget *parent = nullptr);
+ ~InfoPanel() override;
void setIndex(const QModelIndex &);
void setIndexes(const QModelIndexList &list);
diff -Nru ark-16.12.3/part/jobtracker.cpp ark-17.04.3/part/jobtracker.cpp
--- ark-16.12.3/part/jobtracker.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/jobtracker.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -86,7 +86,7 @@
Q_UNUSED(job)
m_ui->progressBar->setMaximum(100);
m_ui->progressBar->setMinimum(0);
- m_ui->progressBar->setValue(percent);
+ m_ui->progressBar->setValue(static_cast(percent));
}
void JobTracker::unregisterJob(KJob *job)
diff -Nru ark-16.12.3/part/jobtracker.h ark-17.04.3/part/jobtracker.h
--- ark-16.12.3/part/jobtracker.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/jobtracker.h 2017-07-09 22:45:29.000000000 +0000
@@ -22,10 +22,10 @@
#ifndef JOBTRACKER_H
#define JOBTRACKER_H
-#include
-#include
#include "ui_jobtracker.h"
+#include
+
class KJob;
class JobTrackerWidget: public QFrame, public Ui::JobTrackerWidget
@@ -33,7 +33,7 @@
Q_OBJECT
public:
- explicit JobTrackerWidget(QWidget *parent = 0);
+ explicit JobTrackerWidget(QWidget *parent = nullptr);
};
class JobTracker: public KAbstractWidgetJobTracker
@@ -41,21 +41,21 @@
Q_OBJECT
public:
- explicit JobTracker(QWidget *parent = 0);
- ~JobTracker();
+ explicit JobTracker(QWidget *parent = nullptr);
+ ~JobTracker() override;
- QWidget *widget(KJob *) Q_DECL_OVERRIDE;
+ QWidget *widget(KJob *) override;
public slots:
- void registerJob(KJob *job) Q_DECL_OVERRIDE;
- void unregisterJob(KJob *job) Q_DECL_OVERRIDE;
+ void registerJob(KJob *job) override;
+ void unregisterJob(KJob *job) override;
protected slots:
- void description(KJob *job, const QString &title, const QPair< QString, QString > &f1, const QPair< QString, QString > &f2) Q_DECL_OVERRIDE;
- void infoMessage(KJob *job, const QString &plain, const QString &rich) Q_DECL_OVERRIDE;
- void warning(KJob *job, const QString &plain, const QString &rich) Q_DECL_OVERRIDE;
+ void description(KJob *job, const QString &title, const QPair< QString, QString > &f1, const QPair< QString, QString > &f2) override;
+ void infoMessage(KJob *job, const QString &plain, const QString &rich) override;
+ void warning(KJob *job, const QString &plain, const QString &rich) override;
- void percent(KJob *job, unsigned long percent) Q_DECL_OVERRIDE;
+ void percent(KJob *job, unsigned long percent) override;
private slots:
void resetUi();
diff -Nru ark-16.12.3/part/overwritedialog.h ark-17.04.3/part/overwritedialog.h
--- ark-16.12.3/part/overwritedialog.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/overwritedialog.h 2017-07-09 22:45:29.000000000 +0000
@@ -28,7 +28,7 @@
#ifndef OVERWRITEDIALOG_H
#define OVERWRITEDIALOG_H
-#include "kerfuffle/archiveentry.h"
+#include "archiveentry.h"
#include
#include
@@ -47,7 +47,7 @@
Q_OBJECT
public:
explicit OverwriteDialog(QWidget *parent, const QList &entries, const QHash &icons, bool error = false);
- virtual ~OverwriteDialog();
+ ~OverwriteDialog() override;
private:
QVBoxLayout m_vBoxLayout;
diff -Nru ark-16.12.3/part/part.cpp ark-17.04.3/part/part.cpp
--- ark-16.12.3/part/part.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/part.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -28,18 +28,20 @@
#include "overwritedialog.h"
#include "archiveformat.h"
#include "archivemodel.h"
+#include "archivesortfiltermodel.h"
#include "archiveview.h"
#include "arkviewer.h"
#include "dnddbusinterfaceadaptor.h"
#include "infopanel.h"
#include "jobtracker.h"
#include "generalsettingspage.h"
-#include "kerfuffle/extractiondialog.h"
-#include "kerfuffle/extractionsettingspage.h"
-#include "kerfuffle/jobs.h"
-#include "kerfuffle/settings.h"
-#include "kerfuffle/previewsettingspage.h"
-#include "kerfuffle/propertiesdialog.h"
+#include "extractiondialog.h"
+#include "extractionsettingspage.h"
+#include "jobs.h"
+#include "settings.h"
+#include "previewsettingspage.h"
+#include "propertiesdialog.h"
+#include "pluginsettingspage.h"
#include "pluginmanager.h"
#include
@@ -75,6 +77,7 @@
#include
#include
#include
+#include
using namespace Kerfuffle;
@@ -87,9 +90,9 @@
Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList& args)
: KParts::ReadWritePart(parent),
- m_splitter(Q_NULLPTR),
+ m_splitter(nullptr),
m_busy(false),
- m_jobTracker(Q_NULLPTR)
+ m_jobTracker(nullptr)
{
Q_UNUSED(args)
KAboutData aboutData(QStringLiteral("ark"),
@@ -108,6 +111,7 @@
QWidget *mainWidget = new QWidget;
m_vlayout = new QVBoxLayout;
m_model = new ArchiveModel(pathName, this);
+ m_filterModel = new ArchiveSortFilterModel(this);
m_splitter = new QSplitter(Qt::Horizontal, parentWidget);
m_view = new ArchiveView;
m_infoPanel = new InfoPanel(m_model);
@@ -143,6 +147,28 @@
setWidget(mainWidget);
mainWidget->setLayout(m_vlayout);
+ // Setup search widget.
+ m_searchWidget = new QWidget(parentWidget);
+ m_searchWidget->setVisible(false);
+ m_searchWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
+ QHBoxLayout *searchLayout = new QHBoxLayout;
+ searchLayout->setContentsMargins(2, 2, 2, 2);
+ m_vlayout->addWidget(m_searchWidget);
+ m_searchWidget->setLayout(searchLayout);
+ m_searchCloseButton = new QPushButton(QIcon::fromTheme(QStringLiteral("dialog-close")), QString(), m_searchWidget);
+ m_searchCloseButton->setFlat(true);
+ m_searchLineEdit = new QLineEdit(m_searchWidget);
+ m_searchLineEdit->setClearButtonEnabled(true);
+ m_searchLineEdit->setPlaceholderText(i18n("Type to search..."));
+ mainWidget->installEventFilter(this);
+ searchLayout->addWidget(m_searchCloseButton);
+ searchLayout->addWidget(m_searchLineEdit);
+ connect(m_searchCloseButton, &QPushButton::clicked, this, [=]() {
+ m_searchWidget->hide();
+ m_searchLineEdit->clear();
+ });
+ connect(m_searchLineEdit, &QLineEdit::textChanged, this, &Part::searchEdited);
+
// Configure the QVBoxLayout and add widgets
m_vlayout->setContentsMargins(0,0,0,0);
m_vlayout->addWidget(m_messageWidget);
@@ -189,6 +215,7 @@
this, &Part::setReadyGui);
connect(this, static_cast(&KParts::ReadOnlyPart::completed),
this, &Part::setFileNameFromArchive);
+ connect(ArkSettings::self(), &KCoreConfigSkeleton::configChanged, this, &Part::updateActions);
m_statusBarExtension = new KParts::StatusBarExtension(this);
@@ -228,7 +255,7 @@
{
if (!m_jobTracker) {
m_jobTracker = new JobTracker(widget());
- m_statusBarExtension->addStatusBarItem(m_jobTracker->widget(0), 0, true);
+ m_statusBarExtension->addStatusBarItem(m_jobTracker->widget(nullptr), 0, true);
m_jobTracker->widget(job)->show();
}
m_jobTracker->registerJob(job);
@@ -274,7 +301,7 @@
options.setDragAndDropEnabled(true);
// Create and start the ExtractJob.
- ExtractJob *job = m_model->extractFiles(filesAndRootNodesForIndexes(addChildren(m_view->selectionModel()->selectedRows())), destination, options);
+ ExtractJob *job = m_model->extractFiles(filesAndRootNodesForIndexes(addChildren(getSelectedIndexes())), destination, options);
registerJob(job);
connect(job, &KJob::result,
this, &Part::slotExtractionDone);
@@ -291,7 +318,10 @@
{
m_view->setContextMenuPolicy(Qt::CustomContextMenu);
- m_view->setModel(m_model);
+ m_filterModel->setSourceModel(m_model);
+ m_view->setModel(m_filterModel);
+ m_filterModel->setFilterKeyColumn(0);
+ m_filterModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged,
this, &Part::updateActions);
@@ -428,6 +458,13 @@
m_testArchiveAction->setToolTip(i18nc("@info:tooltip", "Click to test the archive for integrity"));
connect(m_testArchiveAction, &QAction::triggered, this, &Part::slotTestArchive);
+ m_searchAction = actionCollection()->addAction(QStringLiteral("find_in_archive"));
+ m_searchAction->setIcon(QIcon::fromTheme(QStringLiteral("search")));
+ m_searchAction->setText(i18nc("@action:inmenu", "&Find Files"));
+ actionCollection()->setDefaultShortcut(m_searchAction, Qt::CTRL + Qt::Key_F);
+ m_searchAction->setToolTip(i18nc("@info:tooltip", "Click to search in archive"));
+ connect(m_searchAction, &QAction::triggered, this, &Part::slotShowFind);
+
connect(m_signalMapper, static_cast(&QSignalMapper::mapped),
this, &Part::slotOpenEntry);
@@ -439,7 +476,7 @@
void Part::updateActions()
{
bool isWritable = m_model->archive() && !m_model->archive()->isReadOnly();
- const Archive::Entry *entry = m_model->entryForIndex(m_view->selectionModel()->currentIndex());
+ const Archive::Entry *entry = m_model->entryForIndex(m_filterModel->mapToSource(m_view->selectionModel()->currentIndex()));
int selectedEntriesCount = m_view->selectionModel()->selectedRows().count();
// We disable adding files if the archive is encrypted but the password is
@@ -464,9 +501,9 @@
// Figure out if entry size is larger than preview size limit.
const int maxPreviewSize = ArkSettings::previewFileSizeLimit() * 1024 * 1024;
const bool limit = ArkSettings::limitPreviewFileSize();
- bool isPreviewable = (!limit || (limit && entry != Q_NULLPTR && entry->property("size").toLongLong() < maxPreviewSize));
+ bool isPreviewable = (!limit || (limit && entry != nullptr && entry->property("size").toLongLong() < maxPreviewSize));
- const bool isDir = (entry == Q_NULLPTR) ? false : entry->isDir();
+ const bool isDir = (entry == nullptr) ? false : entry->isDir();
m_previewAction->setEnabled(!isBusy() &&
isPreviewable &&
!isDir &&
@@ -508,6 +545,9 @@
(selectedEntriesCount == 0 || (selectedEntriesCount == 1 && isDir)) &&
(m_model->filesToMove.count() > 0 || m_model->filesToCopy.count() > 0));
+ m_searchAction->setEnabled(!isBusy() &&
+ m_model->rowCount() > 0);
+
m_commentView->setEnabled(!isBusy());
m_commentMsgWidget->setEnabled(!isBusy());
@@ -537,7 +577,7 @@
{
if (!m_commentBox->isVisible()) {
m_commentBox->show();
- m_commentSplitter->setSizes(QList() << m_view->height() * 0.6 << 1);
+ m_commentSplitter->setSizes(QList() << static_cast(m_view->height() * 0.6) << 1);
}
m_commentView->setFocus();
}
@@ -657,7 +697,7 @@
}
while (menu->actions().size() > 3) {
- menu->removeAction(menu->actions().last());
+ menu->removeAction(menu->actions().constLast());
}
const KConfigGroup conf(KSharedConfig::openConfig(), "ExtractDialog");
@@ -682,7 +722,7 @@
const QString detectedSubfolder = detectSubfolder();
qCDebug(ARK) << "Detected subfolder" << detectedSubfolder;
- if (!isSingleFolderArchive()) {
+ if (m_model->archive()->hasMultipleTopLevelEntries()) {
if (!userDestination.endsWith(QDir::separator())) {
userDestination.append(QDir::separator());
}
@@ -694,7 +734,7 @@
qCDebug(ARK) << "Extracting to:" << finalDestinationDirectory;
- ExtractJob *job = m_model->extractFiles(filesAndRootNodesForIndexes(addChildren(m_view->selectionModel()->selectedRows())), finalDestinationDirectory, ExtractionOptions());
+ ExtractJob *job = m_model->extractFiles(filesAndRootNodesForIndexes(addChildren(getSelectedIndexes())), finalDestinationDirectory, ExtractionOptions());
registerJob(job);
connect(job, &KJob::result,
@@ -706,7 +746,16 @@
void Part::selectionChanged()
{
- m_infoPanel->setIndexes(m_view->selectionModel()->selectedRows());
+ m_infoPanel->setIndexes(getSelectedIndexes());
+}
+
+QModelIndexList Part::getSelectedIndexes()
+{
+ QModelIndexList list;
+ foreach (const QModelIndex &i, m_view->selectionModel()->selectedRows()) {
+ list.append(m_filterModel->mapToSource(i));
+ }
+ return list;
}
bool Part::openFile()
@@ -750,6 +799,7 @@
QList pages;
pages.append(new GeneralSettingsPage(parent, i18nc("@title:tab", "General Settings"), QStringLiteral("go-home")));
pages.append(new ExtractionSettingsPage(parent, i18nc("@title:tab", "Extraction Settings"), QStringLiteral("archive-extract")));
+ pages.append(new PluginSettingsPage(parent, i18nc("@title:tab", "Plugin Settings"), QStringLiteral("plugins")));
pages.append(new PreviewSettingsPage(parent, i18nc("@title:tab", "Preview Settings"), QStringLiteral("document-preview-archive")));
return pages;
@@ -840,17 +890,12 @@
}
m_view->sortByColumn(0, Qt::AscendingOrder);
-
- // #303708: expand the first level only when there is just one root folder.
- // Typical use case: an archive with source files.
- if (m_view->model()->rowCount() == 1) {
- m_view->expandToDepth(0);
- }
+ m_view->expandIfSingleFolder();
// After loading all files, resize the columns to fit all fields
m_view->header()->resizeSections(QHeaderView::ResizeToContents);
- // Now we can start accepting drops in the archive view.
- m_view->setDropsEnabled(true);
+ // Now we can start accepting drops in the archive view (if loading was successful).
+ m_view->setDropsEnabled(!job->error());
updateActions();
@@ -920,9 +965,7 @@
void Part::slotOpenEntry(int mode)
{
- qCDebug(ARK) << "Opening with mode" << mode;
-
- QModelIndex index = m_view->selectionModel()->currentIndex();
+ QModelIndex index = m_filterModel->mapToSource(m_view->selectionModel()->currentIndex());
Archive::Entry *entry = m_model->entryForIndex(index);
// Don't open directories.
@@ -930,6 +973,12 @@
return;
}
+ // Don't open files bigger than the size limit.
+ const int maxPreviewSize = ArkSettings::previewFileSizeLimit() * 1024 * 1024;
+ if (ArkSettings::limitPreviewFileSize() && entry->property("size").toLongLong() >= maxPreviewSize) {
+ return;
+ }
+
// We don't support opening symlinks.
if (!entry->property("link").toString().isEmpty()) {
displayMsgWidget(KMessageWidget::Information, i18n("Ark cannot open symlinks."));
@@ -938,9 +987,9 @@
// Extract the entry.
if (!entry->fullPath().isEmpty()) {
-
+ qCDebug(ARK) << "Opening with mode" << mode;
m_openFileMode = static_cast(mode);
- KJob *job = Q_NULLPTR;
+ KJob *job = nullptr;
if (m_openFileMode == Preview) {
job = m_model->preview(entry);
@@ -988,7 +1037,7 @@
} else {
KRun::runUrl(QUrl::fromUserInput(fullName, QString(), QUrl::AssumeLocalFile),
QMimeDatabase().mimeTypeForFile(fullName).name(),
- widget(), false, false);
+ widget(), KRun::RunFlags());
}
} else if (job->error() != KJob::KilledJobError) {
KMessageBox::error(widget(), job->errorString());
@@ -1043,7 +1092,7 @@
QStringList list = QStringList() << file;
qCDebug(ARK) << "Updating file" << file << "with path" << relPath;
- slotAddFiles(list, Q_NULLPTR, relPath);
+ slotAddFiles(list, nullptr, relPath);
}
// This is needed because some apps, such as Kate, delete and recreate
// files when saving.
@@ -1059,11 +1108,6 @@
}
}
-bool Part::isSingleFolderArchive() const
-{
- return m_model->archive()->isSingleFolder();
-}
-
QString Part::detectSubfolder() const
{
if (!m_model) {
@@ -1096,7 +1140,7 @@
dialog.data()->setShowSelectedFiles(true);
}
- dialog.data()->setSingleFolderArchive(isSingleFolderArchive());
+ dialog.data()->setExtractToSubfolder(m_model->archive()->hasMultipleTopLevelEntries());
dialog.data()->setSubfolder(detectSubfolder());
dialog.data()->setCurrentUrl(QUrl::fromLocalFile(QFileInfo(m_model->archive()->fileName()).absolutePath()));
@@ -1114,7 +1158,7 @@
// If the user has chosen to extract only selected entries, fetch these
// from the QTreeView.
if (!dialog.data()->extractAllFiles()) {
- files = filesAndRootNodesForIndexes(addChildren(m_view->selectionModel()->selectedRows()));
+ files = filesAndRootNodesForIndexes(addChildren(getSelectedIndexes()));
}
qCDebug(ARK) << "Selected " << files;
@@ -1218,7 +1262,7 @@
QUrl destinationDirectory = QUrl::fromLocalFile(extractJob->destinationDirectory()).adjusted(QUrl::NormalizePathSegments);
qCDebug(ARK) << "Shall open URL" << destinationDirectory;
- KRun::runUrl(destinationDirectory, QStringLiteral("inode/directory"), widget());
+ KRun::runUrl(destinationDirectory, QStringLiteral("inode/directory"), widget(), KRun::RunExecutables, QString(), QByteArray());
}
if (ArkSettings::closeAfterExtraction()) {
@@ -1235,7 +1279,7 @@
QStringList withChildPaths;
foreach (const QString& file, filesToAdd) {
- m_jobTempEntries.push_back(new Archive::Entry(Q_NULLPTR, file));
+ m_jobTempEntries.push_back(new Archive::Entry(nullptr, file));
if (QFileInfo(file).isDir()) {
withChildPaths << file + QLatin1Char('/');
QDirIterator it(file, QDir::AllEntries | QDir::Readable | QDir::Hidden | QDir::NoDotAndDotDot, QDirIterator::Subdirectories);
@@ -1281,7 +1325,7 @@
globalWorkDir.remove(relPath);
qCDebug(ARK) << "Adding" << filesToAdd << "to" << relPath;
} else {
- qCDebug(ARK) << "Adding " << filesToAdd << ((destination == Q_NULLPTR) ? QString() : QStringLiteral("to ") + destination->fullPath());
+ qCDebug(ARK) << "Adding " << filesToAdd << ((destination == nullptr) ? QString() : QStringLiteral("to ") + destination->fullPath());
}
// Remove trailing slash (needed when adding dirs).
@@ -1324,7 +1368,7 @@
m_compressionOptions.setEncryptionMethod(arguments().metaData()[QStringLiteral("encryptionMethod")]);
}
if (!m_compressionOptions.isVolumeSizeSet() && arguments().metaData().contains(QStringLiteral("volumeSize"))) {
- m_compressionOptions.setVolumeSize(arguments().metaData()[QStringLiteral("volumeSize")].toInt());
+ m_compressionOptions.setVolumeSize(arguments().metaData()[QStringLiteral("volumeSize")].toULong());
}
const auto compressionMethods = m_model->archive()->property("compressionMethods").toStringList();
@@ -1334,13 +1378,13 @@
}
QString dialogTitle = i18nc("@title:window", "Add Files");
- const Archive::Entry *destination = Q_NULLPTR;
+ const Archive::Entry *destination = nullptr;
if (m_view->selectionModel()->selectedRows().count() == 1) {
- destination = m_model->entryForIndex(m_view->selectionModel()->currentIndex());
+ destination = m_model->entryForIndex(m_filterModel->mapToSource(m_view->selectionModel()->currentIndex()));
if (destination->isDir()) {
dialogTitle = i18nc("@title:window", "Add Files to %1", destination->fullPath());;
} else {
- destination = Q_NULLPTR;
+ destination = nullptr;
}
}
@@ -1376,13 +1420,13 @@
QModelIndex currentIndex = m_view->selectionModel()->currentIndex();
currentIndex = (currentIndex.parent().isValid())
? currentIndex.parent().child(currentIndex.row(), 0)
- : m_model->index(currentIndex.row(), 0);
+ : m_filterModel->index(currentIndex.row(), 0);
m_view->openEntryEditor(currentIndex);
}
void Part::slotCutFiles()
{
- QModelIndexList selectedRows = addChildren(m_view->selectionModel()->selectedRows());
+ QModelIndexList selectedRows = addChildren(getSelectedIndexes());
m_model->filesToMove = ArchiveModel::entryMap(filesForIndexes(selectedRows));
qCDebug(ARK) << "Entries marked to cut:" << m_model->filesToMove.values();
m_model->filesToCopy.clear();
@@ -1398,7 +1442,7 @@
void Part::slotCopyFiles()
{
- m_model->filesToCopy = ArchiveModel::entryMap(filesForIndexes(addChildren(m_view->selectionModel()->selectedRows())));
+ m_model->filesToCopy = ArchiveModel::entryMap(filesForIndexes(addChildren(getSelectedIndexes())));
qCDebug(ARK) << "Entries marked to copy:" << m_model->filesToCopy.values();
foreach (const QModelIndex &row, m_cutIndexes) {
m_view->dataChanged(row, row);
@@ -1414,8 +1458,8 @@
displayMsgWidget(KMessageWidget::Error, i18n("Filename can't contain slashes and can't be equal to \".\" or \"..\""));
return;
}
- const Archive::Entry *entry = m_model->entryForIndex(m_view->selectionModel()->currentIndex());
- QVector entriesToMove = filesForIndexes(addChildren(m_view->selectionModel()->selectedRows()));
+ const Archive::Entry *entry = m_model->entryForIndex(m_filterModel->mapToSource(m_view->selectionModel()->currentIndex()));
+ QVector entriesToMove = filesForIndexes(addChildren(getSelectedIndexes()));
m_destination = new Archive::Entry();
const QString &entryPath = entry->fullPath(NoTrailingSlash);
@@ -1432,12 +1476,12 @@
void Part::slotPasteFiles()
{
m_destination = (m_view->selectionModel()->selectedRows().count() > 0)
- ? m_model->entryForIndex(m_view->selectionModel()->currentIndex())
- : Q_NULLPTR;
- if (m_destination == Q_NULLPTR) {
- m_destination = new Archive::Entry(Q_NULLPTR, QString());
+ ? m_model->entryForIndex(m_filterModel->mapToSource(m_view->selectionModel()->currentIndex()))
+ : nullptr;
+ if (m_destination == nullptr) {
+ m_destination = new Archive::Entry(nullptr, QString());
} else {
- m_destination = new Archive::Entry(Q_NULLPTR, m_destination->fullPath());
+ m_destination = new Archive::Entry(nullptr, m_destination->fullPath());
}
if (m_model->filesToMove.count() > 0) {
@@ -1590,7 +1634,7 @@
return;
}
- DeleteJob *job = m_model->deleteFiles(filesForIndexes(addChildren(m_view->selectionModel()->selectedRows())));
+ DeleteJob *job = m_model->deleteFiles(filesForIndexes(addChildren(getSelectedIndexes())));
connect(job, &KJob::result,
this, &Part::slotDeleteFilesDone);
registerJob(job);
@@ -1673,6 +1717,45 @@
popup->popup(QCursor::pos());
}
+bool Part::eventFilter(QObject *target, QEvent *event)
+{
+ Q_UNUSED(target)
+
+ if (event->type() == QEvent::KeyPress) {
+ QKeyEvent *e = static_cast(event);
+ if (e->key() == Qt::Key_Escape) {
+ m_searchWidget->hide();
+ m_searchLineEdit->clear();
+ return true;
+ }
+ }
+ return false;
+}
+
+void Part::slotShowFind()
+{
+ if (m_searchWidget->isVisible()) {
+ m_searchLineEdit->selectAll();
+ } else {
+ m_searchWidget->show();
+ }
+ m_searchLineEdit->setFocus();
+}
+
+void Part::searchEdited(const QString &text)
+{
+ m_view->collapseAll();
+
+ m_filterModel->setFilterFixedString(text);
+
+ if(text.isEmpty()) {
+ m_view->collapseAll();
+ m_view->expandIfSingleFolder();
+ } else {
+ m_view->expandAll();
+ }
+}
+
void Part::displayMsgWidget(KMessageWidget::MessageType type, const QString& msg)
{
// The widget could be already visible, so hide it.
diff -Nru ark-16.12.3/part/part.h ark-17.04.3/part/part.h
--- ark-16.12.3/part/part.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/part/part.h 2017-07-09 22:45:29.000000000 +0000
@@ -25,7 +25,7 @@
#define PART_H
#include "interface.h"
-#include "kerfuffle/archiveentry.h"
+#include "archiveentry.h"
#include
#include
@@ -35,6 +35,7 @@
#include
class ArchiveModel;
+class ArchiveSortFilterModel;
class ArchiveView;
class InfoPanel;
@@ -44,6 +45,7 @@
class KToggleAction;
class QAction;
+class QLineEdit;
class QSplitter;
class QTreeView;
class QTemporaryDir;
@@ -52,6 +54,7 @@
class QFileSystemWatcher;
class QGroupBox;
class QPlainTextEdit;
+class QPushButton;
namespace Ark
{
@@ -68,14 +71,15 @@
};
Part(QWidget *parentWidget, QObject *parent, const QVariantList &);
- ~Part();
+ ~Part() override;
- bool openFile() Q_DECL_OVERRIDE;
- bool saveFile() Q_DECL_OVERRIDE;
+ bool openFile() override;
+ bool saveFile() override;
- bool isBusy() const Q_DECL_OVERRIDE;
- KConfigSkeleton *config() const Q_DECL_OVERRIDE;
- QList settingsPages(QWidget *parent) const Q_DECL_OVERRIDE;
+ bool isBusy() const override;
+ KConfigSkeleton *config() const override;
+ QList settingsPages(QWidget *parent) const override;
+ bool eventFilter(QObject *target, QEvent *event) override;
/**
* Validate the localFilePath() associated to this part.
@@ -94,7 +98,7 @@
void extractSelectedFilesTo(const QString& localPath);
protected:
- void guiActivateEvent(KParts::GUIActivateEvent *event) Q_DECL_OVERRIDE;
+ void guiActivateEvent(KParts::GUIActivateEvent *event) override;
private slots:
void slotLoadingStarted();
@@ -156,7 +160,9 @@
void slotAddComment();
void slotCommentChanged();
void slotTestArchive();
+ void slotShowFind();
void displayMsgWidget(KMessageWidget::MessageType type, const QString& msg);
+ void searchEdited(const QString &text);
signals:
void busy();
@@ -169,12 +175,12 @@
void resetGui();
void setupView();
void setupActions();
- bool isSingleFolderArchive() const;
QString detectSubfolder() const;
QVector filesForIndexes(const QModelIndexList& list) const;
QVector filesAndRootNodesForIndexes(const QModelIndexList& list) const;
QModelIndexList addChildren(const QModelIndexList &list) const;
void registerJob(KJob *job);
+ QModelIndexList getSelectedIndexes();
ArchiveModel *m_model;
ArchiveView *m_view;
@@ -193,6 +199,7 @@
QAction *m_propertiesAction;
QAction *m_editCommentAction;
QAction *m_testArchiveAction;
+ QAction *m_searchAction;
KToggleAction *m_showInfoPanelAction;
InfoPanel *m_infoPanel;
QSplitter *m_splitter;
@@ -216,6 +223,10 @@
KMessageWidget *m_commentMsgWidget;
KMessageWidget *m_messageWidget;
Kerfuffle::CompressionOptions m_compressionOptions;
+ ArchiveSortFilterModel *m_filterModel;
+ QWidget *m_searchWidget;
+ QLineEdit *m_searchLineEdit;
+ QPushButton *m_searchCloseButton;
};
} // namespace Ark
diff -Nru ark-16.12.3/plugins/cli7zplugin/cliplugin.cpp ark-17.04.3/plugins/cli7zplugin/cliplugin.cpp
--- ark-16.12.3/plugins/cli7zplugin/cliplugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/cli7zplugin/cliplugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -23,8 +23,7 @@
#include "cliplugin.h"
#include "ark_debug.h"
-#include "kerfuffle/cliinterface.h"
-#include "kerfuffle/kerfuffle_export.h"
+#include "cliinterface.h"
#include
#include
@@ -266,7 +265,7 @@
else {
delete m_currentArchiveEntry;
}
- m_currentArchiveEntry = Q_NULLPTR;
+ m_currentArchiveEntry = nullptr;
}
}
@@ -282,6 +281,18 @@
return false;
}
+ return true;
+}
+
+bool CliPlugin::readDeleteLine(const QString &line)
+{
+ QRegularExpression rx(QStringLiteral("Error: .+ is not supported archive"));
+
+ if (rx.match(line).hasMatch()) {
+ emit error(i18n("Delete operation failed. Try upgrading p7zip or disabling the p7zip plugin in the configuration dialog."));
+ return false;
+ }
+
return true;
}
diff -Nru ark-16.12.3/plugins/cli7zplugin/cliplugin.h ark-17.04.3/plugins/cli7zplugin/cliplugin.h
--- ark-16.12.3/plugins/cli7zplugin/cliplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/cli7zplugin/cliplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -25,8 +25,7 @@
#ifndef CLIPLUGIN_H
#define CLIPLUGIN_H
-#include "kerfuffle/cliinterface.h"
-#include "kerfuffle/archiveentry.h"
+#include "cliinterface.h"
class CliPlugin : public Kerfuffle::CliInterface
{
@@ -34,11 +33,12 @@
public:
explicit CliPlugin(QObject *parent, const QVariantList & args);
- virtual ~CliPlugin();
+ ~CliPlugin() override;
- virtual void resetParsing() Q_DECL_OVERRIDE;
- virtual bool readListLine(const QString &line) Q_DECL_OVERRIDE;
- virtual bool readExtractLine(const QString &line) Q_DECL_OVERRIDE;
+ void resetParsing() override;
+ bool readListLine(const QString &line) override;
+ bool readExtractLine(const QString &line) override;
+ bool readDeleteLine(const QString &line) override;
private:
enum ArchiveType {
diff -Nru ark-16.12.3/plugins/cli7zplugin/kerfuffle_cli7z.json.cmake ark-17.04.3/plugins/cli7zplugin/kerfuffle_cli7z.json.cmake
--- ark-16.12.3/plugins/cli7zplugin/kerfuffle_cli7z.json.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/cli7zplugin/kerfuffle_cli7z.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -1,97 +1,115 @@
{
"KPlugin": {
- "Id": "kerfuffle_cli7z",
+ "Description": "Full support for the zip and 7z archive formats",
+ "Description[ca@valencia]": "Implementació completa dels formats d'arxiu «zip» i «7z»",
+ "Description[ca]": "Implementació completa dels formats d'arxiu «zip» i «7z»",
+ "Description[cs]": "Plná podpora archivačních formátů zip a 7z",
+ "Description[de]": "Vollständige Unterstützung für Zip- und 7z-Archivformate",
+ "Description[el]": "Πλήρης υποστήριξη για την αρχειοθήκη μορφής zip και 7z",
+ "Description[es]": "Uso total de los formatos de archivos comprimidos zip y 7z",
+ "Description[eu]": "zip eta 7z artxibo fitxategientzako euskarri osoa",
+ "Description[fr]": "Prise en charge complète des formats d'archive zip et 7z",
+ "Description[it]": "Supporto completo per i formati di archivi zip e 7z",
+ "Description[nl]": "Volledige ondersteuning voor de zip- en 7z-archiefformaten",
+ "Description[pl]": "Pełna obsługa dla formatów archiwów zip oraz 7z",
+ "Description[pt]": "Suporte total para os formatos de pacotes ZIP e 7z",
+ "Description[sk]": "Plná podpora pre archívne formáty zip a 7z",
+ "Description[sl]": "Polna podpora za arhive vrste zip in 7z",
+ "Description[sr@ijekavian]": "Пуна подршка за архивске формате ЗИП и 7зип",
+ "Description[sr@ijekavianlatin]": "Puna podrška za arhivske formate ZIP i 7zip",
+ "Description[sr@latin]": "Puna podrška za arhivske formate ZIP i 7zip",
+ "Description[sr]": "Пуна подршка за архивске формате ЗИП и 7зип",
+ "Description[sv]": "Fullt stöd för zip- och 7z-arkivformaten",
+ "Description[tr]": "Zip ve 7z arşiv biçimleri için tam destek",
+ "Description[uk]": "Повноцінна підтримка архівів у форматах zip і 7z",
+ "Description[x-test]": "xxFull support for the zip and 7z archive formatsxx",
+ "Description[zh_CN]": "完全支持 zip 和 7z 归档格式",
+ "Description[zh_TW]": "對 zip 與 7z 壓縮檔格式的完整支援",
+ "Id": "kerfuffle_cli7z",
"MimeTypes": [
"@SUPPORTED_MIMETYPES@"
- ],
- "Name": "7zip archive plugin",
- "Name[ca@valencia]": "Connector per arxius 7zip",
- "Name[ca]": "Connector per arxius 7zip",
- "Name[cs]": "Modul pro archiv 7zip",
- "Name[de]": "7zip-Archiv-Modul",
- "Name[es]": "Complemento de archivo 7zip",
- "Name[et]": "7zip arhiivi plugin",
- "Name[eu]": "7zip artxiboen plugina",
- "Name[fi]": "7zip-pakkaustuki",
- "Name[fr]": "Module externe d'archive « 7zip »",
- "Name[gl]": "Complemento de arquivo de 7zip",
- "Name[he]": "תוסף ארכיוני 7zip",
- "Name[it]": "Estensione per archivi 7zip",
- "Name[ko]": "7zip 압축 플러그인",
- "Name[nb]": "Programtillegg for 7zip-arkiv",
- "Name[nl]": "7zip-archiefplug-in",
- "Name[nn]": "7zip-arkivtillegg",
- "Name[pl]": "Wtyczka archiwów 7zip",
- "Name[pt]": "'Plugin' de pacotes 7zip",
- "Name[pt_BR]": "Plugin de arquivos 7zip",
- "Name[ru]": "Поддержка архивов 7zip",
- "Name[sk]": "Modul 7zip archívu",
- "Name[sl]": "Vstavek za arhive 7zip",
- "Name[sr@ijekavian]": "Прикључак 7зип архива",
- "Name[sr@ijekavianlatin]": "Priključak 7zip arhiva",
- "Name[sr@latin]": "Priključak 7zip arhiva",
- "Name[sr]": "Прикључак 7зип архива",
- "Name[sv]": "Insticksprogram för 7zip-arkiv",
- "Name[uk]": "Додаток для архівів 7zip",
- "Name[x-test]": "xx7zip archive pluginxx",
- "Name[zh_CN]": "7zip 归档插件",
- "Name[zh_TW]": "7zip 壓縮檔外掛程式",
+ ],
+ "Name": "P7zip plugin",
+ "Name[ca@valencia]": "Connector del P7zip",
+ "Name[ca]": "Connector del P7zip",
+ "Name[cs]": "Modul pro p7zip",
+ "Name[de]": "P7zip-Modul",
+ "Name[el]": "Πρόσθετο P7zip",
+ "Name[es]": "Complemento P7zip",
+ "Name[eu]": "P7zip plugina",
+ "Name[fr]": "Module externe « P7zip »",
+ "Name[it]": "Estensione P7zip",
+ "Name[nl]": "P7zip-plug-in",
+ "Name[pl]": "Wtyczka p7zip",
+ "Name[pt]": "'Plugin' do P7zip",
+ "Name[sk]": "Plugin P7zip",
+ "Name[sl]": "Vstavek P7zip",
+ "Name[sr@ijekavian]": "Прикључак за П7зип",
+ "Name[sr@ijekavianlatin]": "Priključak za p7zip",
+ "Name[sr@latin]": "Priključak za p7zip",
+ "Name[sr]": "Прикључак за П7зип",
+ "Name[sv]": "P7zip-insticksprogram",
+ "Name[tr]": "P7zip eklentisi",
+ "Name[uk]": "Додаток P7zip",
+ "Name[x-test]": "xxP7zip pluginxx",
+ "Name[zh_CN]": "P7zip 插件",
+ "Name[zh_TW]": "P7zip 外掛程式",
"ServiceTypes": [
"Kerfuffle/Plugin"
- ],
+ ],
"Version": "@KDE_APPLICATIONS_VERSION@"
- },
+ },
"X-KDE-Kerfuffle-ReadOnlyExecutables": [
"7z"
- ],
- "X-KDE-Kerfuffle-ReadWrite": true,
+ ],
+ "X-KDE-Kerfuffle-ReadWrite": true,
"X-KDE-Kerfuffle-ReadWriteExecutables": [
"7z"
- ],
- "X-KDE-Priority": 180,
+ ],
+ "X-KDE-Priority": 180,
"application/x-7z-compressed": {
- "CompressionLevelDefault": 5,
- "CompressionLevelMax": 9,
- "CompressionLevelMin": 0,
- "CompressionMethodDefault": "LZMA2",
+ "CompressionLevelDefault": 5,
+ "CompressionLevelMax": 9,
+ "CompressionLevelMin": 0,
+ "CompressionMethodDefault": "LZMA2",
"CompressionMethods": {
- "BZip2": "BZip2",
- "Copy": "Copy",
- "Deflate": "Deflate",
- "LZMA": "LZMA",
- "LZMA2": "LZMA2",
+ "BZip2": "BZip2",
+ "Copy": "Copy",
+ "Deflate": "Deflate",
+ "LZMA": "LZMA",
+ "LZMA2": "LZMA2",
"PPMd": "PPMd"
- },
- "EncryptionMethodDefault": "AES256",
+ },
+ "EncryptionMethodDefault": "AES256",
"EncryptionMethods": [
"AES256"
- ],
- "HeaderEncryption": true,
- "SupportsMultiVolume": true,
+ ],
+ "HeaderEncryption": true,
+ "SupportsMultiVolume": true,
"SupportsTesting": true
- },
+ },
"application/zip": {
- "CompressionLevelDefault": 5,
- "CompressionLevelMax": 9,
- "CompressionLevelMin": 0,
- "CompressionMethodDefault": "Deflate",
+ "CompressionLevelDefault": 5,
+ "CompressionLevelMax": 9,
+ "CompressionLevelMin": 0,
+ "CompressionMethodDefault": "Deflate",
"CompressionMethods": {
- "BZip2": "BZip2",
- "Copy": "Copy",
- "Deflate": "Deflate",
- "Deflate64": "Deflate64",
- "LZMA": "LZMA",
+ "BZip2": "BZip2",
+ "Copy": "Copy",
+ "Deflate": "Deflate",
+ "Deflate64": "Deflate64",
+ "LZMA": "LZMA",
"PPMd": "PPMd"
- },
- "Encryption": true,
- "EncryptionMethodDefault": "AES256",
+ },
+ "Encryption": true,
+ "EncryptionMethodDefault": "AES256",
"EncryptionMethods": [
- "AES256",
- "AES192",
- "AES128",
+ "AES256",
+ "AES192",
+ "AES128",
"ZipCrypto"
- ],
- "SupportsMultiVolume": true,
+ ],
+ "SupportsMultiVolume": true,
"SupportsTesting": true
}
}
diff -Nru ark-16.12.3/plugins/clirarplugin/cliplugin.cpp ark-17.04.3/plugins/clirarplugin/cliplugin.cpp
--- ark-16.12.3/plugins/clirarplugin/cliplugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/clirarplugin/cliplugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -24,7 +24,7 @@
#include "cliplugin.h"
#include "ark_debug.h"
-#include "kerfuffle/archiveentry.h"
+#include "archiveentry.h"
#include
diff -Nru ark-16.12.3/plugins/clirarplugin/cliplugin.h ark-17.04.3/plugins/clirarplugin/cliplugin.h
--- ark-16.12.3/plugins/clirarplugin/cliplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/clirarplugin/cliplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -25,7 +25,7 @@
#ifndef CLIPLUGIN_H
#define CLIPLUGIN_H
-#include "kerfuffle/cliinterface.h"
+#include "cliinterface.h"
class CliPlugin : public Kerfuffle::CliInterface
{
@@ -33,12 +33,12 @@
public:
explicit CliPlugin(QObject *parent, const QVariantList &args);
- virtual ~CliPlugin();
+ ~CliPlugin() override;
- virtual void resetParsing() Q_DECL_OVERRIDE;
- virtual bool readListLine(const QString &line) Q_DECL_OVERRIDE;
- virtual bool readExtractLine(const QString &line) Q_DECL_OVERRIDE;
- virtual bool hasBatchExtractionProgress() const Q_DECL_OVERRIDE;
+ void resetParsing() override;
+ bool readListLine(const QString &line) override;
+ bool readExtractLine(const QString &line) override;
+ bool hasBatchExtractionProgress() const override;
private:
diff -Nru ark-16.12.3/plugins/clirarplugin/kerfuffle_clirar.json.cmake ark-17.04.3/plugins/clirarplugin/kerfuffle_clirar.json.cmake
--- ark-16.12.3/plugins/clirarplugin/kerfuffle_clirar.json.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/clirarplugin/kerfuffle_clirar.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -1,91 +1,108 @@
{
"KPlugin": {
- "Id": "kerfuffle_clirar",
+ "Description": "Full support for the RAR archive format",
+ "Description[ca@valencia]": "Implementació completa del format d'arxiu RAR",
+ "Description[ca]": "Implementació completa del format d'arxiu RAR",
+ "Description[cs]": "Plná podpora archivačního formátu RAR",
+ "Description[de]": "Vollständige Unterstützung für das RAR-Archivformat",
+ "Description[el]": "Πλήρης υποστήριξη για την αρχειοθήκη μορφής RAR",
+ "Description[es]": "Uso total del formato de archivo comprimido RAR",
+ "Description[eu]": "RAR artxibo formatuarentzako euskarri osoa",
+ "Description[fr]": "Prise en charge complète du format d'archive RAR",
+ "Description[it]": "Supporto completo per il formato di archivi RAR",
+ "Description[nl]": "Volledige ondersteuning voor het RAR-archiefformaat",
+ "Description[pl]": "Pełna obsługa dla formatów archiwów RAR",
+ "Description[pt]": "Suporte total para o formato de pacotes RAR",
+ "Description[sk]": "Plná podpora pre archívny formát RAR",
+ "Description[sl]": "Polna podpora za arhive vrste RAR",
+ "Description[sr@ijekavian]": "Пуна подршка за архивски формат РАР",
+ "Description[sr@ijekavianlatin]": "Puna podrška za arhivski format RAR",
+ "Description[sr@latin]": "Puna podrška za arhivski format RAR",
+ "Description[sr]": "Пуна подршка за архивски формат РАР",
+ "Description[sv]": "Fullt stöd för arkivformatet RAR",
+ "Description[tr]": "RAR arşiv biçimi için tam destek",
+ "Description[uk]": "Повноцінна підтримка архівів у форматі RAR",
+ "Description[x-test]": "xxFull support for the RAR archive formatxx",
+ "Description[zh_CN]": "完全支持 RAR 归档格式",
+ "Description[zh_TW]": "對 RAR 壓縮檔格式的完整支援",
+ "Id": "kerfuffle_clirar",
"MimeTypes": [
"@SUPPORTED_MIMETYPES@"
- ],
- "Name": "RAR archive plugin",
- "Name[ca@valencia]": "Connector per arxius RAR",
- "Name[ca]": "Connector per arxius RAR",
- "Name[cs]": "Modul pro archiv RAR",
- "Name[de]": "RAR-Archiv-Modul",
- "Name[es]": "Complemento de archivo RAR",
- "Name[et]": "RAR-arhiivi plugin",
- "Name[eu]": "RAR artxiboen plugina",
- "Name[fi]": "RAR-pakkaustuki",
- "Name[fr]": "Module externe d'archive « RAR »",
- "Name[gl]": "Complemento de arquivo RAR",
- "Name[he]": "תוסף ארכיוני RAR",
- "Name[it]": "Estensione per archivi RAR",
- "Name[ja]": "RAR アーカイブ用プラグイン",
- "Name[ko]": "RAR 압축 플러그인",
- "Name[nb]": "Programtillegg for RAR-arkiv",
- "Name[nl]": "RAR-archiefplug-in",
- "Name[nn]": "RAR-arkivtillegg",
- "Name[pl]": "Wtyczka archiwów RAR",
- "Name[pt]": "'Plugin' de pacotes RAR",
- "Name[pt_BR]": "Plugin de arquivos RAR",
- "Name[ru]": "Поддержка архивов RAR",
- "Name[sk]": "Modul RAR archívu",
- "Name[sl]": "Vstavek za arhive RAR",
- "Name[sr@ijekavian]": "Прикључак РАР архива",
- "Name[sr@ijekavianlatin]": "Priključak RAR arhiva",
- "Name[sr@latin]": "Priključak RAR arhiva",
- "Name[sr]": "Прикључак РАР архива",
- "Name[sv]": "Insticksprogram för RAR-arkiv",
- "Name[uk]": "Додаток для архівів RAR",
- "Name[x-test]": "xxRAR archive pluginxx",
- "Name[zh_CN]": "RAR 归档插件",
- "Name[zh_TW]": "RAR 壓縮檔外掛程式",
+ ],
+ "Name": "RAR plugin",
+ "Name[ca@valencia]": "Connector del RAR",
+ "Name[ca]": "Connector del RAR",
+ "Name[cs]": "Modul pro RAR",
+ "Name[de]": "RAR-Modul",
+ "Name[el]": "Πρόσθετο RAR ",
+ "Name[es]": "Complemento RAR",
+ "Name[eu]": "RAR plugina",
+ "Name[fr]": "Module externe « RAR »",
+ "Name[it]": "Estensione RAR",
+ "Name[nl]": "RAR-plug-in",
+ "Name[pl]": "Wtyczka RAR",
+ "Name[pt]": "'Plugin' do RAR",
+ "Name[sk]": "Plugin RAR",
+ "Name[sl]": "Vstavek RAR",
+ "Name[sr@ijekavian]": "Прикључак за РАР",
+ "Name[sr@ijekavianlatin]": "Priključak za RAR",
+ "Name[sr@latin]": "Priključak za RAR",
+ "Name[sr]": "Прикључак за РАР",
+ "Name[sv]": "RAR-insticksprogram",
+ "Name[tr]": "RAR eklentisi",
+ "Name[uk]": "Додаток RAR",
+ "Name[x-test]": "xxRAR pluginxx",
+ "Name[zh_CN]": "RAR 插件",
+ "Name[zh_TW]": "RAR 外掛程式",
"ServiceTypes": [
"Kerfuffle/Plugin"
- ],
+ ],
"Version": "@KDE_APPLICATIONS_VERSION@"
- },
+ },
"X-KDE-Kerfuffle-ReadOnlyExecutables": [
"unrar"
- ],
- "X-KDE-Kerfuffle-ReadWrite": true,
+ ],
+ "X-KDE-Kerfuffle-ReadWrite": true,
"X-KDE-Kerfuffle-ReadWriteExecutables": [
"rar"
- ],
- "X-KDE-Priority": 120,
+ ],
+ "X-KDE-Priority": 120,
"application/vnd.rar": {
- "CompressionLevelDefault": 3,
- "CompressionLevelMax": 5,
- "CompressionLevelMin": 0,
- "CompressionMethodDefault": "RAR4",
+ "CompressionLevelDefault": 3,
+ "CompressionLevelMax": 5,
+ "CompressionLevelMin": 0,
+ "CompressionMethodDefault": "RAR4",
"CompressionMethods": {
- "RAR4": "4",
+ "RAR4": "4",
"RAR5": "5"
- },
- "EncryptionMethodDefault": "AES128",
+ },
+ "EncryptionMethodDefault": "AES128",
"EncryptionMethods": [
- "AES128",
+ "AES128",
"AES256"
- ],
- "HeaderEncryption": true,
- "SupportsMultiVolume": true,
- "SupportsTesting": true,
+ ],
+ "HeaderEncryption": true,
+ "SupportsMultiVolume": true,
+ "SupportsTesting": true,
"SupportsWriteComment": true
- },
+ },
"application/x-rar": {
- "CompressionLevelDefault": 3,
- "CompressionLevelMax": 5,
- "CompressionLevelMin": 0,
- "CompressionMethodDefault": "RAR4",
+ "CompressionLevelDefault": 3,
+ "CompressionLevelMax": 5,
+ "CompressionLevelMin": 0,
+ "CompressionMethodDefault": "RAR4",
"CompressionMethods": {
- "RAR4": "4",
+ "RAR4": "4",
"RAR5": "5"
- },
- "EncryptionMethodDefault": "AES128",
+ },
+ "EncryptionMethodDefault": "AES128",
"EncryptionMethods": [
- "AES128",
+ "AES128",
"AES256"
- ],
- "HeaderEncryption": true,
- "SupportsMultiVolume": true,
- "SupportsTesting": true,
+ ],
+ "HeaderEncryption": true,
+ "SupportsMultiVolume": true,
+ "SupportsTesting": true,
"SupportsWriteComment": true
}
}
diff -Nru ark-16.12.3/plugins/cliunarchiverplugin/cliplugin.cpp ark-17.04.3/plugins/cliunarchiverplugin/cliplugin.cpp
--- ark-16.12.3/plugins/cliunarchiverplugin/cliplugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/cliunarchiverplugin/cliplugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -21,6 +21,7 @@
*/
#include "cliplugin.h"
+#include "ark_debug.h"
#include "queries.h"
#include
@@ -182,7 +183,7 @@
readStdout(true);
delete m_process;
- m_process = Q_NULLPTR;
+ m_process = nullptr;
}
// #193908 - #222392
@@ -260,7 +261,12 @@
currentEntry->setProperty("compressedSize", currentEntryJson.value(QStringLiteral("XADCompressedSize")));
currentEntry->setProperty("timestamp", currentEntryJson.value(QStringLiteral("XADLastModificationDate")).toVariant());
currentEntry->setProperty("size", currentEntryJson.value(QStringLiteral("XADFileSize")));
- currentEntry->setProperty("isPasswordProtected", (currentEntryJson.value(QStringLiteral("XADIsEncrypted")).toInt() == 1));
+ const bool isPasswordProtected = (currentEntryJson.value(QStringLiteral("XADIsEncrypted")).toInt() == 1);
+ currentEntry->setProperty("isPasswordProtected", isPasswordProtected);
+ if (isPasswordProtected) {
+ formatName == QLatin1String("RAR 5") ? emit encryptionMethodFound(QStringLiteral("AES256")) :
+ emit encryptionMethodFound(QStringLiteral("AES128"));
+ }
// TODO: missing fields
emit entry(currentEntry);
diff -Nru ark-16.12.3/plugins/cliunarchiverplugin/cliplugin.h ark-17.04.3/plugins/cliunarchiverplugin/cliplugin.h
--- ark-16.12.3/plugins/cliunarchiverplugin/cliplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/cliunarchiverplugin/cliplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -23,8 +23,7 @@
#ifndef CLIPLUGIN_H
#define CLIPLUGIN_H
-#include "kerfuffle/archiveentry.h"
-#include "kerfuffle/cliinterface.h"
+#include "cliinterface.h"
class CliPlugin : public Kerfuffle::CliInterface
{
@@ -32,13 +31,13 @@
public:
explicit CliPlugin(QObject *parent, const QVariantList &args);
- virtual ~CliPlugin();
+ ~CliPlugin() override;
- virtual bool list() Q_DECL_OVERRIDE;
- virtual bool extractFiles(const QVector &files, const QString &destinationDirectory, const Kerfuffle::ExtractionOptions &options) Q_DECL_OVERRIDE;
- virtual void resetParsing() Q_DECL_OVERRIDE;
- virtual bool readListLine(const QString &line) Q_DECL_OVERRIDE;
- virtual bool readExtractLine(const QString &line) Q_DECL_OVERRIDE;
+ bool list() override;
+ bool extractFiles(const QVector &files, const QString &destinationDirectory, const Kerfuffle::ExtractionOptions &options) override;
+ void resetParsing() override;
+ bool readListLine(const QString &line) override;
+ bool readExtractLine(const QString &line) override;
/**
* Fill the lsar's json output all in once (useful for unit testing).
@@ -46,14 +45,14 @@
void setJsonOutput(const QString &jsonOutput);
protected slots:
- void readStdout(bool handleAll = false) Q_DECL_OVERRIDE;
+ void readStdout(bool handleAll = false) override;
protected:
- bool handleLine(const QString& line) Q_DECL_OVERRIDE;
+ bool handleLine(const QString& line) override;
private slots:
- void processFinished(int exitCode, QProcess::ExitStatus exitStatus) Q_DECL_OVERRIDE;
+ void processFinished(int exitCode, QProcess::ExitStatus exitStatus) override;
private:
void setupCliProperties();
diff -Nru ark-16.12.3/plugins/cliunarchiverplugin/kerfuffle_cliunarchiver.json.cmake ark-17.04.3/plugins/cliunarchiverplugin/kerfuffle_cliunarchiver.json.cmake
--- ark-16.12.3/plugins/cliunarchiverplugin/kerfuffle_cliunarchiver.json.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/cliunarchiverplugin/kerfuffle_cliunarchiver.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -1,53 +1,82 @@
{
"KPlugin": {
- "Id": "kerfuffle_cliunarchiver",
+ "Description": "Open and extract RAR archives",
+ "Description[ca@valencia]": "Obri i extreu arxius RAR",
+ "Description[ca]": "Obre i extreu arxius RAR",
+ "Description[cs]": "Otevřít a rozbalit archivy RAR",
+ "Description[de]": "Öffnen und Entpacken von RAR-Archiven",
+ "Description[el]": "Άνοιγμα και εξαγωγή αρχειοθηκών RAR",
+ "Description[es]": "Abrir y extraer archivos RAR",
+ "Description[eu]": "Ireki eta erauzi RAR artxiboak",
+ "Description[fr]": "Ouvre et extrait les archives RAR",
+ "Description[it]": "Apri ed estrai archivi RAR",
+ "Description[nl]": "Open en pak uit RAR-archieven",
+ "Description[pl]": "Otwieraj i wypakowuj archiwa RAR",
+ "Description[pt]": "Abrir e extrair os pacotes RAR",
+ "Description[sk]": "Otvorenie a extrahovanie archívov RAR",
+ "Description[sl]": "Odprite in razširite arhive RAR",
+ "Description[sr@ijekavian]": "Отварање и распакивање РАР архива",
+ "Description[sr@ijekavianlatin]": "Otvaranje i raspakivanje RAR arhiva",
+ "Description[sr@latin]": "Otvaranje i raspakivanje RAR arhiva",
+ "Description[sr]": "Отварање и распакивање РАР архива",
+ "Description[sv]": "Öppna och extrahera RAR-arkiv",
+ "Description[tr]": "RAR arşivlerini aç ve çıkar",
+ "Description[uk]": "Здатен відкривати і видобувати архіви RAR",
+ "Description[x-test]": "xxOpen and extract RAR archivesxx",
+ "Description[zh_CN]": "打开和解压 RAR 归档",
+ "Description[zh_TW]": "開啟並解壓縮 RAR 壓縮檔",
+ "Id": "kerfuffle_cliunarchiver",
"MimeTypes": [
"@SUPPORTED_MIMETYPES@"
- ],
- "Name": "The Unarchiver plugin",
- "Name[ca@valencia]": "Connector de l'Unarchiver",
- "Name[ca]": "Connector de l'Unarchiver",
- "Name[cs]": "Modul pro Unarchiver",
- "Name[de]": "Unarchiver-Modul",
- "Name[es]": "El complemento de Unarchiver",
- "Name[et]": "Unarchiveri plugin",
- "Name[eu]": "Unarchiver plugina",
- "Name[fi]": "Unarchiver-tuki",
- "Name[fr]": "Module externe d'extraction d'archive",
- "Name[gl]": "Complemento de desarquivar",
- "Name[he]": "תוסף חילוץ אכיונים",
- "Name[it]": "Estensione The Unarchiver",
- "Name[ko]": "The Unarchiver 플러그인",
- "Name[nl]": "De plug-in voor uit archief halen",
- "Name[nn]": "Unarchiver-tillegget",
- "Name[pl]": "Wtyczka wypakowywacza",
- "Name[pt]": "O 'plugin' do Unarchiver",
- "Name[pt_BR]": "Plugin Unarchiver",
- "Name[sk]": "Plugin Unarchiver",
- "Name[sl]": "Vstavek Unarchiver",
- "Name[sr@ijekavian]": "Прикључак Унархивера",
- "Name[sr@ijekavianlatin]": "Priključak Unarchivera",
- "Name[sr@latin]": "Priključak Unarchivera",
- "Name[sr]": "Прикључак Унархивера",
- "Name[sv]": "Insticksprogram för Unarchiver",
- "Name[uk]": "Додаток Unarchiver",
- "Name[x-test]": "xxThe Unarchiver pluginxx",
- "Name[zh_CN]": "Unarchiver 插件",
- "Name[zh_TW]": "解壓縮外掛程式",
+ ],
+ "Name": "The Unarchiver plugin",
+ "Name[ast]": "El complementu d'unarchiver",
+ "Name[ca@valencia]": "Connector de l'Unarchiver",
+ "Name[ca]": "Connector de l'Unarchiver",
+ "Name[cs]": "Modul pro Unarchiver",
+ "Name[da]": "Plugin til Unarchiver",
+ "Name[de]": "Unarchiver-Modul",
+ "Name[el]": "Πρόσθετο Unarchiver",
+ "Name[es]": "El complemento de Unarchiver",
+ "Name[et]": "Unarchiveri plugin",
+ "Name[eu]": "Unarchiver plugina",
+ "Name[fi]": "Unarchiver-tuki",
+ "Name[fr]": "Module externe d'extraction d'archive",
+ "Name[gl]": "Complemento de desarquivar",
+ "Name[he]": "תוסף חילוץ אכיונים",
+ "Name[it]": "Estensione The Unarchiver",
+ "Name[ko]": "The Unarchiver 플러그인",
+ "Name[nl]": "De plug-in voor uit archief halen",
+ "Name[nn]": "Unarchiver-tillegget",
+ "Name[pl]": "Wtyczka wypakowywacza",
+ "Name[pt]": "O 'plugin' do Unarchiver",
+ "Name[pt_BR]": "Plugin Unarchiver",
+ "Name[sk]": "Plugin Unarchiver",
+ "Name[sl]": "Vstavek Unarchiver",
+ "Name[sr@ijekavian]": "Прикључак Унархивера",
+ "Name[sr@ijekavianlatin]": "Priključak Unarchivera",
+ "Name[sr@latin]": "Priključak Unarchivera",
+ "Name[sr]": "Прикључак Унархивера",
+ "Name[sv]": "Unarchiver-insticksprogram",
+ "Name[tr]": "Unarchiver eklentisi",
+ "Name[uk]": "Додаток Unarchiver",
+ "Name[x-test]": "xxThe Unarchiver pluginxx",
+ "Name[zh_CN]": "Unarchiver 插件",
+ "Name[zh_TW]": "解壓縮外掛程式",
"ServiceTypes": [
"Kerfuffle/Plugin"
- ],
+ ],
"Version": "@KDE_APPLICATIONS_VERSION@"
- },
+ },
"X-KDE-Kerfuffle-ReadOnlyExecutables": [
- "lsar",
+ "lsar",
"unar"
- ],
- "X-KDE-Kerfuffle-ReadWrite": false,
- "X-KDE-Priority": 100,
+ ],
+ "X-KDE-Kerfuffle-ReadWrite": false,
+ "X-KDE-Priority": 100,
"application/vnd.rar": {
"HeaderEncryption": true
- },
+ },
"application/x-rar": {
"HeaderEncryption": true
}
diff -Nru ark-16.12.3/plugins/clizipplugin/cliplugin.cpp ark-17.04.3/plugins/clizipplugin/cliplugin.cpp
--- ark-16.12.3/plugins/clizipplugin/cliplugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/clizipplugin/cliplugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -22,9 +22,7 @@
#include "cliplugin.h"
#include "ark_debug.h"
-#include "kerfuffle/archiveentry.h"
-#include "kerfuffle/cliinterface.h"
-#include "kerfuffle/kerfuffle_export.h"
+#include "cliinterface.h"
#include
#include
@@ -32,6 +30,7 @@
#include
#include
#include
+#include
using namespace Kerfuffle;
@@ -97,8 +96,8 @@
m_cliProps->setProperty("listProgram", QStringLiteral("zipinfo"));
m_cliProps->setProperty("listSwitch", QStringList{QStringLiteral("-l"),
- QStringLiteral("-T"),
- QStringLiteral("-z")});
+ QStringLiteral("-T"),
+ QStringLiteral("-z")});
m_cliProps->setProperty("testProgram", QStringLiteral("unzip"));
m_cliProps->setProperty("testSwitch", QStringLiteral("-t"));
@@ -107,7 +106,7 @@
m_cliProps->setProperty("compressionLevelSwitch", QStringLiteral("-$CompressionLevel"));
m_cliProps->setProperty("compressionMethodSwitch", QHash{{QStringLiteral("application/zip"), QStringLiteral("-Z$CompressionMethod")},
- {QStringLiteral("application/x-java-archive"), QStringLiteral("-Z$CompressionMethod")}});
+ {QStringLiteral("application/x-java-archive"), QStringLiteral("-Z$CompressionMethod")}});
m_cliProps->setProperty("multiVolumeSwitch", QStringLiteral("-v$VolumeSizek"));
m_cliProps->setProperty("passwordPromptPatterns", QStringList{QStringLiteral(" password: ")});
@@ -116,13 +115,14 @@
m_cliProps->setProperty("fileExistsPatterns", QStringList{QStringLiteral("^replace (.+)\\? \\[y\\]es, \\[n\\]o, \\[A\\]ll, \\[N\\]one, \\[r\\]ename: $")});
m_cliProps->setProperty("fileExistsFileName", QStringList{QStringLiteral("^replace (.+)\\? \\[y\\]es, \\[n\\]o, \\[A\\]ll, \\[N\\]one, \\[r\\]ename: $")});
m_cliProps->setProperty("fileExistsInput", QStringList{QStringLiteral("y"), //Overwrite
- QStringLiteral("n"), //Skip
- QStringLiteral("A"), //Overwrite all
- QStringLiteral("N")}); //Autoskip
+ QStringLiteral("n"), //Skip
+ QStringLiteral("A"), //Overwrite all
+ QStringLiteral("N")}); //Autoskip
m_cliProps->setProperty("extractionFailedPatterns", QStringList{QStringLiteral("unsupported compression method")});
- m_cliProps->setProperty("corruptArchivePatterns", QStringList{QStringLiteral("End-of-central-directory signature not found")});
+ m_cliProps->setProperty("corruptArchivePatterns", QStringList{QStringLiteral("End-of-central-directory signature not found"),
+ QStringLiteral("didn't find end-of-central-dir signature at end of central dir")});
m_cliProps->setProperty("diskFullPatterns", QStringList{QStringLiteral("write error \\(disk full\\?\\)"),
- QStringLiteral("No space left on device")});
+ QStringLiteral("No space left on device")});
}
bool CliPlugin::readListLine(const QString &line)
@@ -273,7 +273,7 @@
if (!QFile::rename(oldPath, newPath)) {
return false;
}
- m_tempAddedFiles << new Archive::Entry(Q_NULLPTR, m_passedDestination->name());
+ m_tempAddedFiles << new Archive::Entry(nullptr, m_passedDestination->name());
// We have to exclude file name from destination path in order to pass it to addFiles method.
const QString destinationPath = m_passedDestination->fullPath();
@@ -291,7 +291,7 @@
} else {
// ...unless the destination path is already a single folder, e.g. "dir/", or a file, e.g. "foo.txt".
// In this case we're going to add to the root, so we just need to set a null destination.
- m_passedDestination = Q_NULLPTR;
+ m_passedDestination = nullptr;
}
return true;
diff -Nru ark-16.12.3/plugins/clizipplugin/cliplugin.h ark-17.04.3/plugins/clizipplugin/cliplugin.h
--- ark-16.12.3/plugins/clizipplugin/cliplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/clizipplugin/cliplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -22,9 +22,7 @@
#ifndef CLIPLUGIN_H
#define CLIPLUGIN_H
-#include "kerfuffle/cliinterface.h"
-
-#include
+#include "cliinterface.h"
using namespace Kerfuffle;
@@ -34,15 +32,15 @@
public:
explicit CliPlugin(QObject *parent, const QVariantList &args);
- virtual ~CliPlugin();
+ ~CliPlugin() override;
- virtual void resetParsing() Q_DECL_OVERRIDE;
- virtual QString escapeFileName(const QString &fileName) const Q_DECL_OVERRIDE;
- virtual bool readListLine(const QString &line) Q_DECL_OVERRIDE;
- virtual bool readExtractLine(const QString &line) Q_DECL_OVERRIDE;
+ void resetParsing() override;
+ QString escapeFileName(const QString &fileName) const override;
+ bool readListLine(const QString &line) override;
+ bool readExtractLine(const QString &line) override;
- virtual bool moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions& options) Q_DECL_OVERRIDE;
- virtual int moveRequiredSignals() const Q_DECL_OVERRIDE;
+ bool moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions& options) override;
+ int moveRequiredSignals() const override;
private slots:
void continueMoving(bool result);
diff -Nru ark-16.12.3/plugins/clizipplugin/kerfuffle_clizip.json.cmake ark-17.04.3/plugins/clizipplugin/kerfuffle_clizip.json.cmake
--- ark-16.12.3/plugins/clizipplugin/kerfuffle_clizip.json.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/clizipplugin/kerfuffle_clizip.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -1,77 +1,95 @@
{
"KPlugin": {
- "Id": "kerfuffle_clizip",
+ "Description": "Legacy support for the zip archive format",
+ "Description[ca@valencia]": "Implementació pel format d'arxiu «zip» antic",
+ "Description[ca]": "Implementació pel format d'arxiu «zip» antic",
+ "Description[cs]": "Historická podpora archivačního formátu zip",
+ "Description[de]": "Unterstützung für veraltete Zip-Archivformate",
+ "Description[el]": "Κληροδοτούμενη υποστήριξη για την αρχειοθήκη μορφής zip",
+ "Description[es]": "Uso heredado para el formato de archivo comprimido zip",
+ "Description[eu]": "zip artxibo formatuarentzako heredatutako euskarria",
+ "Description[fr]": "Prise en charge traditionnelle du format d'archive zip",
+ "Description[it]": "Supporto originale per il formato di archivi ZIP",
+ "Description[nl]": "Verouderde ondersteuning voor het zip-archiefformaat",
+ "Description[pl]": "Obsługa przestarzałego formatu archiwów zip",
+ "Description[pt]": "Suporte antigo para o formato de pacotes ZIP",
+ "Description[sk]": "Spätná podpora pre archívny formát zip",
+ "Description[sl]": "Opuščena podpora za arhive vrste zip",
+ "Description[sr@ijekavian]": "Подршка за застареле архиве формата ЗИП",
+ "Description[sr@ijekavianlatin]": "Podrška za zastarele arhive formata ZIP",
+ "Description[sr@latin]": "Podrška za zastarele arhive formata ZIP",
+ "Description[sr]": "Подршка за застареле архиве формата ЗИП",
+ "Description[sv]": "Stöd för föråldrat zip-arkivformat",
+ "Description[tr]": "Zip arşivi biçimi için eski desteği",
+ "Description[uk]": "Підтримка архівів у застарілій версії формату zip",
+ "Description[x-test]": "xxLegacy support for the zip archive formatxx",
+ "Description[zh_CN]": "zip 归档格式的老旧支持",
+ "Description[zh_TW]": "對 zip 壓縮格式的舊版支援",
+ "Id": "kerfuffle_clizip",
"MimeTypes": [
"@SUPPORTED_MIMETYPES@"
- ],
- "Name": "ZIP archive plugin",
- "Name[ca@valencia]": "Connector per arxius ZIP",
- "Name[ca]": "Connector per arxius ZIP",
- "Name[cs]": "Modul pro archiv ZIP",
- "Name[de]": "ZIP-Archiv-Modul",
- "Name[es]": "Complemento de archivo ZIP",
- "Name[et]": "ZIP-arhiivi plugin",
- "Name[eu]": "ZIP artxiboen plugina",
- "Name[fi]": "ZIP-pakkaustuki",
- "Name[fr]": "Module externe d'archive « zip »",
- "Name[gl]": "Complemento de arquivo ZIP",
- "Name[he]": "תוסף ארכיוני ZIP",
- "Name[it]": "Estensione per archivi ZIP",
- "Name[ko]": "ZIP 압축 플러그인",
- "Name[nb]": "Programtillegg for ZIP-arkiv",
- "Name[nl]": "ZIP-archiefplug-in",
- "Name[nn]": "ZIP-arkivtillegg",
- "Name[pl]": "Wtyczka archiwów ZIP",
- "Name[pt]": "'Plugin' de pacotes ZIP",
- "Name[pt_BR]": "Plugin de arquivos ZIP",
- "Name[ru]": "Поддержка архивов ZIP",
- "Name[sk]": "Modul ZIP archívu",
- "Name[sl]": "Vstavek za arhive ZIP",
- "Name[sr@ijekavian]": "Прикључак ЗИП архива",
- "Name[sr@ijekavianlatin]": "Priključak ZIP arhiva",
- "Name[sr@latin]": "Priključak ZIP arhiva",
- "Name[sr]": "Прикључак ЗИП архива",
- "Name[sv]": "Insticksprogram för ZIP-arkiv",
- "Name[uk]": "Додаток для архівів ZIP",
- "Name[x-test]": "xxZIP archive pluginxx",
- "Name[zh_CN]": "ZIP 归档插件",
- "Name[zh_TW]": "ZIP 壓縮檔外掛程式",
+ ],
+ "Name": "Info-zip plugin",
+ "Name[ca@valencia]": "Connector de l'Info-zip",
+ "Name[ca]": "Connector de l'Info-zip",
+ "Name[cs]": "Modul info-zip",
+ "Name[de]": "Info-zip-Modul",
+ "Name[el]": "Πρόσθετο Info-zip",
+ "Name[es]": "Complemento Info-zip",
+ "Name[eu]": "Info-zip plugina",
+ "Name[fr]": "Module externe info-zip",
+ "Name[it]": "Estensione Info-zip",
+ "Name[nl]": "Info-zip-plug-in",
+ "Name[pl]": "Wtyczka info-zip",
+ "Name[pt]": "'Plugin' do Info-zip",
+ "Name[sk]": "Plugin Info-zip",
+ "Name[sl]": "Vstavek Info-zip",
+ "Name[sr@ijekavian]": "Прикључак за Инфозип",
+ "Name[sr@ijekavianlatin]": "Priključak za Info‑ZIP",
+ "Name[sr@latin]": "Priključak za Info‑ZIP",
+ "Name[sr]": "Прикључак за Инфозип",
+ "Name[sv]": "Info-zip-insticksprogram",
+ "Name[tr]": "Info-zip eklentisi",
+ "Name[uk]": "Додаток info-zip",
+ "Name[x-test]": "xxInfo-zip pluginxx",
+ "Name[zh_CN]": "Info-zip 插件",
+ "Name[zh_TW]": "Info-zip 外掛程式",
"ServiceTypes": [
"Kerfuffle/Plugin"
- ],
+ ],
"Version": "@KDE_APPLICATIONS_VERSION@"
- },
+ },
"X-KDE-Kerfuffle-ReadOnlyExecutables": [
- "zipinfo",
+ "zipinfo",
"unzip"
- ],
- "X-KDE-Kerfuffle-ReadWrite": true,
+ ],
+ "X-KDE-Kerfuffle-ReadWrite": true,
"X-KDE-Kerfuffle-ReadWriteExecutables": [
"zip"
- ],
- "X-KDE-Priority": 160,
+ ],
+ "X-KDE-Priority": 160,
"application/x-java-archive": {
- "CompressionLevelDefault": 6,
- "CompressionLevelMax": 9,
- "CompressionLevelMin": 0,
- "Encryption": true,
+ "CompressionLevelDefault": 6,
+ "CompressionLevelMax": 9,
+ "CompressionLevelMin": 0,
+ "Encryption": true,
"SupportsTesting": true
- },
+ },
"application/zip": {
- "CompressionLevelDefault": 6,
- "CompressionLevelMax": 9,
- "CompressionLevelMin": 0,
- "CompressionMethodDefault": "Deflate",
+ "CompressionLevelDefault": 6,
+ "CompressionLevelMax": 9,
+ "CompressionLevelMin": 0,
+ "CompressionMethodDefault": "Deflate",
"CompressionMethods": {
- "BZip2": "bzip2",
- "Deflate": "deflate",
+ "BZip2": "bzip2",
+ "Deflate": "deflate",
"Store": "store"
- },
- "Encryption": true,
- "EncryptionMethodDefault": "ZipCrypto",
+ },
+ "Encryption": true,
+ "EncryptionMethodDefault": "ZipCrypto",
"EncryptionMethods": [
"ZipCrypto"
- ],
+ ],
"SupportsTesting": true
}
}
diff -Nru ark-16.12.3/plugins/CMakeLists.txt ark-17.04.3/plugins/CMakeLists.txt
--- ark-16.12.3/plugins/CMakeLists.txt 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/CMakeLists.txt 2017-07-09 22:45:29.000000000 +0000
@@ -11,6 +11,9 @@
add_subdirectory( clizipplugin )
add_subdirectory( libsinglefileplugin )
add_subdirectory(cliunarchiverplugin)
+if(LibZip_FOUND)
+ add_subdirectory(libzipplugin)
+endif(LibZip_FOUND)
set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}" PARENT_SCOPE)
set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}" PARENT_SCOPE)
diff -Nru ark-16.12.3/plugins/libarchive/CMakeLists.txt ark-17.04.3/plugins/libarchive/CMakeLists.txt
--- ark-16.12.3/plugins/libarchive/CMakeLists.txt 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libarchive/CMakeLists.txt 2017-07-09 22:45:29.000000000 +0000
@@ -2,15 +2,10 @@
########### next target ###############
set(SUPPORTED_LIBARCHIVE_READWRITE_MIMETYPES "application/x-tar;application/x-compressed-tar;application/x-bzip-compressed-tar;application/x-tarz;application/x-xz-compressed-tar;")
-set(SUPPORTED_LIBARCHIVE_READWRITE_MIMETYPES "${SUPPORTED_LIBARCHIVE_READWRITE_MIMETYPES}application/x-lzma-compressed-tar;application/x-lzip-compressed-tar;application/x-tzo;application/x-lrzip-compressed-tar;")
+set(SUPPORTED_LIBARCHIVE_READWRITE_MIMETYPES "${SUPPORTED_LIBARCHIVE_READWRITE_MIMETYPES}application/x-lzma-compressed-tar;application/x-lzip-compressed-tar;application/x-tzo;application/x-lrzip-compressed-tar;application/x-lz4-compressed-tar;")
set(SUPPORTED_LIBARCHIVE_READONLY_MIMETYPES "application/vnd.debian.binary-package;application/x-deb;application/x-cd-image;application/x-bcpio;application/x-cpio;application/x-cpio-compressed;application/x-sv4cpio;application/x-sv4crc;")
set(SUPPORTED_LIBARCHIVE_READONLY_MIMETYPES "${SUPPORTED_LIBARCHIVE_READONLY_MIMETYPES}application/x-rpm;application/x-source-rpm;application/vnd.ms-cab-compressed;application/x-xar;application/x-iso9660-appimage;application/x-archive;")
-if(LibArchive_VERSION VERSION_EQUAL "3.2.0" OR
- LibArchive_VERSION VERSION_GREATER "3.2.0")
- set(SUPPORTED_LIBARCHIVE_READWRITE_MIMETYPES "${SUPPORTED_LIBARCHIVE_READWRITE_MIMETYPES}application/x-lz4-compressed-tar;")
-endif()
-
set(INSTALLED_LIBARCHIVE_PLUGINS "")
set(kerfuffle_libarchive_readonly_SRCS libarchiveplugin.cpp readonlylibarchiveplugin.cpp ark_debug.cpp)
@@ -51,14 +46,8 @@
\"application/x-lzma-compressed-tar\",
\"application/x-lzip-compressed-tar\",
\"application/x-tzo\",
- \"application/x-lrzip-compressed-tar")
-
-if(LibArchive_VERSION VERSION_EQUAL "3.2.0" OR
- LibArchive_VERSION VERSION_GREATER "3.2.0")
- set(SUPPORTED_READWRITE_MIMETYPES
- "${SUPPORTED_READWRITE_MIMETYPES}\",
- \"application/x-lz4-compressed-tar")
-endif()
+ \"application/x-lrzip-compressed-tar\",
+ \"application/x-lz4-compressed-tar")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_libarchive_readonly.json.cmake
@@ -71,11 +60,6 @@
kerfuffle_add_plugin(kerfuffle_libarchive_readonly ${kerfuffle_libarchive_readonly_SRCS})
kerfuffle_add_plugin(kerfuffle_libarchive ${kerfuffle_libarchive_readwrite_SRCS})
-if(LibArchive_VERSION VERSION_EQUAL "3.2.0" OR
- LibArchive_VERSION VERSION_GREATER "3.2.0")
- target_compile_definitions(kerfuffle_libarchive PRIVATE -DHAVE_LIBARCHIVE_3_2_0)
-endif()
-
target_link_libraries(kerfuffle_libarchive_readonly ${LibArchive_LIBRARIES})
target_link_libraries(kerfuffle_libarchive ${LibArchive_LIBRARIES})
@@ -91,3 +75,10 @@
else()
message(WARNING "Could not find the lrzip executable. Ark requires lrzip to handle the tar.lrz archive format.")
endif()
+
+find_program(LZOP lzop)
+if(LZOP)
+ message(STATUS "Found lzop executable: ${LZOP}")
+else()
+ message(WARNING "Could not find the lzop executable. Ark requires lzop to handle the tar.lzo archive format if libarchive >= 3.3 has been compiled without liblzo2 support.")
+endif()
diff -Nru ark-16.12.3/plugins/libarchive/kerfuffle_libarchive.json.cmake ark-17.04.3/plugins/libarchive/kerfuffle_libarchive.json.cmake
--- ark-16.12.3/plugins/libarchive/kerfuffle_libarchive.json.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libarchive/kerfuffle_libarchive.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -1,87 +1,104 @@
{
"KPlugin": {
- "Description": "LibArchive Plugin for Kerfuffle",
- "Description[ca@valencia]": "Connector del LibArchive pel Kerfuffle",
- "Description[ca]": "Connector del LibArchive pel Kerfuffle",
- "Description[cs]": "LibArchive modul pro Kerfuffle",
- "Description[de]": "LibArchive-Modul für Kerfuffle",
- "Description[es]": "Complemento LibArchive para Kerfuffle",
- "Description[et]": "Kerfuffle'i LibArchive plugin",
- "Description[eu]": "Kerfuffle-rentzako LibArchive Plugina",
- "Description[fi]": "LibArchive-pakkaustuki",
- "Description[fr]": "Module externe pour Kerfuffle",
- "Description[gl]": "Complemento de libarchive para Kerfuffle",
- "Description[it]": "Estensione LibArchive per Kerfuffle",
- "Description[ko]": "Kerfuffle을 위한 LibArchive 플러그인",
- "Description[nl]": "LibArchive plug-in voor Kerfuffle",
- "Description[nn]": "LibArchive-tillegg til Kerfuffle",
- "Description[pl]": "Wtyczka LibArchive dla Kerfuffle",
- "Description[pt]": "'Plugin' da LibArchive para o Kerfuffle",
- "Description[pt_BR]": "Plugin LibArchive para a Kerfuffle",
- "Description[ru]": "Модуль LibArchive для Kerfuffle",
- "Description[sk]": "LibArchive modul pre Kerfuffle",
- "Description[sl]": "Vstavek LibArchive za Kerfuffle",
- "Description[sr@ijekavian]": "Прикључак Либархива за Керфафл",
- "Description[sr@ijekavianlatin]": "Priključak libarchivea za Kerfuffle",
- "Description[sr@latin]": "Priključak libarchivea za Kerfuffle",
- "Description[sr]": "Прикључак Либархива за Керфафл",
- "Description[sv]": "LibArchive-insticksprogram för Kerfuffle",
- "Description[uk]": "Додаток LibArchive для Kerfuffle",
- "Description[x-test]": "xxLibArchive Plugin for Kerfufflexx",
- "Description[zh_CN]": "Kerfuffle 的 LibArchive 插件",
- "Description[zh_TW]": "Kerfuffle 的 LibArchive 外掛程式",
- "Id": "kerfuffle_libarchive",
+ "Description": "Full support for compressed TAR archives",
+ "Description[ca@valencia]": "Implementació completa dels arxius TAR comprimits",
+ "Description[ca]": "Implementació completa dels arxius TAR comprimits",
+ "Description[cs]": "Plná podpora komprimovaných archivů TAR",
+ "Description[de]": "Vollständige Unterstützung für komprimierte TAR-Archive",
+ "Description[el]": "Πλήρης υποστήριξη για την αρχειοθήκη μορφής TAR",
+ "Description[es]": "Uso total de los archivos comprimidos TAR",
+ "Description[eu]": "Konprimatutako TAR artxiboentzako euskarri osoa",
+ "Description[fr]": "Prise en charge complète des archives compressées TAR",
+ "Description[it]": "Supporto completo per archivi compressi TAR",
+ "Description[nl]": "Volledige ondersteuning voor gecomprimeerde TAR-archieven",
+ "Description[pl]": "Pełna obsługa dla formatów archiwów TAR",
+ "Description[pt]": "Suporte total para pacotes comprimidos do TAR",
+ "Description[sk]": "Plná podpora komprimovaných archívov TAR",
+ "Description[sl]": "Polna podpora za arhive vrste TAR",
+ "Description[sr@ijekavian]": "Пуна подршка за компресоване тар архиве",
+ "Description[sr@ijekavianlatin]": "Puna podrška za kompresovane tar arhive",
+ "Description[sr@latin]": "Puna podrška za kompresovane tar arhive",
+ "Description[sr]": "Пуна подршка за компресоване тар архиве",
+ "Description[sv]": "Fullt stöd för komprimerade TAR-arkiv",
+ "Description[tr]": "Sıkıştırılmış TAR arşivleri için tam destek",
+ "Description[uk]": "Повноцінна підтримка стиснених архівів TAR",
+ "Description[x-test]": "xxFull support for compressed TAR archivesxx",
+ "Description[zh_CN]": "完全支持压缩的 TAR 归档",
+ "Description[zh_TW]": "對壓縮過的 TAR 壓縮檔的完整支援",
+ "Id": "kerfuffle_libarchive",
"MimeTypes": [
"@SUPPORTED_READWRITE_MIMETYPES@"
- ],
- "Name": "kerfuffle_libarchive",
- "Name[sv]": "Kerfuffle LibArchive",
- "Name[x-test]": "xxkerfuffle_libarchivexx",
+ ],
+ "Name": "Libarchive plugin",
+ "Name[ca@valencia]": "Connector del Libarchive",
+ "Name[ca]": "Connector del Libarchive",
+ "Name[cs]": "Modul libarchive",
+ "Name[de]": "LibArchive-Modul",
+ "Name[el]": "Πρόσθετο Libarchive",
+ "Name[es]": "Complemento Libarchive",
+ "Name[eu]": "Libarchive plugina",
+ "Name[fr]": "Module externe libarchive",
+ "Name[it]": "Estensione Libarchive",
+ "Name[nl]": "LibArchive-plug-in",
+ "Name[pl]": "Wtyczka libarchive",
+ "Name[pt]": "'Plugin' da Libarchive",
+ "Name[sk]": "Plugin Libarchive",
+ "Name[sl]": "Vstavek Libarchive",
+ "Name[sr@ijekavian]": "Прикључак за Либархив",
+ "Name[sr@ijekavianlatin]": "Priključak za libarchive",
+ "Name[sr@latin]": "Priključak za libarchive",
+ "Name[sr]": "Прикључак за Либархив",
+ "Name[sv]": "Libarchive-insticksprogram",
+ "Name[tr]": "Libarchive eklentisi",
+ "Name[uk]": "Додаток libarchive",
+ "Name[x-test]": "xxLibarchive pluginxx",
+ "Name[zh_CN]": "Libarchive 插件",
+ "Name[zh_TW]": "Libarchive 外掛程式",
"ServiceTypes": [
"Kerfuffle/Plugin"
- ],
+ ],
"Version": "@KDE_APPLICATIONS_VERSION@"
- },
- "X-KDE-Kerfuffle-ReadWrite": true,
- "X-KDE-Priority": 100,
+ },
+ "X-KDE-Kerfuffle-ReadWrite": true,
+ "X-KDE-Priority": 100,
"application/x-bzip-compressed-tar": {
- "CompressionLevelDefault": 9,
- "CompressionLevelMax": 9,
+ "CompressionLevelDefault": 9,
+ "CompressionLevelMax": 9,
"CompressionLevelMin": 1
- },
+ },
"application/x-compressed-tar": {
- "CompressionLevelDefault": 6,
- "CompressionLevelMax": 9,
+ "CompressionLevelDefault": 6,
+ "CompressionLevelMax": 9,
"CompressionLevelMin": 1
- },
+ },
"application/x-lrzip-compressed-tar": {
- "CompressionLevelDefault": 1,
- "CompressionLevelMax": 9,
+ "CompressionLevelDefault": 1,
+ "CompressionLevelMax": 9,
"CompressionLevelMin": 1
- },
+ },
"application/x-lz4-compressed-tar": {
- "CompressionLevelDefault": 1,
- "CompressionLevelMax": 9,
+ "CompressionLevelDefault": 1,
+ "CompressionLevelMax": 9,
"CompressionLevelMin": 1
- },
+ },
"application/x-lzip-compressed-tar": {
- "CompressionLevelDefault": 6,
- "CompressionLevelMax": 9,
+ "CompressionLevelDefault": 6,
+ "CompressionLevelMax": 9,
"CompressionLevelMin": 0
- },
+ },
"application/x-lzma-compressed-tar": {
- "CompressionLevelDefault": 6,
- "CompressionLevelMax": 9,
+ "CompressionLevelDefault": 6,
+ "CompressionLevelMax": 9,
"CompressionLevelMin": 0
- },
+ },
"application/x-tzo": {
- "CompressionLevelDefault": 5,
- "CompressionLevelMax": 9,
+ "CompressionLevelDefault": 5,
+ "CompressionLevelMax": 9,
"CompressionLevelMin": 1
- },
+ },
"application/x-xz-compressed-tar": {
- "CompressionLevelDefault": 6,
- "CompressionLevelMax": 9,
+ "CompressionLevelDefault": 6,
+ "CompressionLevelMax": 9,
"CompressionLevelMin": 0
}
}
diff -Nru ark-16.12.3/plugins/libarchive/kerfuffle_libarchive_readonly.json.cmake ark-17.04.3/plugins/libarchive/kerfuffle_libarchive_readonly.json.cmake
--- ark-16.12.3/plugins/libarchive/kerfuffle_libarchive_readonly.json.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libarchive/kerfuffle_libarchive_readonly.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -1,17 +1,64 @@
{
"KPlugin": {
- "Id": "kerfuffle_libarchive_readonly",
+ "Description": "Open and extract DEB, RPM, ISO, AppImage, XAR and CAB files",
+ "Description[ca@valencia]": "Obri i extreu fitxers DEB, RPM, ISO, AppImage, XAR i CAB",
+ "Description[ca]": "Obre i extreu fitxers DEB, RPM, ISO, AppImage, XAR i CAB",
+ "Description[cs]": "Otevřít a rozbalit soubory DEB, RPM, ISO, AppImage, XAR a CAB",
+ "Description[de]": "Öffnen und Entpacken von DEB-, RPM-, ISO-, AppImage-, XAR- und CAB-Dateien",
+ "Description[el]": "Άνοιγμα και εξαγωγή αρχείων DEB, RPM, ISO, AppImage, XAR και CAB",
+ "Description[es]": "Abrir y extraer archivos DEB, RPM, ISO, AppImage, XAR y CAB",
+ "Description[eu]": "Ireki eta erauzi DEB, RPM, ISO, AppImage, XAR eta CAB fitxategiak",
+ "Description[fr]": "Ouvre et extrait les fichiers DEB, RPM, ISO, AppImage, XAR et CAB",
+ "Description[it]": "Apri ed estrai file DEB, RPM, ISO, AppImage, XAR e CAB",
+ "Description[nl]": "Open en pak uit DEB, RPM, ISO, AppImage, XAR en CAB bestanden",
+ "Description[pl]": "Otwieraj i wypakowuj pliki DEB, RPM, ISO, AppImage, XAR oraz CAB",
+ "Description[pt]": "Abrir e extrair ficheiros DEB, RPM, ISO, AppImage, XAR e CAB",
+ "Description[sk]": "Otvorenie a extrahovanie súborov DEB, RPM, ISO, AppImage, XAR a CAB",
+ "Description[sl]": "Odprite in razširite datoteke DEB, RPM, ISO, AppImage, XAR in CAB",
+ "Description[sr@ijekavian]": "Отварање и распакивање ДЕБ, РПМ, ИСО, ап‑имејџ, КСАР и КАБ фајлова",
+ "Description[sr@ijekavianlatin]": "Otvaranje i raspakivanje DEB, RPM, ISO, AppImage, XAR i CAB fajlova",
+ "Description[sr@latin]": "Otvaranje i raspakivanje DEB, RPM, ISO, AppImage, XAR i CAB fajlova",
+ "Description[sr]": "Отварање и распакивање ДЕБ, РПМ, ИСО, ап‑имејџ, КСАР и КАБ фајлова",
+ "Description[sv]": "Öppna och packa upp DEB-, RPM-, ISO-, AppImage-, XAR- och CAB-filer",
+ "Description[tr]": "DEB, RPM, ISO, AppImage, XAR ve CAB dosyalarını açıp çıkartın",
+ "Description[uk]": "Здатен відкривати і видобувати дані з архівів DEB, RPM, ISO, AppImage, XAR та CAB",
+ "Description[x-test]": "xxOpen and extract DEB, RPM, ISO, AppImage, XAR and CAB filesxx",
+ "Description[zh_CN]": "打开和解压 DEB,RPM,ISO,AppImage,XAR 和 CAB 文件",
+ "Description[zh_TW]": "開啟並解壓縮 DEB, RPM, ISO, AppImage, XAR 與 CAB 檔案",
+ "Id": "kerfuffle_libarchive_readonly",
"MimeTypes": [
"@SUPPORTED_READONLY_MIMETYPES@"
- ],
- "Name": "kerfuffle_libarchive_readonly",
- "Name[sv]": "Kerfuffle LibArchive skrivskyddat",
- "Name[x-test]": "xxkerfuffle_libarchive_readonlyxx",
+ ],
+ "Name": "Libarchive plugin (read-only formats)",
+ "Name[ca@valencia]": "Connector del Libarchive (formats de només lectura)",
+ "Name[ca]": "Connector del Libarchive (formats de només lectura)",
+ "Name[cs]": "Modul libarchive (formáty pouze pro čtení)",
+ "Name[de]": "LibArchive-Modul (Nur lesbare Formate)",
+ "Name[el]": "Πρόσθετο Libarchive (ανάγνωση μόνο)",
+ "Name[es]": "Complemento Libarchive (formatos de solo lectura)",
+ "Name[eu]": "Libarchive plugina (irakurri-soilik formatuak)",
+ "Name[fr]": "Module externe libarchive (formats en lecture seule)",
+ "Name[it]": "Estensione Libarchive (formati in sola lettura)",
+ "Name[nl]": "LibArchive-plug-in (alleen-lezen formaten)",
+ "Name[pl]": "Wtyczka Libarchive (formaty tylko-do-odczytu)",
+ "Name[pt]": "'Plugin' da Libarchive (formatos apenas para leitura)",
+ "Name[sk]": "Plugin Libarchive (formáty iba na čítanie)",
+ "Name[sl]": "Vstavek Libarchive (samo za branje)",
+ "Name[sr@ijekavian]": "Прикључак за Либархив (формати само‑за‑читање)",
+ "Name[sr@ijekavianlatin]": "Priključak za libarchive (formati samo‑za‑čitanje)",
+ "Name[sr@latin]": "Priključak za libarchive (formati samo‑za‑čitanje)",
+ "Name[sr]": "Прикључак за Либархив (формати само‑за‑читање)",
+ "Name[sv]": "Libarchive-insticksprogram (endast läsningsformat)",
+ "Name[tr]": "Libarchive eklentisi (salt okunur biçimler)",
+ "Name[uk]": "Додаток libarchive (формати лише для читання)",
+ "Name[x-test]": "xxLibarchive plugin (read-only formats)xx",
+ "Name[zh_CN]": "Libarchive 插件 (只读格式)",
+ "Name[zh_TW]": "Libarchive 外掛程式(唯讀格式)",
"ServiceTypes": [
"Kerfuffle/Plugin"
- ],
+ ],
"Version": "@KDE_APPLICATIONS_VERSION@"
- },
- "X-KDE-Kerfuffle-ReadWrite": false,
+ },
+ "X-KDE-Kerfuffle-ReadWrite": false,
"X-KDE-Priority": 100
}
diff -Nru ark-16.12.3/plugins/libarchive/libarchiveplugin.cpp ark-17.04.3/plugins/libarchive/libarchiveplugin.cpp
--- ark-16.12.3/plugins/libarchive/libarchiveplugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libarchive/libarchiveplugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -27,13 +27,16 @@
*/
#include "libarchiveplugin.h"
-#include "kerfuffle/queries.h"
+#include "ark_debug.h"
+#include "queries.h"
#include
#include
#include
+#include
+
LibarchivePlugin::LibarchivePlugin(QObject *parent, const QVariantList &args)
: ReadWriteArchiveInterface(parent, args)
, m_archiveReadDisk(archive_read_disk_new())
@@ -70,7 +73,7 @@
m_cachedArchiveEntryCount = 0;
m_extractedFilesSize = 0;
m_numberOfEntries = 0;
- qulonglong compressedArchiveSize = QFileInfo(filename()).size();
+ auto compressedArchiveSize = QFileInfo(filename()).size();
struct archive_entry *aentry;
int result = ARCHIVE_RETRY;
@@ -467,7 +470,8 @@
e->setProperty("link", QLatin1String( archive_entry_symlink(aentry) ));
}
- e->setProperty("timestamp", QDateTime::fromTime_t(archive_entry_mtime(aentry)));
+ auto time = static_cast(archive_entry_mtime(aentry));
+ e->setProperty("timestamp", QDateTime::fromTime_t(time));
emit entry(e);
m_emittedEntries << e;
@@ -495,16 +499,15 @@
void LibarchivePlugin::copyData(const QString& filename, struct archive *dest, bool partialprogress)
{
char buff[10240];
- ssize_t readBytes;
QFile file(filename);
if (!file.open(QIODevice::ReadOnly)) {
return;
}
- readBytes = file.read(buff, sizeof(buff));
- while (!QThread::currentThread()->isInterruptionRequested() && readBytes > 0) {
- archive_write_data(dest, buff, readBytes);
+ auto readBytes = file.read(buff, sizeof(buff));
+ while (readBytes > 0) {
+ archive_write_data(dest, buff, static_cast(readBytes));
if (archive_errno(dest) != ARCHIVE_OK) {
qCCritical(ARK) << "Error while writing" << filename << ":" << archive_error_string(dest)
<< "(error no =" << archive_errno(dest) << ')';
@@ -525,11 +528,10 @@
void LibarchivePlugin::copyData(const QString& filename, struct archive *source, struct archive *dest, bool partialprogress)
{
char buff[10240];
- ssize_t readBytes;
- readBytes = archive_read_data(source, buff, sizeof(buff));
+ auto readBytes = archive_read_data(source, buff, sizeof(buff));
while (readBytes > 0) {
- archive_write_data(dest, buff, readBytes);
+ archive_write_data(dest, buff, static_cast(readBytes));
if (archive_errno(dest) != ARCHIVE_OK) {
qCCritical(ARK) << "Error while extracting" << filename << ":" << archive_error_string(dest)
<< "(error no =" << archive_errno(dest) << ')';
diff -Nru ark-16.12.3/plugins/libarchive/libarchiveplugin.h ark-17.04.3/plugins/libarchive/libarchiveplugin.h
--- ark-16.12.3/plugins/libarchive/libarchiveplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libarchive/libarchiveplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -28,8 +28,7 @@
#ifndef LIBARCHIVEPLUGIN_H
#define LIBARCHIVEPLUGIN_H
-#include "kerfuffle/archiveinterface.h"
-#include "kerfuffle/archiveentry.h"
+#include "archiveinterface.h"
#include
@@ -43,19 +42,19 @@
public:
explicit LibarchivePlugin(QObject *parent, const QVariantList &args);
- virtual ~LibarchivePlugin();
+ ~LibarchivePlugin() override;
- virtual bool list() Q_DECL_OVERRIDE;
- virtual bool doKill() Q_DECL_OVERRIDE;
- virtual bool extractFiles(const QVector &files, const QString &destinationDirectory, const ExtractionOptions &options) Q_DECL_OVERRIDE;
-
- virtual bool addFiles(const QVector &files, const Archive::Entry *destination, const CompressionOptions &options, uint numberOfEntriesToAdd = 0) Q_DECL_OVERRIDE;
- virtual bool moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions &options) Q_DECL_OVERRIDE;
- virtual bool copyFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions &options) Q_DECL_OVERRIDE;
- virtual bool deleteFiles(const QVector &files) Q_DECL_OVERRIDE;
- virtual bool addComment(const QString &comment) Q_DECL_OVERRIDE;
- virtual bool testArchive() Q_DECL_OVERRIDE;
- virtual bool hasBatchExtractionProgress() const Q_DECL_OVERRIDE;
+ bool list() override;
+ bool doKill() override;
+ bool extractFiles(const QVector &files, const QString &destinationDirectory, const ExtractionOptions &options) override;
+
+ bool addFiles(const QVector &files, const Archive::Entry *destination, const CompressionOptions &options, uint numberOfEntriesToAdd = 0) override;
+ bool moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions &options) override;
+ bool copyFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions &options) override;
+ bool deleteFiles(const QVector &files) override;
+ bool addComment(const QString &comment) override;
+ bool testArchive() override;
+ bool hasBatchExtractionProgress() const override;
protected:
struct ArchiveReadCustomDeleter
diff -Nru ark-16.12.3/plugins/libarchive/readonlylibarchiveplugin.h ark-17.04.3/plugins/libarchive/readonlylibarchiveplugin.h
--- ark-16.12.3/plugins/libarchive/readonlylibarchiveplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libarchive/readonlylibarchiveplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -35,7 +35,7 @@
public:
explicit ReadOnlyLibarchivePlugin(QObject *parent, const QVariantList& args);
- ~ReadOnlyLibarchivePlugin();
+ ~ReadOnlyLibarchivePlugin() override;
};
diff -Nru ark-16.12.3/plugins/libarchive/readwritelibarchiveplugin.cpp ark-17.04.3/plugins/libarchive/readwritelibarchiveplugin.cpp
--- ark-16.12.3/plugins/libarchive/readwritelibarchiveplugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libarchive/readwritelibarchiveplugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -27,6 +27,7 @@
*/
#include "readwritelibarchiveplugin.h"
+#include "ark_debug.h"
#include
#include
@@ -35,6 +36,8 @@
#include
#include
+#include
+
K_PLUGIN_FACTORY_WITH_JSON(ReadWriteLibarchivePluginFactory, "kerfuffle_libarchive.json", registerPlugin();)
ReadWriteLibarchivePlugin::ReadWriteLibarchivePlugin(QObject *parent, const QVariantList &args)
@@ -66,9 +69,9 @@
// First write the new files.
qCDebug(ARK) << "Writing new entries";
- int no_entries = 0;
+ uint no_entries = 0;
// Recreate destination directory structure.
- const QString destinationPath = (destination == Q_NULLPTR)
+ const QString destinationPath = (destination == nullptr)
? QString()
: destination->fullPath();
@@ -149,7 +152,7 @@
}
// Copy old elements from previous archive to new archive.
- int no_entries = 0;
+ uint no_entries = 0;
m_filesPaths = entryFullPaths(files);
m_entriesWithoutChildren = entriesWithoutChildren(files).count();
m_destination = destination;
@@ -179,7 +182,7 @@
}
// Copy old elements from previous archive to new archive.
- int no_entries = 0;
+ uint no_entries = 0;
m_filesPaths = entryFullPaths(files);
m_destination = destination;
const bool isSuccessful = processOldEntries(no_entries, Copy, m_numberOfEntries);
@@ -206,7 +209,7 @@
}
// Copy old elements from previous archive to new archive.
- int no_entries = 0;
+ uint no_entries = 0;
m_filesPaths = entryFullPaths(files);
const bool isSuccessful = processOldEntries(no_entries, Delete, m_numberOfEntries);
if (isSuccessful) {
@@ -288,11 +291,9 @@
ret = archive_write_add_filter_lrzip(m_archiveWriter.data());
requiresExecutable = true;
break;
-#ifdef HAVE_LIBARCHIVE_3_2_0
case ARCHIVE_FILTER_LZ4:
ret = archive_write_add_filter_lz4(m_archiveWriter.data());
break;
-#endif
case ARCHIVE_FILTER_NONE:
ret = archive_write_add_filter_none(m_archiveWriter.data());
break;
@@ -342,11 +343,9 @@
qCDebug(ARK) << "Detected lrzip compression for new file";
ret = archive_write_add_filter_lrzip(m_archiveWriter.data());
requiresExecutable = true;
-#ifdef HAVE_LIBARCHIVE_3_2_0
} else if (filename().right(3).toUpper() == QLatin1String("LZ4")) {
qCDebug(ARK) << "Detected lz4 compression for new file";
ret = archive_write_add_filter_lz4(m_archiveWriter.data());
-#endif
} else if (filename().right(3).toUpper() == QLatin1String("TAR")) {
qCDebug(ARK) << "Detected no compression for new file (pure tar)";
ret = archive_write_add_filter_none(m_archiveWriter.data());
@@ -366,7 +365,7 @@
// Set compression level if passed in CompressionOptions.
if (options.isCompressionLevelSet()) {
qCDebug(ARK) << "Using compression level:" << options.compressionLevel();
- ret = archive_write_set_filter_option(m_archiveWriter.data(), NULL, "compression-level", QString::number(options.compressionLevel()).toUtf8());
+ ret = archive_write_set_filter_option(m_archiveWriter.data(), nullptr, "compression-level", QString::number(options.compressionLevel()).toUtf8());
if (ret != ARCHIVE_OK) {
qCWarning(ARK) << "Failed to set compression level" << archive_error_string(m_archiveWriter.data());
emit error(i18nc("@info", "Could not set the compression level."));
@@ -386,13 +385,13 @@
m_tempFile.commit();
}
-bool ReadWriteLibarchivePlugin::processOldEntries(int &entriesCounter, OperationMode mode, uint totalCount)
+bool ReadWriteLibarchivePlugin::processOldEntries(uint &entriesCounter, OperationMode mode, uint totalCount)
{
struct archive_entry *entry;
const uint newEntries = entriesCounter;
entriesCounter = 0;
- int iteratedEntries = 0;
+ uint iteratedEntries = 0;
// Create a map that contains old path as key and new path as value.
QMap pathMap;
diff -Nru ark-16.12.3/plugins/libarchive/readwritelibarchiveplugin.h ark-17.04.3/plugins/libarchive/readwritelibarchiveplugin.h
--- ark-16.12.3/plugins/libarchive/readwritelibarchiveplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libarchive/readwritelibarchiveplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -42,12 +42,12 @@
public:
explicit ReadWriteLibarchivePlugin(QObject *parent, const QVariantList &args);
- ~ReadWriteLibarchivePlugin();
+ ~ReadWriteLibarchivePlugin() override;
- bool addFiles(const QVector &files, const Archive::Entry *destination, const CompressionOptions &options, uint numberOfEntriesToAdd = 0) Q_DECL_OVERRIDE;
- bool moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions &options) Q_DECL_OVERRIDE;
- bool copyFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions &options) Q_DECL_OVERRIDE;
- bool deleteFiles(const QVector &files) Q_DECL_OVERRIDE;
+ bool addFiles(const QVector &files, const Archive::Entry *destination, const CompressionOptions &options, uint numberOfEntriesToAdd = 0) override;
+ bool moveFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions &options) override;
+ bool copyFiles(const QVector &files, Archive::Entry *destination, const CompressionOptions &options) override;
+ bool deleteFiles(const QVector &files) override;
protected:
bool initializeWriter(const bool creatingNewFile = false, const CompressionOptions &options = CompressionOptions());
@@ -64,7 +64,7 @@
*
* @return bool indicating whether the operation was successful.
*/
- bool processOldEntries(int &entriesCounter, OperationMode mode, uint totalCount);
+ bool processOldEntries(uint &entriesCounter, OperationMode mode, uint totalCount);
/**
* Writes entry being read into memory.
@@ -90,7 +90,7 @@
// Passed argument from job which is used by processOldEntries method.
QStringList m_filesPaths;
int m_entriesWithoutChildren = 0;
- const Archive::Entry *m_destination = Q_NULLPTR;
+ const Archive::Entry *m_destination = nullptr;
};
#endif // READWRITELIBARCHIVEPLUGIN_H
diff -Nru ark-16.12.3/plugins/libsinglefileplugin/bz2plugin.cpp ark-17.04.3/plugins/libsinglefileplugin/bz2plugin.cpp
--- ark-16.12.3/plugins/libsinglefileplugin/bz2plugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libsinglefileplugin/bz2plugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -24,7 +24,6 @@
*/
#include "bz2plugin.h"
-#include "kerfuffle/kerfuffle_export.h"
#include
diff -Nru ark-16.12.3/plugins/libsinglefileplugin/bz2plugin.h ark-17.04.3/plugins/libsinglefileplugin/bz2plugin.h
--- ark-16.12.3/plugins/libsinglefileplugin/bz2plugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libsinglefileplugin/bz2plugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -34,7 +34,7 @@
public:
LibBzip2Interface(QObject *parent, const QVariantList & args);
- virtual ~LibBzip2Interface();
+ ~LibBzip2Interface() override;
};
#endif // BZ2PLUGIN_H
diff -Nru ark-16.12.3/plugins/libsinglefileplugin/gzplugin.h ark-17.04.3/plugins/libsinglefileplugin/gzplugin.h
--- ark-16.12.3/plugins/libsinglefileplugin/gzplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libsinglefileplugin/gzplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -34,7 +34,7 @@
public:
LibGzipInterface(QObject *parent, const QVariantList & args);
- virtual ~LibGzipInterface();
+ ~LibGzipInterface() override;
};
#endif // GZPLUGIN_H
diff -Nru ark-16.12.3/plugins/libsinglefileplugin/kerfuffle_libbz2.json.cmake ark-17.04.3/plugins/libsinglefileplugin/kerfuffle_libbz2.json.cmake
--- ark-16.12.3/plugins/libsinglefileplugin/kerfuffle_libbz2.json.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libsinglefileplugin/kerfuffle_libbz2.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -1,46 +1,63 @@
{
"KPlugin": {
- "Description": "libbz2 plugin for Kerfuffle",
- "Description[ca@valencia]": "Connector del libbz2 pel Kerfuffle",
- "Description[ca]": "Connector del libbz2 pel Kerfuffle",
- "Description[cs]": "modul libbz2 pro Kerfuffle",
- "Description[de]": "libgz2-Modul für Kerfuffle",
- "Description[es]": "Complemento libbz2 para Kerfuffle",
- "Description[et]": "Kerfuffle'i libbz2 plugin",
- "Description[eu]": "Kerfuffle-rentzako libbz2 plugina",
- "Description[fi]": "libbz2-pakkaustuki",
- "Description[fr]": "Module externe « libbz2 » pour Kerfuffle",
- "Description[gl]": "Complemento de libbz2 para Kerfuffle",
- "Description[it]": "Estensione libbz2 per Kerfuffle",
- "Description[ko]": "Kerfuffle을 위한 libbz2 플러그인",
- "Description[nl]": "libbz2 plug-in voor Kerfuffle",
- "Description[nn]": "libzip2-tillegg til Kerfuffle",
- "Description[pl]": "wtyczka libbz2 dla Kerfuffle",
- "Description[pt]": "'Plugin' de libbz2 para o Kerfuffle",
- "Description[pt_BR]": "Plugin libbz2 para o Kerfuffle",
- "Description[ru]": "Модуль libbz2 для Kerfuffle",
- "Description[sk]": "libbz2 modul pre Kerfuffle",
- "Description[sl]": "Vstavek libbz2 za Kerfuffle",
- "Description[sr@ijekavian]": "Прикључак libbz2 за Керфафл",
- "Description[sr@ijekavianlatin]": "Priključak libbz2 za Kerfuffle",
- "Description[sr@latin]": "Priključak libbz2 za Kerfuffle",
- "Description[sr]": "Прикључак libbz2 за Керфафл",
- "Description[sv]": "Libbz2-insticksprogram för Kerfuffle",
- "Description[uk]": "Додаток libbz2 для Kerfuffle",
- "Description[x-test]": "xxlibbz2 plugin for Kerfufflexx",
- "Description[zh_CN]": "Kerfuffle 的 libbz2 插件",
- "Description[zh_TW]": "Kerfuffle 的 libbz2 外掛程式",
- "Id": "kerfuffle_libbz2",
+ "Description": "Open and extract single files compressed with the bzip2 algorithm",
+ "Description[ca@valencia]": "Obri i extreu fitxers individuals comprimits amb l'algorisme «bzip2»",
+ "Description[ca]": "Obre i extreu fitxers individuals comprimits amb l'algorisme «bzip2»",
+ "Description[cs]": "Otevřít a rozbalit jednotlivé soubory komprimované algoritmem bzip2",
+ "Description[de]": "Öffnen und Entpacken von einzelnen mit dem Bzip2-Algorithmus komprimierten Dateien",
+ "Description[el]": "Άνοιγμα και εξαγωγή απλών αρχείων συμπιεσμένα με τον αλγόριθμο bzip2",
+ "Description[es]": "Abrir y extraer archivos individuales comprimidos con el algoritmo bzip2",
+ "Description[eu]": "Ireki eta erauzi bzip2 algoritmoarekin konprimatutako fitxategiak banaka",
+ "Description[fr]": "Ouvre et extrait des fichiers compressés avec l'algorithme bzip2",
+ "Description[it]": "Apri ed estrai singoli file compressi con l'algoritmo bzip2",
+ "Description[nl]": "Open en pak uit losse bestanden gecomprimeerd met het bzip2-algoritme",
+ "Description[pl]": "Otwieraj i wypakowuj pojedyncze pliki spakowane algorytmem bzip2",
+ "Description[pt]": "Abrir e extrair ficheiros individuais comprimidos com o algoritmo Bzip2",
+ "Description[sk]": "Otvorenie a extrahovanie jednotlivých súborov komprimovaných algoritmom bzip2",
+ "Description[sl]": "Odprite in razširite datoteke stisnjene z algoritmom bzip2",
+ "Description[sr@ijekavian]": "Отварање и распакивање појединачних фајлова компресованих алгоритмом бзип2",
+ "Description[sr@ijekavianlatin]": "Otvaranje i raspakivanje pojedinačnih fajlova kompresovanih algoritmom bzip2",
+ "Description[sr@latin]": "Otvaranje i raspakivanje pojedinačnih fajlova kompresovanih algoritmom bzip2",
+ "Description[sr]": "Отварање и распакивање појединачних фајлова компресованих алгоритмом бзип2",
+ "Description[sv]": "Öppna och packa upp enstaka filer komprimerade med bzip2-algoritmen",
+ "Description[tr]": "Bzip2 algoritması ile sıkıştırılmış tek dosyaları açma ve çıkarma",
+ "Description[uk]": "Здатен відкривати і видобувати дані із окремих файлів, стиснених за допомогою алгоритму bzip2",
+ "Description[x-test]": "xxOpen and extract single files compressed with the bzip2 algorithmxx",
+ "Description[zh_CN]": "打开和解压 bzip2 算法压缩的单个文件",
+ "Description[zh_TW]": "開啟並解壓縮以 bzip2 演算法壓縮的單一檔案",
+ "Id": "kerfuffle_libbz2",
"MimeTypes": [
"@SUPPORTED_MIMETYPES@"
- ],
- "Name": "kerfuffle_libbz2",
- "Name[sv]": "Kerfuffle Libbz2",
- "Name[x-test]": "xxkerfuffle_libbz2xx",
+ ],
+ "Name": "Bzip2 plugin",
+ "Name[ca@valencia]": "Connector del Bzip2",
+ "Name[ca]": "Connector del Bzip2",
+ "Name[cs]": "Modul pro bzip2",
+ "Name[de]": "Bzip2-Modul",
+ "Name[el]": "Πρόσθετο Bzip2",
+ "Name[es]": "Complemento Bzip2",
+ "Name[eu]": "Bzip2 plugina",
+ "Name[fr]": "Module externe d'archive « bzip2 »",
+ "Name[it]": "Estensione Bzip2",
+ "Name[nl]": "Bzip2-plug-in",
+ "Name[pl]": "Wtyczka bzip2",
+ "Name[pt]": "'Plugin' do Bzip2",
+ "Name[sk]": "Plugin Bzip2",
+ "Name[sl]": "Vstavek Bzip2",
+ "Name[sr@ijekavian]": "Прикључак за бзип2",
+ "Name[sr@ijekavianlatin]": "Priključak za bzip2",
+ "Name[sr@latin]": "Priključak za bzip2",
+ "Name[sr]": "Прикључак за бзип2",
+ "Name[sv]": "Bzip2-insticksprogram",
+ "Name[tr]": "Bzip2 eklentisi",
+ "Name[uk]": "Додаток bzip2",
+ "Name[x-test]": "xxBzip2 pluginxx",
+ "Name[zh_CN]": "Bzip2 插件",
+ "Name[zh_TW]": "Bzip2 外掛程式",
"ServiceTypes": [
"Kerfuffle/Plugin"
- ],
+ ],
"Version": "@KDE_APPLICATIONS_VERSION@"
- },
+ },
"X-KDE-Priority": 100
}
diff -Nru ark-16.12.3/plugins/libsinglefileplugin/kerfuffle_libgz.json.cmake ark-17.04.3/plugins/libsinglefileplugin/kerfuffle_libgz.json.cmake
--- ark-16.12.3/plugins/libsinglefileplugin/kerfuffle_libgz.json.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libsinglefileplugin/kerfuffle_libgz.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -1,46 +1,63 @@
{
"KPlugin": {
- "Description": "libgz plugin for Kerfuffle",
- "Description[ca@valencia]": "Connector del libgz pel Kerfuffle",
- "Description[ca]": "Connector del libgz pel Kerfuffle",
- "Description[cs]": "modul libgz pro Kerfuffle",
- "Description[de]": "libgz-Modul für Kerfuffle",
- "Description[es]": "Complemento libgz para Kerfuffle",
- "Description[et]": "Kerfuffle'i libgz plugin",
- "Description[eu]": "Kerfuffle-rentzako libgz plugina",
- "Description[fi]": "libgz-pakkaustuki",
- "Description[fr]": "Module externe « libgz » pour Kerfuffle",
- "Description[gl]": "Complemento de libgz para Kerfuffle",
- "Description[it]": "Estensione libgz per Kerfuffle",
- "Description[ko]": "Kerfuffle을 위한 libgz 플러그인",
- "Description[nl]": "libgz-plug-in voor Kerfuffle",
- "Description[nn]": "libgz-tillegg til Kerfuffle",
- "Description[pl]": "wtyczka libgz dla Kerfuffle",
- "Description[pt]": "'Plugin' de libgz para o Kerfuffle",
- "Description[pt_BR]": "Plugin libgz para a Kerfuffle",
- "Description[ru]": "Модуль libgz для Kerfuffle",
- "Description[sk]": "libgz modul pre Kerfuffle",
- "Description[sl]": "Vstavek libgz za Kerfuffle",
- "Description[sr@ijekavian]": "Прикључак libgz за Керфафл",
- "Description[sr@ijekavianlatin]": "Priključak libgz za Kerfuffle",
- "Description[sr@latin]": "Priključak libgz za Kerfuffle",
- "Description[sr]": "Прикључак libgz за Керфафл",
- "Description[sv]": "Libgz-insticksprogram för Kerfuffle",
- "Description[uk]": "Додаток libgz для Kerfuffle",
- "Description[x-test]": "xxlibgz plugin for Kerfufflexx",
- "Description[zh_CN]": "Kerfuffle 的 libgz 插件",
- "Description[zh_TW]": "Kerfuffle 的 libgz 外掛程式",
- "Id": "kerfuffle_libgz",
+ "Description": "Open and extract single files compressed with the gzip algorithm",
+ "Description[ca@valencia]": "Obri i extreu fitxers individuals comprimits amb l'algorisme «gzip»",
+ "Description[ca]": "Obre i extreu fitxers individuals comprimits amb l'algorisme «gzip»",
+ "Description[cs]": "Otevřít a rozbalit jednotlivé soubory komprimované algoritmem gzip",
+ "Description[de]": "Öffnen und Entpacken von einzelnen mit dem GZip-Algorithmus komprimierten Dateien",
+ "Description[el]": "Άνοιγμα και εξαγωγή απλών αρχείων συμπιεσμένα με τον αλγόριθμο gzip",
+ "Description[es]": "Abrir y extraer archivos individuales comprimidos con el algoritmo gzip",
+ "Description[eu]": "Ireki eta erauzi gzip algoritmoarekin konprimatutako fitxategiak banaka",
+ "Description[fr]": "Ouvre et extrait des fichiers compressés avec l'algorithme gzip",
+ "Description[it]": "Apri ed estrai singoli file compressi con l'algoritmo gzip",
+ "Description[nl]": "Open en pak uit losse bestanden gecomprimeerd met het gzip-algoritme",
+ "Description[pl]": "Otwieraj i wypakowuj pojedyncze pliki spakowane algorytmem gzip",
+ "Description[pt]": "Abrir e extrair ficheiros individuais comprimidos com o algoritmo Gzip",
+ "Description[sk]": "Otvorenie a extrahovanie jednotlivých súborov komprimovaných algoritmom gzip",
+ "Description[sl]": "Odprite in razširite datoteke stisnjene z algoritmom gzip",
+ "Description[sr@ijekavian]": "Отварање и распакивање појединачних фајлова компресованих алгоритмом гзип",
+ "Description[sr@ijekavianlatin]": "Otvaranje i raspakivanje pojedinačnih fajlova kompresovanih algoritmom gzip",
+ "Description[sr@latin]": "Otvaranje i raspakivanje pojedinačnih fajlova kompresovanih algoritmom gzip",
+ "Description[sr]": "Отварање и распакивање појединачних фајлова компресованих алгоритмом гзип",
+ "Description[sv]": "Öppna och packa upp enstaka filer komprimerade med gzip-algoritmen",
+ "Description[tr]": "Gzip algoritması ile sıkıştırılmış tek dosyaları açma ve çıkarma",
+ "Description[uk]": "Здатен відкривати і видобувати дані із окремих файлів, стиснених за допомогою алгоритму gzip",
+ "Description[x-test]": "xxOpen and extract single files compressed with the gzip algorithmxx",
+ "Description[zh_CN]": "打开和解压 gzip 算法压缩的单个文件",
+ "Description[zh_TW]": "開啟並解壓縮以 gzip 演算法壓縮的單一檔案",
+ "Id": "kerfuffle_libgz",
"MimeTypes": [
"@SUPPORTED_MIMETYPES@"
- ],
- "Name": "kerfuffle_libgz",
- "Name[sv]": "Kerfuffle Libgz",
- "Name[x-test]": "xxkerfuffle_libgzxx",
+ ],
+ "Name": "Gzip plugin",
+ "Name[ca@valencia]": "Connector del Gzip",
+ "Name[ca]": "Connector del Gzip",
+ "Name[cs]": "Modul pro gzip",
+ "Name[de]": "Gzip-Modul",
+ "Name[el]": "Πρόσθετο Gzip",
+ "Name[es]": "Complemento Gzip",
+ "Name[eu]": "Gzip plugina",
+ "Name[fr]": "Module externe d'archive « gzip »",
+ "Name[it]": "Estensione Gzip",
+ "Name[nl]": "Gzip-plug-in",
+ "Name[pl]": "Wtyczka gzip",
+ "Name[pt]": "'Plugin' do Gzip",
+ "Name[sk]": "Plugin Gzip",
+ "Name[sl]": "Vstavek Gzip",
+ "Name[sr@ijekavian]": "Прикључак за гзип",
+ "Name[sr@ijekavianlatin]": "Priključak za gzip",
+ "Name[sr@latin]": "Priključak za gzip",
+ "Name[sr]": "Прикључак за гзип",
+ "Name[sv]": "Gzip-insticksprogram",
+ "Name[tr]": "Gzip eklentisi",
+ "Name[uk]": "Додаток gzip",
+ "Name[x-test]": "xxGzip pluginxx",
+ "Name[zh_CN]": "Gzip 插件",
+ "Name[zh_TW]": "Gzip 外掛程式",
"ServiceTypes": [
"Kerfuffle/Plugin"
- ],
+ ],
"Version": "@KDE_APPLICATIONS_VERSION@"
- },
+ },
"X-KDE-Priority": 100
}
diff -Nru ark-16.12.3/plugins/libsinglefileplugin/kerfuffle_libxz.json.cmake ark-17.04.3/plugins/libsinglefileplugin/kerfuffle_libxz.json.cmake
--- ark-16.12.3/plugins/libsinglefileplugin/kerfuffle_libxz.json.cmake 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libsinglefileplugin/kerfuffle_libxz.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -1,46 +1,63 @@
{
"KPlugin": {
- "Description": "libxz plugin for Kerfuffle",
- "Description[ca@valencia]": "Connector del libxz pel Kerfuffle",
- "Description[ca]": "Connector del libxz pel Kerfuffle",
- "Description[cs]": "modul libxz pro Kerfuffle",
- "Description[de]": "libxz-Modul für Kerfuffle",
- "Description[es]": "Complemento libxz para Kerfuffle",
- "Description[et]": "Kerfuffle'i libxz plugin",
- "Description[eu]": "Kerfuffle-rentzako libxz plugina",
- "Description[fi]": "libxz-pakkaustuki",
- "Description[fr]": "Module externe « libxz » pour Kerfuffle",
- "Description[gl]": "Complemento de libxz para Kerfuffle",
- "Description[it]": "Estensione libxz per Kerfuffle",
- "Description[ko]": "Kerfuffle을 위한 libxz 플러그인",
- "Description[nl]": "libxz plug-in voor Kerfuffle",
- "Description[nn]": "libxz-tillegg til Kerfuffle",
- "Description[pl]": "wtyczka libxz dla Kerfuffle",
- "Description[pt]": "'Plugin' de libxz para o Kerfuffle",
- "Description[pt_BR]": "Plugin libxz para o Kerfuffle",
- "Description[ru]": "Модуль libxz для Kerfuffle",
- "Description[sk]": "libxz modul pre Kerfuffle",
- "Description[sl]": "Vstavek libxz za Kerfuffle",
- "Description[sr@ijekavian]": "Прикључак libxz за Керфафл",
- "Description[sr@ijekavianlatin]": "Priključak libxz za Kerfuffle",
- "Description[sr@latin]": "Priključak libxz za Kerfuffle",
- "Description[sr]": "Прикључак libxz за Керфафл",
- "Description[sv]": "Libxz-insticksprogram för Kerfuffle",
- "Description[uk]": "Додаток libxz для Kerfuffle",
- "Description[x-test]": "xxlibxz plugin for Kerfufflexx",
- "Description[zh_CN]": "Kerfuffle 的 libxz 插件",
- "Description[zh_TW]": "Kerfuffle 的 libxz 外掛程式",
- "Id": "kerfuffle_libxz",
+ "Description": "Open and extract single files compressed with the lzma algorithm",
+ "Description[ca@valencia]": "Obri i extreu fitxers individuals comprimits amb l'algorisme «lzma»",
+ "Description[ca]": "Obre i extreu fitxers individuals comprimits amb l'algorisme «lzma»",
+ "Description[cs]": "Otevřít a rozbalit jednotlivé soubory komprimované algoritmem lzma",
+ "Description[de]": "Öffnen und Entpacken von einzelnen mit dem LZMA-Algorithmus komprimierten Dateien",
+ "Description[el]": "Άνοιγμα και εξαγωγή απλών αρχείων συμπιεσμένα με τον αλγόριθμο Izma",
+ "Description[es]": "Abrir y extraer archivos individuales comprimidos con el algoritmo lzma",
+ "Description[eu]": "Ireki eta erauzi lzma algoritmoarekin konprimatutako fitxategiak banaka",
+ "Description[fr]": "Ouvre et extrait des fichiers compressés avec l'algorithme lzma",
+ "Description[it]": "Apri ed estrai singoli file compressi con l'algoritmo lzma",
+ "Description[nl]": "Open en pak uit losse bestanden gecomprimeerd met het lzma-algoritme",
+ "Description[pl]": "Otwieraj i wypakowuj pojedyncze pliki spakowane algorytmem lzma",
+ "Description[pt]": "Abrir e extrair ficheiros individuais comprimidos com o algoritmo LZMA",
+ "Description[sk]": "Otvorenie a extrahovanie jednotlivých súborov komprimovaných algoritmom lzma",
+ "Description[sl]": "Odprite in razširite datoteke stisnjene z algoritmom lzma",
+ "Description[sr@ijekavian]": "Отварање и распакивање појединачних фајлова компресованих алгоритмом ЛЗМА",
+ "Description[sr@ijekavianlatin]": "Otvaranje i raspakivanje pojedinačnih fajlova kompresovanih algoritmom LZMA",
+ "Description[sr@latin]": "Otvaranje i raspakivanje pojedinačnih fajlova kompresovanih algoritmom LZMA",
+ "Description[sr]": "Отварање и распакивање појединачних фајлова компресованих алгоритмом ЛЗМА",
+ "Description[sv]": "Öppna och packa upp enstaka filer komprimerade med lzma-algoritmen",
+ "Description[tr]": "Lzma algoritması ile sıkıştırılmış tek dosyaları açma ve çıkarma",
+ "Description[uk]": "Здатен відкривати і видобувати дані із окремих файлів, стиснених за допомогою алгоритму lzma",
+ "Description[x-test]": "xxOpen and extract single files compressed with the lzma algorithmxx",
+ "Description[zh_CN]": "打开和解压 lzma 算法压缩的单个文件",
+ "Description[zh_TW]": "開啟並解壓縮以 lzma 演算法壓縮的單一檔案",
+ "Id": "kerfuffle_libxz",
"MimeTypes": [
"@SUPPORTED_MIMETYPES@"
- ],
- "Name": "kerfuffle_libxz",
- "Name[sv]": "Kerfuffle Libxz",
- "Name[x-test]": "xxkerfuffle_libxzxx",
+ ],
+ "Name": "LZMA plugin",
+ "Name[ca@valencia]": "Connector del LZMA",
+ "Name[ca]": "Connector del LZMA",
+ "Name[cs]": "Modul pro LZMA",
+ "Name[de]": "LZMA-Modul",
+ "Name[el]": "Πρόσθετο LZMA",
+ "Name[es]": "Complemento LZMA",
+ "Name[eu]": "LZMA plugina",
+ "Name[fr]": "Module externe LZMA",
+ "Name[it]": "Estensione LZMA",
+ "Name[nl]": "LZMA-plug-in",
+ "Name[pl]": "Wtyczka LZMA",
+ "Name[pt]": "'Plugin' do LZMA",
+ "Name[sk]": "Plugin LZMA",
+ "Name[sl]": "Vstavek LZMA",
+ "Name[sr@ijekavian]": "Прикључак за ЛЗМА",
+ "Name[sr@ijekavianlatin]": "Priključak za LZMA",
+ "Name[sr@latin]": "Priključak za LZMA",
+ "Name[sr]": "Прикључак за ЛЗМА",
+ "Name[sv]": "LZMA-insticksprogram",
+ "Name[tr]": "LZMA eklentisi",
+ "Name[uk]": "Додаток LZMA",
+ "Name[x-test]": "xxLZMA pluginxx",
+ "Name[zh_CN]": "LZMA 插件",
+ "Name[zh_TW]": "LZMA 外掛程式",
"ServiceTypes": [
"Kerfuffle/Plugin"
- ],
+ ],
"Version": "@KDE_APPLICATIONS_VERSION@"
- },
+ },
"X-KDE-Priority": 100
}
diff -Nru ark-16.12.3/plugins/libsinglefileplugin/singlefileplugin.cpp ark-17.04.3/plugins/libsinglefileplugin/singlefileplugin.cpp
--- ark-16.12.3/plugins/libsinglefileplugin/singlefileplugin.cpp 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libsinglefileplugin/singlefileplugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -25,8 +25,7 @@
#include "singlefileplugin.h"
#include "ark_debug.h"
-#include "kerfuffle/archiveentry.h"
-#include "kerfuffle/queries.h"
+#include "queries.h"
#include
#include
diff -Nru ark-16.12.3/plugins/libsinglefileplugin/singlefileplugin.h ark-17.04.3/plugins/libsinglefileplugin/singlefileplugin.h
--- ark-16.12.3/plugins/libsinglefileplugin/singlefileplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libsinglefileplugin/singlefileplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -26,8 +26,7 @@
#ifndef SINGLEFILEPLUGIN_H
#define SINGLEFILEPLUGIN_H
-#include "kerfuffle/archiveinterface.h"
-#include "kerfuffle/archiveentry.h"
+#include "archiveinterface.h"
class LibSingleFileInterface : public Kerfuffle::ReadOnlyArchiveInterface
{
@@ -35,11 +34,11 @@
public:
LibSingleFileInterface(QObject *parent, const QVariantList & args);
- virtual ~LibSingleFileInterface();
+ ~LibSingleFileInterface() override;
- virtual bool list() Q_DECL_OVERRIDE;
- virtual bool testArchive() Q_DECL_OVERRIDE;
- virtual bool extractFiles(const QVector &files, const QString &destinationDirectory, const Kerfuffle::ExtractionOptions &options) Q_DECL_OVERRIDE;
+ bool list() override;
+ bool testArchive() override;
+ bool extractFiles(const QVector &files, const QString &destinationDirectory, const Kerfuffle::ExtractionOptions &options) override;
protected:
const QString uncompressedFileName() const;
diff -Nru ark-16.12.3/plugins/libsinglefileplugin/xzplugin.h ark-17.04.3/plugins/libsinglefileplugin/xzplugin.h
--- ark-16.12.3/plugins/libsinglefileplugin/xzplugin.h 2017-03-05 08:02:38.000000000 +0000
+++ ark-17.04.3/plugins/libsinglefileplugin/xzplugin.h 2017-07-09 22:45:29.000000000 +0000
@@ -34,7 +34,7 @@
public:
LibXzInterface(QObject *parent, const QVariantList & args);
- virtual ~LibXzInterface();
+ ~LibXzInterface() override;
};
#endif // XZPLUGIN_H
diff -Nru ark-16.12.3/plugins/libzipplugin/CMakeLists.txt ark-17.04.3/plugins/libzipplugin/CMakeLists.txt
--- ark-16.12.3/plugins/libzipplugin/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/plugins/libzipplugin/CMakeLists.txt 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,29 @@
+include_directories(${LibZip_INCLUDE_DIRS})
+
+set(SUPPORTED_LIBZIP_MIMETYPES "application/zip;")
+
+set(INSTALLED_LIBZIP_PLUGINS "")
+
+set(kerfuffle_libzip_SRCS libzipplugin.cpp ark_debug.cpp)
+
+ecm_qt_declare_logging_category(kerfuffle_libzip_SRCS
+ HEADER ark_debug.h
+ IDENTIFIER ARK
+ CATEGORY_NAME ark.libzip)
+
+# NOTE: the first double-quotes of the first mime and the last
+# double-quotes of the last mime must NOT be escaped.
+set(SUPPORTED_MIMETYPES "application/zip")
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/kerfuffle_libzip.json.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/kerfuffle_libzip.json)
+
+kerfuffle_add_plugin(kerfuffle_libzip ${kerfuffle_libzip_SRCS})
+
+target_link_libraries(kerfuffle_libzip ${LibZip_LIBRARIES})
+
+set(INSTALLED_LIBZIP_PLUGINS "${INSTALLED_LIBZIP_PLUGINS}kerfuffle_libzip;")
+
+set(SUPPORTED_ARK_MIMETYPES "${SUPPORTED_ARK_MIMETYPES}${SUPPORTED_LIBZIP_MIMETYPES}" PARENT_SCOPE)
+set(INSTALLED_KERFUFFLE_PLUGINS "${INSTALLED_KERFUFFLE_PLUGINS}${INSTALLED_LIBZIP_PLUGINS}" PARENT_SCOPE)
diff -Nru ark-16.12.3/plugins/libzipplugin/kerfuffle_libzip.json.cmake ark-17.04.3/plugins/libzipplugin/kerfuffle_libzip.json.cmake
--- ark-16.12.3/plugins/libzipplugin/kerfuffle_libzip.json.cmake 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/plugins/libzipplugin/kerfuffle_libzip.json.cmake 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,71 @@
+{
+ "KPlugin": {
+ "Description": "Full support for the zip archive format",
+ "Description[ca@valencia]": "Implementació completa del format d'arxiu ZIP",
+ "Description[ca]": "Implementació completa del format d'arxiu ZIP",
+ "Description[cs]": "Plná podpora archivačního formátu zip",
+ "Description[de]": "Vollständige Unterstützung für Zip-Archivformate",
+ "Description[es]": "Uso total del formato de archivo comprimido zip",
+ "Description[eu]": "Zip artxibo formatuarentzako euskarri osoa",
+ "Description[it]": "Supporto completo per il formato di archivi ZIP",
+ "Description[nl]": "Volledige ondersteuning voor het zip-archiefformaat",
+ "Description[pl]": "Pełna obsługa dla formatów archiwów zip",
+ "Description[pt]": "Suporte total para o formato de pacotes ZIP",
+ "Description[sk]": "Plná podpora pre archívny formát zip",
+ "Description[sl]": "Polna podpora za arhive vrste zip",
+ "Description[sr@ijekavian]": "Пуна подршка за архивски формат ЗИП",
+ "Description[sr@ijekavianlatin]": "Puna podrška za arhivski format ZIP",
+ "Description[sr@latin]": "Puna podrška za arhivski format ZIP",
+ "Description[sr]": "Пуна подршка за архивски формат ЗИП",
+ "Description[sv]": "Fullt stöd för arkivformatet zip",
+ "Description[tr]": "Zip arşivi biçimi için tam destek",
+ "Description[uk]": "Повноцінна підтримка архівів у форматі zip",
+ "Description[x-test]": "xxFull support for the zip archive formatxx",
+ "Description[zh_CN]": "完全支持 zip 归档格式",
+ "Description[zh_TW]": "對 zip 壓縮檔格式的完整支援",
+ "Id": "kerfuffle_libzip",
+ "MimeTypes": [
+ "@SUPPORTED_MIMETYPES@"
+ ],
+ "Name": "Libzip plugin",
+ "Name[ca@valencia]": "Connector del Libzip",
+ "Name[ca]": "Connector del Libzip",
+ "Name[cs]": "Modul pro libzip",
+ "Name[de]": "Libzip-Modul",
+ "Name[es]": "Complemento Libzip",
+ "Name[eu]": "Libzip plugina",
+ "Name[it]": "Estensione Libzip",
+ "Name[nl]": "Libzip-plug-in",
+ "Name[pl]": "Wtyczka libzip",
+ "Name[pt]": "'Plugin' da Libzip",
+ "Name[sk]": "Plugin Libzip",
+ "Name[sl]": "Vstavek Libzip",
+ "Name[sr@ijekavian]": "Прикључак за Либзип",
+ "Name[sr@ijekavianlatin]": "Priključak za libzip",
+ "Name[sr@latin]": "Priključak za libzip",
+ "Name[sr]": "Прикључак за Либзип",
+ "Name[sv]": "Libzip-insticksprogram",
+ "Name[tr]": "Libzip eklentisi",
+ "Name[uk]": "Додаток libzip",
+ "Name[x-test]": "xxLibzip pluginxx",
+ "Name[zh_CN]": "Libzip 插件",
+ "Name[zh_TW]": "Libzip 外掛程式",
+ "ServiceTypes": [
+ "Kerfuffle/Plugin"
+ ],
+ "Version": "@KDE_APPLICATIONS_VERSION@"
+ },
+ "X-KDE-Kerfuffle-ReadWrite": true,
+ "X-KDE-Priority": 200,
+ "application/zip": {
+ "Encryption": true,
+ "EncryptionMethodDefault": "AES256",
+ "EncryptionMethods": [
+ "AES256",
+ "AES192",
+ "AES128"
+ ],
+ "SupportsTesting": true,
+ "SupportsWriteComment": true
+ }
+}
diff -Nru ark-16.12.3/plugins/libzipplugin/libzipplugin.cpp ark-17.04.3/plugins/libzipplugin/libzipplugin.cpp
--- ark-16.12.3/plugins/libzipplugin/libzipplugin.cpp 1970-01-01 00:00:00.000000000 +0000
+++ ark-17.04.3/plugins/libzipplugin/libzipplugin.cpp 2017-07-09 22:45:29.000000000 +0000
@@ -0,0 +1,761 @@
+/*
+ * Copyright (c) 2017 Ragnar Thomsen
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "libzipplugin.h"
+#include "ark_debug.h"
+#include "queries.h"
+
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+K_PLUGIN_FACTORY_WITH_JSON(LibZipPluginFactory, "kerfuffle_libzip.json", registerPlugin();)
+
+// This is needed for hooking a C callback to a C++ non-static member
+// function.
+template
+struct Callback;
+template