Changeset View
Changeset View
Standalone View
Standalone View
krArc/krarcbasemanager.cpp
Context not available. | |||||
34 | int KrArcBaseManager::autoDetectElems = sizeof(autoDetectParams) / sizeof(AutoDetectParams); | 34 | int KrArcBaseManager::autoDetectElems = sizeof(autoDetectParams) / sizeof(AutoDetectParams); | ||
---|---|---|---|---|---|
35 | const int KrArcBaseManager::maxLenType = 5; | 35 | const int KrArcBaseManager::maxLenType = 5; | ||
36 | 36 | | |||
37 | //! Checks if a returned status ("exit code") of an archiving-related process is OK | ||||
38 | /*! | ||||
39 | \param arcType A short QString which contains an identifier of the type of the archive. | ||||
40 | \param exitCode The returned status ("exit code") of an archiving-related process. | ||||
41 | \return If the exit code means that the archiving-related process ended without errors. | ||||
42 | */ | ||||
43 | bool KrArcBaseManager::checkStatus(const QString &arcType, int exitCode) | ||||
44 | { | ||||
45 | if (arcType == "zip" || arcType == "rar" || arcType == "7z") | ||||
46 | return exitCode == 0 || exitCode == 1; | ||||
47 | else if (arcType == "ace" || arcType == "bzip2" || arcType == "lha" || arcType == "rpm" || arcType == "cpio" || | ||||
48 | arcType == "tar" || arcType == "tarz" || arcType == "tbz" || arcType == "tgz" || arcType == "arj" || | ||||
49 | arcType == "deb" || arcType == "tlz" || arcType == "txz") | ||||
50 | return exitCode == 0; | ||||
51 | else if (arcType == "gzip" || arcType == "lzma" || arcType == "xz") | ||||
52 | return exitCode == 0 || exitCode == 2; | ||||
53 | else | ||||
54 | return exitCode == 0; | ||||
55 | } | ||||
56 | | ||||
37 | QString KrArcBaseManager::detectArchive(bool &encrypted, QString fileName, bool checkEncrypted, bool fast) | 57 | QString KrArcBaseManager::detectArchive(bool &encrypted, QString fileName, bool checkEncrypted, bool fast) | ||
38 | { | 58 | { | ||
39 | encrypted = false; | 59 | encrypted = false; | ||
Context not available. |