Changeset View
Changeset View
Standalone View
Standalone View
kerfuffle/jobs.cpp
Show All 26 Lines | |||||
27 | */ | 27 | */ | ||
28 | 28 | | |||
29 | #include "jobs.h" | 29 | #include "jobs.h" | ||
30 | #include "archiveentry.h" | 30 | #include "archiveentry.h" | ||
31 | #include "ark_debug.h" | 31 | #include "ark_debug.h" | ||
32 | 32 | | |||
33 | #include <QDir> | 33 | #include <QDir> | ||
34 | #include <QDirIterator> | 34 | #include <QDirIterator> | ||
35 | #include <QFileInfo> | 35 | #include <QFileInfo> | ||
36 | #include <QRegularExpression> | | |||
37 | #include <QThread> | 36 | #include <QThread> | ||
rthomsen: This can be removed now. | |||||
38 | #include <QTimer> | 37 | #include <QTimer> | ||
39 | #include <QUrl> | 38 | #include <QUrl> | ||
40 | 39 | | |||
41 | #include <KFileUtils> | 40 | #include <KFileUtils> | ||
42 | #include <KLocalizedString> | 41 | #include <KLocalizedString> | ||
43 | 42 | | |||
44 | namespace Kerfuffle | 43 | namespace Kerfuffle | ||
45 | { | 44 | { | ||
▲ Show 20 Lines • Show All 268 Lines • ▼ Show 20 Line(s) | 310 | { | |||
314 | 313 | | |||
315 | if (entry->isDir()) { | 314 | if (entry->isDir()) { | ||
316 | m_dirCount++; | 315 | m_dirCount++; | ||
317 | } else { | 316 | } else { | ||
318 | m_filesCount++; | 317 | m_filesCount++; | ||
319 | } | 318 | } | ||
320 | 319 | | |||
321 | if (m_isSingleFolderArchive) { | 320 | if (m_isSingleFolderArchive) { | ||
321 | QString fullPath = entry->fullPath(); | ||||
322 | // RPM filenames have the ./ prefix, and "." would be detected as the subfolder name, so we remove it. | 322 | // RPM filenames have the ./ prefix, and "." would be detected as the subfolder name, so we remove it. | ||
323 | const QString fullPath = entry->fullPath().remove(QRegularExpression(QStringLiteral("^\\./"))); | 323 | if (fullPath.startsWith(QLatin1String("./"))) { | ||
324 | fullPath = fullPath.remove(0, 2); | ||||
325 | } | ||||
326 | | ||||
rthomsen: QLatin1String is more efficient than QStringLiteral in this case, right? | |||||
324 | const QString basePath = fullPath.split(QLatin1Char('/')).at(0); | 327 | const QString basePath = fullPath.split(QLatin1Char('/')).at(0); | ||
325 | 328 | | |||
326 | if (m_basePath.isEmpty()) { | 329 | if (m_basePath.isEmpty()) { | ||
327 | m_basePath = basePath; | 330 | m_basePath = basePath; | ||
328 | m_subfolderName = basePath; | 331 | m_subfolderName = basePath; | ||
329 | } else { | 332 | } else { | ||
330 | if (m_basePath != basePath) { | 333 | if (m_basePath != basePath) { | ||
331 | m_isSingleFolderArchive = false; | 334 | m_isSingleFolderArchive = false; | ||
▲ Show 20 Lines • Show All 522 Lines • Show Last 20 Lines |
This can be removed now.