ICaptureContextx APIs for externally referenced dependency files

void EmbedDependentFilesIntoCapture();
void RemoveDependentFilesFromCapture();
This commit is contained in:
Jake Turner
2025-12-10 21:57:21 +13:00
parent 10cf43b703
commit cf4e8b15fc
4 changed files with 103 additions and 0 deletions
+62
View File
@@ -945,6 +945,7 @@ void CaptureContext::LoadCaptureThreaded(const QString &captureFile, const Repla
const QString &origFilename, bool temporary, bool local)
{
m_CaptureFile = origFilename;
m_RemoteFile = captureFile;
m_CaptureLocal = local;
@@ -1427,6 +1428,7 @@ void CaptureContext::CloseCapture()
m_CaptureTemporary = false;
m_CaptureFile = QString();
m_RemoteFile = QString();
m_APIProps = APIProperties();
m_FrameInfo = FrameDescription();
@@ -2859,3 +2861,63 @@ void CaptureContext::AddDockWindow(QWidget *newWindow, DockReference ref, QWidge
manager->areaOf(refWindow), percentage);
manager->addToolWindow(newWindow, areaRef);
}
void CaptureContext::EmbedDependentFiles()
{
if(!m_Replay.GetCaptureAccess())
return;
// Always operate on the capture access (local or remote)
m_Replay.GetCaptureAccess()->EmbedDependenciesIntoCapture();
// Local replay
if(m_Replay.GetCaptureFile())
return;
// Remote capture : no local capture file
if(IsCaptureTemporary())
return;
// Local capture file being replayed remotely : copy back from the remote
if(IsCaptureLocal())
{
Replay().CopyCaptureFromRemote(m_RemoteFile, m_CaptureFile, m_MainWindow);
if(!QFile::exists(m_CaptureFile))
{
RDDialog::critical(m_MainWindow, tr("Failed to save capture"),
tr("Capture couldn't be copied from remote."));
return;
}
}
}
void CaptureContext::RemoveDependentFiles()
{
if(!m_Replay.GetCaptureAccess())
return;
// Always operate on the capture access (local or remote)
m_Replay.GetCaptureAccess()->RemoveDependenciesFromCapture();
// Local replay
if(m_Replay.GetCaptureFile())
return;
// Remote capture : no local capture file
if(IsCaptureTemporary())
return;
// Local capture file being replayed remotely : copy back from the remote
if(IsCaptureLocal())
{
Replay().CopyCaptureFromRemote(m_RemoteFile, m_CaptureFile, m_MainWindow);
if(!QFile::exists(m_CaptureFile))
{
RDDialog::critical(m_MainWindow, tr("Failed to save capture"),
tr("Capture couldn't be copied from remote."));
return;
}
}
}