forked from qt-creator/qt-creator
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 <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -382,25 +382,6 @@ public:
|
||||
|
||||
static GitPluginPrivate *dd = nullptr;
|
||||
|
||||
class GitTopicCache : public IVersionControl::TopicCache
|
||||
{
|
||||
public:
|
||||
GitTopicCache() {}
|
||||
|
||||
protected:
|
||||
FilePath trackFile(const FilePath &repository) override
|
||||
{
|
||||
const FilePath gitDir = gitClient().findGitDirForRepository(repository);
|
||||
return gitDir.isEmpty() ? FilePath() : gitDir / "HEAD";
|
||||
}
|
||||
|
||||
QString refreshTopic(const FilePath &repository) override
|
||||
{
|
||||
emit dd->repositoryChanged(repository);
|
||||
return gitClient().synchronousTopic(repository);
|
||||
}
|
||||
};
|
||||
|
||||
GitPluginPrivate::~GitPluginPrivate()
|
||||
{
|
||||
cleanCommitMessageFile();
|
||||
@@ -560,7 +541,14 @@ GitPluginPrivate::GitPluginPrivate()
|
||||
{
|
||||
dd = this;
|
||||
|
||||
setTopicCache(new GitTopicCache);
|
||||
setTopicFileTracker([](const FilePath &repository) {
|
||||
const FilePath gitDir = gitClient().findGitDirForRepository(repository);
|
||||
return gitDir.isEmpty() ? FilePath() : gitDir / "HEAD";
|
||||
});
|
||||
setTopicRefresher([this](const FilePath &repository) {
|
||||
emit repositoryChanged(repository);
|
||||
return gitClient().synchronousTopic(repository);
|
||||
});
|
||||
|
||||
m_fileActions.reserve(10);
|
||||
m_projectActions.reserve(10);
|
||||
|
||||
Reference in New Issue
Block a user