Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/kpropertiesdialog_p.h
| Context not available. | |||||
| 30 | 30 | | |||
|---|---|---|---|---|---|
| 31 | #include "kpropertiesdialog.h" | 31 | #include "kpropertiesdialog.h" | ||
| 32 | 32 | | |||
| 33 | #include <utility> | ||||
| 33 | #include <QCryptographicHash> | 34 | #include <QCryptographicHash> | ||
| 34 | 35 | | |||
| 36 | class QPushButton; | ||||
| 35 | class QComboBox; | 37 | class QComboBox; | ||
| 36 | class QLabel; | 38 | class QLabel; | ||
| 37 | 39 | | |||
| Context not available. | |||||
| 173 | 175 | | |||
| 174 | private Q_SLOTS: | 176 | private Q_SLOTS: | ||
| 175 | void slotInvalidateCache(); | 177 | void slotInvalidateCache(); | ||
| 176 | void slotShowMd5(); | 178 | | ||
| 177 | void slotShowSha1(); | | |||
| 178 | void slotShowSha256(); | | |||
| 179 | /** | 179 | /** | ||
| 180 | * Compare @p input (required to be lowercase) with the checksum in cache. | 180 | * Compare @p input (required to be lowercase) with the checksum in cache. | ||
| 181 | */ | 181 | */ | ||
| 182 | void slotVerifyChecksum(const QString &input); | 182 | void slotVerifyChecksum(const QString &input); | ||
| 183 | 183 | | |||
| 184 | private: | 184 | private: | ||
| 185 | static bool isMd5(const QString &input); | 185 | void verifyChecksums(const QString input, QVector<QCryptographicHash::Algorithm> algorithms); | ||
| 186 | static bool isSha1(const QString &input); | 186 | | ||
| 187 | static bool isSha256(const QString &input); | | |||
| 188 | static QString computeChecksum(QCryptographicHash::Algorithm algorithm, const QString &path); | 187 | static QString computeChecksum(QCryptographicHash::Algorithm algorithm, const QString &path); | ||
| 189 | static QCryptographicHash::Algorithm detectAlgorithm(const QString &input); | 188 | static QVector<QCryptographicHash::Algorithm> detectAlgorithms(const QString &input); | ||
| 190 | 189 | | |||
| 191 | void setDefaultState(); | 190 | void setDefaultState(); | ||
| 192 | void setInvalidChecksumState(); | 191 | void setInvalidChecksumState(); | ||
| 193 | void setMatchState(); | 192 | void setMatchState(); | ||
| 194 | void setMismatchState(); | 193 | void setMismatchState(); | ||
| 195 | void setVerifyState(); | 194 | void setVerifyState(); | ||
| 196 | void showChecksum(QCryptographicHash::Algorithm algorithm, QLabel *label, QPushButton *copyButton); | 195 | void showChecksum(QCryptographicHash::Algorithm algorithm); | ||
| 196 | void showMatchedChecksum(); | ||||
| 197 | | ||||
| 198 | void writeDefaultAlgorithm(QCryptographicHash::Algorithm algorithm); | ||||
| 199 | QCryptographicHash::Algorithm readDefaultAlgorithm() const; | ||||
| 200 | | ||||
| 201 | void setAlgorithm(QCryptographicHash::Algorithm algorithm); | ||||
| 202 | QCryptographicHash::Algorithm algorithm() const; | ||||
| 197 | 203 | | |||
| 198 | QString cachedChecksum(QCryptographicHash::Algorithm algorithm) const; | 204 | QString cachedChecksum(QCryptographicHash::Algorithm algorithm) const; | ||
| 199 | void cacheChecksum(const QString &checksum, QCryptographicHash::Algorithm algorithm); | 205 | void cacheChecksum(const QString &checksum, QCryptographicHash::Algorithm algorithm); | ||
| Context not available. | |||||