File indexing completed on 2024-04-28 11:45: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     Q_OBJECT
0020 
0021 public:
0022     explicit SwapDiffCreator(Kate::SwapFile *swapFile);
0023     ~SwapDiffCreator() override = default;
0024 
0025 public Q_SLOTS:
0026     void viewDiff();
0027 
0028 private:
0029     Kate::SwapFile *const m_swapFile;
0030 
0031 protected Q_SLOTS:
0032     void slotDataAvailable();
0033     void slotDiffFinished();
0034 
0035 private:
0036     QProcess m_proc;
0037     QTemporaryFile m_originalFile;
0038     QTemporaryFile m_recoveredFile;
0039     QTemporaryFile m_diffFile;
0040 };
0041 
0042 #endif // KATE_SWAP_DIFF_CREATOR_H