MCPcopy Create free account
hub / github.com/KDE/kdevelop / registerRepositoryForCurrentBranchChanges

Method registerRepositoryForCurrentBranchChanges

plugins/git/gitplugin.cpp:1782–1801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1780}
1781
1782void GitPlugin::registerRepositoryForCurrentBranchChanges(const QUrl& repository, const QObject* listener)
1783{
1784 Q_ASSERT(listener); // precondition
1785 const auto headFile = gitHeadFile(repository);
1786 qCDebug(PLUGIN_GIT) << "registering repository" << repository.toString(QUrl::PreferLocalFile) << "and listener"
1787 << listener << "with the HEAD file" << headFile;
1788
1789 const auto it = findWatchedFile(headFile);
1790 if (it == m_watchedFiles.end()) {
1791 auto& watchedFile = m_watchedFiles.emplace_back(headFile);
1792 Q_ASSERT(watchedFile.listeners.empty());
1793 watchedFile.listeners.push_back(listener);
1794
1795 m_watcher->addFile(headFile);
1796 qCDebug(PLUGIN_GIT) << "started watching the HEAD file" << headFile;
1797 } else {
1798 // headFile is already watched => just register another listener
1799 it->listeners.push_back(listener);
1800 }
1801}
1802
1803void GitPlugin::unregisterRepositoryForCurrentBranchChanges(const QUrl& repository, const QObject* listener)
1804{

Callers 4

addProjectMethod · 0.80
addProjectMethod · 0.80
addProjectMethod · 0.80

Calls 6

gitHeadFileFunction · 0.85
emptyMethod · 0.80
toStringMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
addFileMethod · 0.45