mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kutils: assume that KArchive::list() filtered the entries when recursing
the conditionals were there to maybe match with and without trailing slash but KArchive::list() works correctly for the fomats that do not add trailing slash to directories aswell Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
0cbc869f50
commit
55432743c0
1 changed files with 2 additions and 6 deletions
|
@ -744,9 +744,7 @@ bool KArchive::remove(const QStringList &paths) const
|
|||
if (path.endsWith(QLatin1Char('/')) || S_ISDIR(KArchive::entry(path).mode)) {
|
||||
const QByteArray pathbytes = QFile::encodeName(path);
|
||||
foreach (const KArchiveEntry &karchiveentry, KArchive::list(path)) {
|
||||
if (karchiveentry.pathname.startsWith(pathbytes)) {
|
||||
recursivepaths.append(QFile::decodeName(karchiveentry.pathname));
|
||||
}
|
||||
recursivepaths.append(QFile::decodeName(karchiveentry.pathname));
|
||||
}
|
||||
} else {
|
||||
recursivepaths << path;
|
||||
|
@ -873,9 +871,7 @@ bool KArchive::extract(const QStringList &paths, const QString &destination, con
|
|||
if (path.endsWith(QLatin1Char('/')) || S_ISDIR(KArchive::entry(path).mode)) {
|
||||
const QByteArray pathbytes = QFile::encodeName(path);
|
||||
foreach (const KArchiveEntry &karchiveentry, KArchive::list(path)) {
|
||||
if (karchiveentry.pathname.startsWith(pathbytes)) {
|
||||
recursivepaths.append(QFile::decodeName(karchiveentry.pathname));
|
||||
}
|
||||
recursivepaths.append(QFile::decodeName(karchiveentry.pathname));
|
||||
}
|
||||
} else {
|
||||
recursivepaths << path;
|
||||
|
|
Loading…
Add table
Reference in a new issue