Changeset View
Changeset View
Standalone View
Standalone View
krArc/krarcbasemanager.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 51 | else if (arcType == "ace" || arcType == "bzip2" || arcType == "lha" || arcType == "rpm" || arcType == "cpio" || | |||
---|---|---|---|---|---|
53 | arcType == "deb" || arcType == "tlz" || arcType == "txz") | 53 | arcType == "deb" || arcType == "tlz" || arcType == "txz") | ||
54 | return exitCode == 0; | 54 | return exitCode == 0; | ||
55 | else if (arcType == "gzip" || arcType == "lzma" || arcType == "xz") | 55 | else if (arcType == "gzip" || arcType == "lzma" || arcType == "xz") | ||
56 | return exitCode == 0 || exitCode == 2; | 56 | return exitCode == 0 || exitCode == 2; | ||
57 | else | 57 | else | ||
58 | return exitCode == 0; | 58 | return exitCode == 0; | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | QString KrArcBaseManager::detectArchive(bool &encrypted, QString fileName, bool checkEncrypted, bool fast) | 61 | QString KrArcBaseManager::detectArchive(bool &encrypted, const QString& fileName, bool checkEncrypted, bool fast) | ||
62 | { | 62 | { | ||
63 | encrypted = false; | 63 | encrypted = false; | ||
64 | 64 | | |||
65 | QFile arcFile(fileName); | 65 | QFile arcFile(fileName); | ||
66 | if (arcFile.open(QIODevice::ReadOnly)) { | 66 | if (arcFile.open(QIODevice::ReadOnly)) { | ||
67 | char buffer[ 1024 ]; | 67 | char buffer[ 1024 ]; | ||
68 | long sizeMax = arcFile.read(buffer, sizeof(buffer)); | 68 | long sizeMax = arcFile.read(buffer, sizeof(buffer)); | ||
69 | arcFile.close(); | 69 | arcFile.close(); | ||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |