| 351 | } |
| 352 | |
| 353 | QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, |
| 354 | const QString &filter, |
| 355 | QString *selectedSuffixOut) |
| 356 | { |
| 357 | QString selectedFilter; |
| 358 | QString myDir; |
| 359 | if(dir.isEmpty()) // Default to user documents location |
| 360 | { |
| 361 | myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); |
| 362 | } |
| 363 | else |
| 364 | { |
| 365 | myDir = dir; |
| 366 | } |
| 367 | /* Directly convert path to native OS path separators */ |
| 368 | QString result = QDir::toNativeSeparators(QFileDialog::getOpenFileName(parent, caption, myDir, filter, &selectedFilter)); |
| 369 | |
| 370 | if(selectedSuffixOut) |
| 371 | { |
| 372 | *selectedSuffixOut = ExtractFirstSuffixFromFilter(selectedFilter); |
| 373 | ; |
| 374 | } |
| 375 | return result; |
| 376 | } |
| 377 | |
| 378 | Qt::ConnectionType blockingGUIThreadConnection() |
| 379 | { |
no test coverage detected