From 3ee5a39a6b787294164b114122b923970ca6b69c Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Thu, 6 Oct 2022 19:57:07 +0300 Subject: [PATCH] ark: report the actual error from libarchive plugin Signed-off-by: Ivailo Monev --- ark/plugins/libarchive/libarchivehandler.cpp | 13 +++++-------- ark/plugins/libarchive/libarchivehandler.h | 3 +-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/ark/plugins/libarchive/libarchivehandler.cpp b/ark/plugins/libarchive/libarchivehandler.cpp index 77bdd760..47ef8319 100644 --- a/ark/plugins/libarchive/libarchivehandler.cpp +++ b/ark/plugins/libarchive/libarchivehandler.cpp @@ -1,7 +1,5 @@ /* - * Copyright (c) 2007 Henrique Pinto - * Copyright (c) 2008-2009 Harald Hvaal - * Copyright (c) 2010 Raphael Kubo da Costa + * Copyright (C) 2022 Ivailo Monev * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -50,7 +48,7 @@ bool LibArchiveInterface::list() { KArchive karchive(filename()); if (!karchive.isReadable()) { - emit error(i18nc("@info", "Could not open the archive %1, libarchive cannot handle it.", filename())); + emit error(i18nc("@info", "Could not open the archive %1: %2.", filename(), karchive.errorString())); return false; } @@ -82,7 +80,7 @@ bool LibArchiveInterface::copyFiles(const QVariantList& files, const QString &de KArchive karchive(filename()); if (!karchive.isReadable()) { - emit error(i18nc("@info", "Could not open the archive %1, libarchive cannot handle it.", filename())); + emit error(i18nc("@info", "Could not open the archive %1: %2.", filename(), karchive.errorString())); return false; } @@ -120,8 +118,7 @@ bool LibArchiveInterface::addFiles(const QStringList &files, const CompressionOp KArchive karchive(filename()); if (!karchive.isWritable()) { - emit error(i18nc("@info", "Could not open the archive %1, libarchive cannot handle it.", - filename())); + emit error(i18nc("@info", "Could not open the archive %1: %2.", filename(), karchive.errorString())); return false; } @@ -139,7 +136,7 @@ bool LibArchiveInterface::deleteFiles(const QVariantList &files) { KArchive karchive(filename()); if (!karchive.isWritable()) { - emit error(i18nc("@info", "Could not open the archive %1, libarchive cannot handle it.", filename())); + emit error(i18nc("@info", "Could not open the archive %1: %2.", filename(), karchive.errorString())); return false; } diff --git a/ark/plugins/libarchive/libarchivehandler.h b/ark/plugins/libarchive/libarchivehandler.h index 5d779ec9..fcecce36 100644 --- a/ark/plugins/libarchive/libarchivehandler.h +++ b/ark/plugins/libarchive/libarchivehandler.h @@ -1,6 +1,5 @@ /* - * Copyright (c) 2007 Henrique Pinto - * Copyright (c) 2008-2009 Harald Hvaal + * Copyright (C) 2022 Ivailo Monev * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions -- 2.11.0