1 | /* |
2 | SPDX-FileCopyrightText: 2010-2018 Dominik Haumann <dhaumann@kde.org> |
3 | |
4 | SPDX-License-Identifier: LGPL-2.0-or-later |
5 | */ |
6 | #ifndef KATE_SWAP_DIFF_CREATOR_H |
7 | #define KATE_SWAP_DIFF_CREATOR_H |
8 | |
9 | #include <QProcess> |
10 | #include <QTemporaryFile> |
11 | |
12 | namespace Kate |
13 | { |
14 | class SwapFile; |
15 | } |
16 | |
17 | class SwapDiffCreator : public QObject |
18 | { |
19 | public: |
20 | explicit SwapDiffCreator(Kate::SwapFile *swapFile); |
21 | ~SwapDiffCreator() override = default; |
22 | |
23 | public: |
24 | void viewDiff(); |
25 | |
26 | private: |
27 | Kate::SwapFile *const m_swapFile; |
28 | |
29 | protected: |
30 | void slotDataAvailable(); |
31 | void slotDiffFinished(); |
32 | |
33 | private: |
34 | QProcess m_proc; |
35 | QTemporaryFile m_originalFile; |
36 | QTemporaryFile m_recoveredFile; |
37 | QTemporaryFile m_diffFile; |
38 | }; |
39 | |
40 | #endif // KATE_SWAP_DIFF_CREATOR_H |
41 | |