| 1674 | } |
| 1675 | |
| 1676 | void MainWindow::screenshotSave(const QString& nameFilter, const QString& defaultSuffix, const QString& temppath) { |
| 1677 | QFileDialog dialog(this); |
| 1678 | |
| 1679 | dialog.setAcceptMode(QFileDialog::AcceptSave); |
| 1680 | dialog.setFileMode(QFileDialog::AnyFile); |
| 1681 | dialog.setDirectory(m_dir); |
| 1682 | dialog.setNameFilter(nameFilter); |
| 1683 | dialog.setWindowTitle(tr("Save Screen")); |
| 1684 | dialog.setDefaultSuffix(defaultSuffix); |
| 1685 | dialog.exec(); |
| 1686 | |
| 1687 | if (!(dialog.selectedFiles().isEmpty())) { |
| 1688 | QStringList selected = dialog.selectedFiles(); |
| 1689 | QString filename = selected.first(); |
| 1690 | if (filename.isEmpty()) { |
| 1691 | QFile::remove(temppath); |
| 1692 | } else { |
| 1693 | QFile::remove(filename); |
| 1694 | QFile::rename(temppath, filename); |
| 1695 | } |
| 1696 | } else { |
| 1697 | QFile::remove(temppath); |
| 1698 | } |
| 1699 | m_dir.setPath(dialog.directory().absolutePath()); |
| 1700 | } |
| 1701 | |
| 1702 | void MainWindow::screenshot() { |
| 1703 | QString path = QDir::tempPath() + QDir::separator() + QStringLiteral("cemu_tmp.img"); |
nothing calls this directly
no outgoing calls
no test coverage detected