File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -989,6 +989,29 @@ void SharedCacheView::OnAfterSnapshotDataApplied()
989989}
990990
991991
992+ void SharedCacheView::OnAfterSnapshotDataSaved ()
993+ {
994+ auto projectFile = GetFile ()->GetProjectFile ();
995+ if (!projectFile)
996+ return ;
997+
998+ auto project = projectFile->GetProject ();
999+ auto projectFolder = projectFile->GetFolder ();
1000+
1001+ std::set<std::string> dependencyFileNames = m_secondaryFileNames;
1002+ if (!m_primaryFileName.empty ())
1003+ dependencyFileNames.insert (m_primaryFileName);
1004+
1005+ for (const auto & dependencyFile : project->GetFilesInFolder (projectFolder))
1006+ {
1007+ if (!dependencyFileNames.contains (dependencyFile->GetName ()))
1008+ continue ;
1009+
1010+ projectFile->AddDependency (dependencyFile);
1011+ }
1012+ }
1013+
1014+
9921015void SharedCacheView::SetPrimaryFileName (std::string primaryFileName)
9931016{
9941017 m_primaryFileName = std::move (primaryFileName);
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class SharedCacheView : public BinaryNinja::BinaryView
2626
2727 bool Init () override ;
2828 void OnAfterSnapshotDataApplied () override ;
29+ void OnAfterSnapshotDataSaved () override ;
2930
3031 // Initialized the shared cache controller for this view. This is what allows us to load images and regions.
3132 bool InitController ();
You can’t perform that action at this time.
0 commit comments