File indexing completed on 2024-04-14 03:55:24

0001 /*
0002     SPDX-FileCopyrightText: 2010-2018 Dominik Haumann <dhaumann@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #ifndef KATE_SWAP_DIFF_CREATOR_H
0007 #define KATE_SWAP_DIFF_CREATOR_H
0008 
0009 #include <QProcess>
0010 #include <QTemporaryFile>
0011 
0012 namespace Kate
0013 {
0014 class SwapFile;
0015 }
0016 
0017 class SwapDiffCreator : public QObject
0018 {
0019 public:
0020     explicit SwapDiffCreator(Kate::SwapFile *swapFile);
0021     ~SwapDiffCreator() override = default;
0022 
0023 public:
0024     void viewDiff();
0025 
0026 private:
0027     Kate::SwapFile *const m_swapFile;
0028 
0029 protected:
0030     void slotDataAvailable();
0031     void slotDiffFinished();
0032 
0033 private:
0034     QProcess m_proc;
0035     QTemporaryFile m_originalFile;
0036     QTemporaryFile m_recoveredFile;
0037     QTemporaryFile m_diffFile;
0038 };
0039 
0040 #endif // KATE_SWAP_DIFF_CREATOR_H