File indexing completed on 2024-04-28 04:38:52

0001 /*
0002     SPDX-FileCopyrightText: 2013 David E. Narvaez <david@piensalibre.net>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef STASHPATCHSOURCE_H
0008 #define STASHPATCHSOURCE_H
0009 
0010 #include <interfaces/ipatchsource.h>
0011 
0012 #include <QDir>
0013 
0014 namespace KDevelop
0015 {
0016     class VcsJob;
0017 }
0018 
0019 class GitPlugin;
0020 
0021 class StashPatchSource : public KDevelop::IPatchSource
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     StashPatchSource(const QString & stashName, GitPlugin * patch, const QDir & baseDir);
0027     ~StashPatchSource() override;
0028     QUrl baseDir() const override;
0029     QUrl file() const override;
0030     void update() override;
0031     bool isAlreadyApplied() const override;
0032     QString name() const override;
0033     bool canSelectFiles() const override { return true; };
0034     uint depth() const override { return 1; }
0035 
0036 private Q_SLOTS:
0037     void updatePatchFile(KDevelop::VcsJob* job);
0038 
0039 private:
0040     QString m_stashName;
0041     GitPlugin * m_plugin;
0042     QDir m_baseDir;
0043     QUrl m_patchFile;
0044 };
0045 
0046 #endif // STASHPATCHSOURCE_H