diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2022-10-11 16:28:02 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2022-10-14 12:16:16 +0000 |
commit | 8394bb0a2b6801405a48207f301f0efb66f2debe (patch) | |
tree | 7cd21712f67096ac0f6de01efe393d58c896689b /src/plugins/git/gitplugin.cpp | |
parent | e757122843ecb411ec2bd01b70137427a23ce6f6 (diff) | |
download | qt-creator-8394bb0a2b6801405a48207f301f0efb66f2debe.tar.gz |
Git: Improve tracking of external changes to HEAD
Instead of using FileSystemWatcher, emit repositoryChanged when
refreshTopic is called.
This reverts commit 2a8c48cb15d50b8686e5cb4f29a96f4431a0ec37.
Fixes: QTCREATORBUG-21089
Change-Id: Iaee8a895f3bc087583cbdea11c6dc2c263694a86
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
-rw-r--r-- | src/plugins/git/gitplugin.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index a6bdfbf32e..c77ce79bcd 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -85,29 +85,6 @@ namespace Git::Internal { using GitClientMemberFunc = void (GitClient::*)(const FilePath &) const; -class GitTopicCache : public IVersionControl::TopicCache -{ -public: - GitTopicCache(GitClient *client) : - m_client(client) - { } - -protected: - FilePath trackFile(const FilePath &repository) override - { - const QString gitDir = m_client->findGitDirForRepository(repository); - return gitDir.isEmpty() ? FilePath() : FilePath::fromString(gitDir + "/HEAD"); - } - - QString refreshTopic(const FilePath &repository) override - { - return m_client->synchronousTopic(repository); - } - -private: - GitClient *m_client; -}; - class GitReflogEditorWidget : public GitEditorWidget { public: @@ -437,6 +414,30 @@ public: static GitPluginPrivate *dd = nullptr; +class GitTopicCache : public IVersionControl::TopicCache +{ +public: + GitTopicCache(GitClient *client) : + m_client(client) + { } + +protected: + FilePath trackFile(const FilePath &repository) override + { + const QString gitDir = m_client->findGitDirForRepository(repository); + return gitDir.isEmpty() ? FilePath() : FilePath::fromString(gitDir + "/HEAD"); + } + + QString refreshTopic(const FilePath &repository) override + { + emit dd->repositoryChanged(repository); + return m_client->synchronousTopic(repository); + } + +private: + GitClient *m_client; +}; + GitPluginPrivate::~GitPluginPrivate() { cleanCommitMessageFile(); |