MCPcopy Create free account
hub / github.com/TASEmulators/fceux / loadCdlFile

Method loadCdlFile

src/drivers/Qt/CodeDataLogger.cpp:487–541  ·  view source on GitHub ↗

----------------------------------------------------

Source from the content-addressed store, hash-verified

485}
486//----------------------------------------------------
487void CodeDataLoggerDialog_t::loadCdlFile(void)
488{
489 int ret, useNativeFileDialogVal;
490 QString filename;
491 std::string dir;
492 const char *romFile;
493 QFileDialog dialog(this, tr("Load CDL File"));
494
495 dialog.setFileMode(QFileDialog::ExistingFile);
496
497 dialog.setNameFilter(tr("CDL files (*.cdl *.CDL) ;; All files (*)"));
498
499 dialog.setViewMode(QFileDialog::List);
500 dialog.setFilter(QDir::AllEntries | QDir::AllDirs | QDir::Hidden);
501 dialog.setLabelText(QFileDialog::Accept, tr("Load"));
502
503 romFile = getRomFile();
504
505 if (romFile)
506 {
507 getDirFromFile(romFile, dir);
508
509 dialog.setDirectory(tr(dir.c_str()));
510 }
511
512 // Check config option to use native file dialog or not
513 g_config->getOption("SDL.UseNativeFileDialog", &useNativeFileDialogVal);
514
515 dialog.setOption(QFileDialog::DontUseNativeDialog, !useNativeFileDialogVal);
516
517 ret = dialog.exec();
518
519 if (ret)
520 {
521 QStringList fileList;
522 fileList = dialog.selectedFiles();
523
524 if (fileList.size() > 0)
525 {
526 filename = fileList[0];
527 }
528 }
529
530 if (filename.isNull())
531 {
532 return;
533 }
534 //qDebug() << "selected file path : " << filename.toUtf8();
535
536 FCEU_WRAPPER_LOCK();
537 LoadCDLog(filename.toStdString().c_str());
538 FCEU_WRAPPER_UNLOCK();
539
540 return;
541}
542//----------------------------------------------------
543void CodeDataLoggerDialog_t::SaveStrippedROM(int invert)
544{

Callers

nothing calls this directly

Calls 8

getDirFromFileFunction · 0.85
getOptionMethod · 0.80
setOptionMethod · 0.80
execMethod · 0.80
getRomFileFunction · 0.70
LoadCDLogFunction · 0.70
trFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected