1#pragma once
2
3#include <QFrame>
4
5class GitBase;
6class GitCache;
7
8class IDiffWidget : public QFrame
9{
10 Q_OBJECT
11signals:
12
13public:
14 explicit IDiffWidget(const QSharedPointer<GitBase> &git, QSharedPointer<GitCache> cache,
15 QWidget *parent = nullptr);
16
17 /*!
18 \brief Reloads the current diff in case the user loaded the work in progress as base commit.
19
20 */
21 virtual bool reload() = 0;
22
23 /*!
24 \brief Gets the current SHA.
25
26 \return QString The current SHA.
27 */
28 QString getCurrentSha() const { return mCurrentSha; }
29 /*!
30 \brief Gets the SHA against the diff is comparing to.
31
32 \return QString The SHA that the diff is compared to.
33 */
34 QString getPreviousSha() const { return mPreviousSha; }
35
36protected:
37 QSharedPointer<GitBase> mGit;
38 QSharedPointer<GitCache> mCache;
39 QString mCurrentSha;
40 QString mPreviousSha;
41};
42