| 2888 | } |
| 2889 | |
| 2890 | void CaptureContext::EmbedDependentFiles() |
| 2891 | { |
| 2892 | if(!m_Replay.GetCaptureAccess()) |
| 2893 | return; |
| 2894 | |
| 2895 | // Always operate on the capture access (local or remote) |
| 2896 | QString tag = lit("replayEmbedDependenciesIntoCapture"); |
| 2897 | bool done = false; |
| 2898 | |
| 2899 | Replay().AsyncInvoke(tag, [this, &done](IReplayController *) { |
| 2900 | m_Replay.GetCaptureAccess()->EmbedDependenciesIntoCapture(); |
| 2901 | done = true; |
| 2902 | }); |
| 2903 | |
| 2904 | // wait a short while before displaying the progress dialog |
| 2905 | for(int i = 0; !done && (i < 100 || m_Replay.GetCurrentProcessingTag().isEmpty() || |
| 2906 | m_Replay.GetCurrentProcessingTag() == tag); |
| 2907 | i++) |
| 2908 | QThread::msleep(5); |
| 2909 | |
| 2910 | ShowProgressDialog(m_MainWindow->Widget(), tr("Please wait, working..."), |
| 2911 | [&done]() { return done; }); |
| 2912 | |
| 2913 | // Local replay |
| 2914 | if(m_Replay.GetCaptureFile()) |
| 2915 | return; |
| 2916 | |
| 2917 | // Remote capture : no local capture file |
| 2918 | if(IsCaptureTemporary()) |
| 2919 | return; |
| 2920 | |
| 2921 | // Local capture file being replayed remotely : copy back from the remote |
| 2922 | if(IsCaptureLocal()) |
| 2923 | { |
| 2924 | Replay().CopyCaptureFromRemote(m_RemoteFile, m_CaptureFile, m_MainWindow); |
| 2925 | |
| 2926 | if(!QFile::exists(m_CaptureFile)) |
| 2927 | { |
| 2928 | RDDialog::critical(m_MainWindow, tr("Failed to save capture"), |
| 2929 | tr("Capture couldn't be copied from remote.")); |
| 2930 | return; |
| 2931 | } |
| 2932 | } |
| 2933 | } |
| 2934 | |
| 2935 | void CaptureContext::RemoveDependentFiles() |
| 2936 | { |
nothing calls this directly
no test coverage detected