MCPcopy Create free account
hub / github.com/baldurk/renderdoc / saveCapture_triggered

Method saveCapture_triggered

qrenderdoc/Windows/Dialogs/LiveCapture.cpp:349–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349void LiveCapture::saveCapture_triggered()
350{
351 if(ui->captures->selectedItems().size() == 1)
352 {
353 saveCapture(GetCapture(ui->captures->selectedItems()[0]), QString());
354 }
355 else
356 {
357 QString path = m_Main->GetSavePath(tr("Save All Captures As"));
358
359 if(!path.isEmpty())
360 {
361 if(path.endsWith(lit(".rdc")))
362 path.chop(4);
363
364 // don't save duplicates if we have multiple captures from the same frame (possible if the
365 // application is not presenting at all and using the API to capture)
366 QMap<uint32_t, uint32_t> existingFiles;
367
368 for(QListWidgetItem *item : ui->captures->selectedItems())
369 {
370 Capture *cap = GetCapture(item);
371
372 QString filename = QFormatStr("%1-frame%2").arg(path).arg(cap->frameNumber);
373 if(cap->frameNumber == ~0U)
374 filename = QFormatStr("%1-capture").arg(path);
375
376 if(existingFiles.contains(cap->frameNumber))
377 {
378 filename += QFormatStr("_%1").arg(existingFiles[cap->frameNumber]);
379 existingFiles[cap->frameNumber]++;
380 }
381 else
382 {
383 // start on 2 next time
384 existingFiles[cap->frameNumber] = 2;
385 }
386
387 saveCapture(cap, QFormatStr("%1.rdc").arg(filename));
388 }
389 }
390 }
391}
392
393void LiveCapture::deleteCapture_triggered()
394{

Callers

nothing calls this directly

Calls 10

GetCaptureFunction · 0.85
GetSavePathMethod · 0.80
chopMethod · 0.80
QStringFunction · 0.50
trFunction · 0.50
sizeMethod · 0.45
isEmptyMethod · 0.45
endsWithMethod · 0.45
argMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected