Changeset View
Changeset View
Standalone View
Standalone View
krusader/Dialogs/checksumdlg.h
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | |||||
54 | namespace CHECKSUM_ { // private namespace | 54 | namespace CHECKSUM_ { // private namespace | ||
55 | 55 | | |||
56 | /** Wrapper for KProcess to handle errors and output. */ | 56 | /** Wrapper for KProcess to handle errors and output. */ | ||
57 | class ChecksumProcess : public KProcess | 57 | class ChecksumProcess : public KProcess | ||
58 | { | 58 | { | ||
59 | Q_OBJECT | 59 | Q_OBJECT | ||
60 | public: | 60 | public: | ||
61 | ChecksumProcess(QObject *parent, const QString &path); | 61 | ChecksumProcess(QObject *parent, const QString &path); | ||
62 | ~ChecksumProcess(); | 62 | ~ChecksumProcess() override; | ||
63 | 63 | | |||
64 | QStringList stdOutput() const { return m_outputLines; } | 64 | QStringList stdOutput() const { return m_outputLines; } | ||
65 | QStringList errOutput() const { return m_errorLines; } | 65 | QStringList errOutput() const { return m_errorLines; } | ||
66 | 66 | | |||
67 | signals: | 67 | signals: | ||
68 | void resultReady(); | 68 | void resultReady(); | ||
69 | 69 | | |||
70 | private slots: | 70 | private slots: | ||
71 | void slotError(QProcess::ProcessError error); | 71 | void slotError(QProcess::ProcessError error); | ||
72 | void slotFinished(int, QProcess::ExitStatus exitStatus); | 72 | void slotFinished(int, QProcess::ExitStatus exitStatus); | ||
73 | 73 | | |||
74 | private: | 74 | private: | ||
75 | QStringList m_outputLines; | 75 | QStringList m_outputLines; | ||
76 | QStringList m_errorLines; | 76 | QStringList m_errorLines; | ||
77 | QTemporaryFile m_tmpOutFile; | 77 | QTemporaryFile m_tmpOutFile; | ||
78 | QTemporaryFile m_tmpErrFile; | 78 | QTemporaryFile m_tmpErrFile; | ||
79 | }; | 79 | }; | ||
80 | 80 | | |||
81 | /** Base class for common code in creation and verify wizard. */ | 81 | /** Base class for common code in creation and verify wizard. */ | ||
82 | class ChecksumWizard : public QWizard | 82 | class ChecksumWizard : public QWizard | ||
83 | { | 83 | { | ||
84 | Q_OBJECT | 84 | Q_OBJECT | ||
85 | public: | 85 | public: | ||
86 | explicit ChecksumWizard(const QString &path); | 86 | explicit ChecksumWizard(const QString &path); | ||
87 | virtual ~ChecksumWizard(); | 87 | ~ChecksumWizard() override; | ||
88 | 88 | | |||
89 | private slots: | 89 | private slots: | ||
90 | void slotCurrentIdChanged(int id); | 90 | void slotCurrentIdChanged(int id); | ||
91 | 91 | | |||
92 | protected: | 92 | protected: | ||
93 | virtual QWizardPage *createIntroPage() = 0; | 93 | virtual QWizardPage *createIntroPage() = 0; | ||
94 | virtual QWizardPage *createResultPage() = 0; | 94 | virtual QWizardPage *createResultPage() = 0; | ||
95 | 95 | | |||
96 | virtual void onIntroPage() = 0; | 96 | virtual void onIntroPage() = 0; | ||
97 | virtual void onProgressPage() = 0; | 97 | virtual void onProgressPage() = 0; | ||
98 | virtual void onResultPage() = 0; | 98 | virtual void onResultPage() = 0; | ||
99 | 99 | | |||
100 | QWizardPage *createProgressPage(const QString &title); | 100 | QWizardPage *createProgressPage(const QString &title); | ||
101 | 101 | | |||
102 | bool checkExists(const QString type); | 102 | bool checkExists(const QString& type); | ||
103 | void runProcess(const QString &type, const QStringList &args); | 103 | void runProcess(const QString &type, const QStringList &args); | ||
104 | void addChecksumLine(KrTreeWidget *tree, const QString &line); | 104 | void addChecksumLine(KrTreeWidget *tree, const QString &line); | ||
105 | 105 | | |||
106 | const QString m_path; | 106 | const QString m_path; | ||
107 | ChecksumProcess *m_process; | 107 | ChecksumProcess *m_process; | ||
108 | 108 | | |||
109 | QMap<QString, QString> m_checksumTools; // extension/typ-name -> binary name | 109 | QMap<QString, QString> m_checksumTools; // extension/typ-name -> binary name | ||
110 | 110 | | |||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |