Changeset View
Changeset View
Standalone View
Standalone View
vcs/widgets/vcsdiffpatchsources.h
Show All 36 Lines | |||||
37 | class VcsDiff; | 37 | class VcsDiff; | ||
38 | } | 38 | } | ||
39 | 39 | | |||
40 | class QWidget; | 40 | class QWidget; | ||
41 | 41 | | |||
42 | class VCSDiffUpdater { | 42 | class VCSDiffUpdater { | ||
43 | public: | 43 | public: | ||
44 | virtual ~VCSDiffUpdater(); | 44 | virtual ~VCSDiffUpdater(); | ||
45 | virtual KDevelop::VcsDiff update() const = 0; | 45 | virtual KDevelop::VcsDiff update() const = 0; | ||
kfunk: Still, odd API. `lines` is ambiguous, too, should be `contextLines` if at all. | |||||
Here too one could make the parameter a member variable with setter method instead of an argument. It probably makes even more sense here than elsewhere. rjvbb: Here too one could make the parameter a member variable with setter method instead of an… | |||||
46 | virtual KDevelop::IBasicVersionControl* vcs() const = 0; | 46 | virtual KDevelop::IBasicVersionControl* vcs() const = 0; | ||
47 | virtual QUrl url() const = 0; | 47 | virtual QUrl url() const = 0; | ||
48 | void setContextLines(int n) | ||||
49 | { | ||||
50 | m_contextLines = n; | ||||
51 | } | ||||
52 | int contextLines() { return m_contextLines; } | ||||
53 | protected: | ||||
54 | int m_contextLines=-1; | ||||
48 | }; | 55 | }; | ||
49 | 56 | | |||
50 | class KDEVPLATFORMVCS_EXPORT VCSStandardDiffUpdater : public VCSDiffUpdater { | 57 | class KDEVPLATFORMVCS_EXPORT VCSStandardDiffUpdater : public VCSDiffUpdater { | ||
51 | public: | 58 | public: | ||
52 | VCSStandardDiffUpdater(KDevelop::IBasicVersionControl* vcs, QUrl url); | 59 | VCSStandardDiffUpdater(KDevelop::IBasicVersionControl* vcs, QUrl url); | ||
53 | ~VCSStandardDiffUpdater() override; | 60 | ~VCSStandardDiffUpdater() override; | ||
54 | KDevelop::VcsDiff update() const override; | 61 | KDevelop::VcsDiff update() const override; | ||
55 | KDevelop::IBasicVersionControl* vcs() const override { return m_vcs; } | 62 | KDevelop::IBasicVersionControl* vcs() const override { return m_vcs; } | ||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |
Still, odd API. lines is ambiguous, too, should be contextLines if at all.