----------------------------------------------------------------------------
| 283 | } |
| 284 | //---------------------------------------------------------------------------- |
| 285 | void ConsoleDebugger::ld65ImportDebug(void) |
| 286 | { |
| 287 | int ret, useNativeFileDialogVal; |
| 288 | QString filename; |
| 289 | std::string last; |
| 290 | const char *romPath; |
| 291 | QFileDialog dialog(this, tr("Open ld65 Debug File") ); |
| 292 | QList<QUrl> urls; |
| 293 | QDir d; |
| 294 | |
| 295 | const QStringList filters({ |
| 296 | "dbg files (*.dbg *.DBG)", |
| 297 | "Any files (*)" |
| 298 | }); |
| 299 | |
| 300 | urls << QUrl::fromLocalFile( QDir::rootPath() ); |
| 301 | urls << QUrl::fromLocalFile(QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first()); |
| 302 | urls << QUrl::fromLocalFile(QStandardPaths::standardLocations(QStandardPaths::DesktopLocation).first()); |
| 303 | urls << QUrl::fromLocalFile(QStandardPaths::standardLocations(QStandardPaths::DownloadLocation).first()); |
| 304 | urls << QUrl::fromLocalFile( QDir( FCEUI_GetBaseDirectory() ).absolutePath() ); |
| 305 | |
| 306 | romPath = getRomFile(); |
| 307 | |
| 308 | if ( romPath != nullptr ) |
| 309 | { |
| 310 | std::string dir; |
| 311 | |
| 312 | getDirFromFile( romPath, dir); |
| 313 | |
| 314 | d.setPath(dir.c_str()); |
| 315 | |
| 316 | if ( d.exists() ) |
| 317 | { |
| 318 | urls << QUrl::fromLocalFile( d.absolutePath() ); |
| 319 | |
| 320 | dialog.setDirectory( tr(dir.c_str()) ); |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | dialog.setFileMode(QFileDialog::ExistingFile); |
| 325 | |
| 326 | dialog.setNameFilters( filters ); |
| 327 | |
| 328 | dialog.setViewMode(QFileDialog::List); |
| 329 | dialog.setFilter( QDir::AllEntries | QDir::AllDirs | QDir::Hidden ); |
| 330 | dialog.setLabelText( QFileDialog::Accept, tr("Open") ); |
| 331 | |
| 332 | // Check config option to use native file dialog or not |
| 333 | g_config->getOption ("SDL.UseNativeFileDialog", &useNativeFileDialogVal); |
| 334 | |
| 335 | dialog.setOption(QFileDialog::DontUseNativeDialog, !useNativeFileDialogVal); |
| 336 | dialog.setSidebarUrls(urls); |
| 337 | |
| 338 | ret = dialog.exec(); |
| 339 | |
| 340 | if ( ret ) |
| 341 | { |
| 342 | QStringList fileList; |
nothing calls this directly
no test coverage detected