diff options
author | hjk <[email protected]> | 2024-02-07 16:13:22 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2024-02-09 16:00:56 +0000 |
commit | 0b44cc5589a0fb94271131bfa2cddfc61b58bced (patch) | |
tree | fa0df0613a69af8e6ac4c40053efb1d2e215c0a9 /src/plugins/mercurial | |
parent | 5a643b1c0a33daf8bac64e3c7688af8b80956dd4 (diff) |
Vcs: Hide topic cache in new IVersionControl pimpl
Potentially more stable api long-term. Also simplifies the
user side code a bit.
Change-Id: I6913e27e2a5dc14907e72f252081cdbed34842a3
Reviewed-by: Orgad Shaneh <[email protected]>
Reviewed-by: <[email protected]>
Diffstat (limited to 'src/plugins/mercurial')
-rw-r--r-- | src/plugins/mercurial/mercurialplugin.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index 1fa1fc8155e..91c25139d9f 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -51,23 +51,6 @@ using namespace std::placeholders; namespace Mercurial::Internal { -class MercurialTopicCache : public Core::IVersionControl::TopicCache -{ -public: - MercurialTopicCache() = default; - -protected: - FilePath trackFile(const FilePath &repository) override - { - return repository.pathAppended(".hg/branch"); - } - - QString refreshTopic(const FilePath &repository) override - { - return mercurialClient().branchQuerySync(repository.toString()); - } -}; - class MercurialPluginPrivate final : public VcsBase::VersionControlBase { public: @@ -203,7 +186,12 @@ MercurialPluginPrivate::MercurialPluginPrivate() [] { return new CommitEditor; } }); - setTopicCache(new MercurialTopicCache); + setTopicFileTracker([](const FilePath &repository) { + return repository.pathAppended(".hg/branch"); + }); + setTopicRefresher([](const FilePath &repository) { + return mercurialClient().branchQuerySync(repository.toString()); + }); Core::Context context(Constants::MERCURIAL_CONTEXT); |