Changeset View
Changeset View
Standalone View
Standalone View
part/archivemodel.cpp
Show First 20 Lines • Show All 335 Lines • ▼ Show 20 Line(s) | 301 | { | |||
---|---|---|---|---|---|
336 | return true; | 336 | return true; | ||
337 | } | 337 | } | ||
338 | 338 | | |||
339 | // For a rationale, see bugs #194241, #241967 and #355839 | 339 | // For a rationale, see bugs #194241, #241967 and #355839 | ||
340 | QString ArchiveModel::cleanFileName(const QString& fileName) | 340 | QString ArchiveModel::cleanFileName(const QString& fileName) | ||
341 | { | 341 | { | ||
342 | // Skip entries with filename "/" or "//" or "." | 342 | // Skip entries with filename "/" or "//" or "." | ||
343 | // "." is present in ISO files. | 343 | // "." is present in ISO files. | ||
344 | QRegularExpression pattern(QStringLiteral("/+|\\.")); | 344 | | ||
345 | QRegularExpressionMatch match; | 345 | if (fileName == QStringLiteral("/") || fileName == QStringLiteral("//") || fileName == QStringLiteral(".")) { | ||
346 | if (fileName.contains(pattern, &match) && match.captured() == fileName) { | | |||
347 | qCDebug(ARK) << "Skipping entry with filename" << fileName; | | |||
elvisangelaccio: Why remove the debug line though? | |||||
348 | return QString(); | 346 | return QString(); | ||
349 | } else if (fileName.startsWith(QLatin1String("./"))) { | 347 | } | ||
348 | | ||||
349 | if (fileName.startsWith(QLatin1String("./"))) { | ||||
350 | return fileName.mid(2); | 350 | return fileName.mid(2); | ||
351 | } | 351 | } | ||
352 | 352 | | |||
353 | return fileName; | 353 | return fileName; | ||
354 | } | 354 | } | ||
355 | 355 | | |||
356 | void ArchiveModel::initRootEntry() | 356 | void ArchiveModel::initRootEntry() | ||
357 | { | 357 | { | ||
▲ Show 20 Lines • Show All 564 Lines • Show Last 20 Lines |
Why remove the debug line though?