Use more FileUtils based file dialogs

Change-Id: I1e7ec0493c26afe58e17afb8923a2b1023f6dcd4
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-08-17 16:36:42 +02:00
parent 6e8c4aa835
commit 584217a52f
33 changed files with 226 additions and 226 deletions

View File

@@ -797,15 +797,15 @@ QString DocumentManager::allDocumentFactoryFiltersString(QString *allFilesFilter
}
QString DocumentManager::getSaveFileName(const QString &title, const QString &pathIn,
const QString &filter, QString *selectedFilter)
const QString &filter, QString *selectedFilter)
{
const QString &path = pathIn.isEmpty() ? fileDialogInitialDirectory() : pathIn;
const FilePath path = FilePath::fromString(pathIn.isEmpty() ? fileDialogInitialDirectory() : pathIn);
QString fileName;
bool repeat;
do {
repeat = false;
fileName = QFileDialog::getSaveFileName(
ICore::dialogParent(), title, path, filter, selectedFilter, QFileDialog::DontConfirmOverwrite);
fileName = FileUtils::getSaveFilePath(nullptr, title, path, filter, selectedFilter,
QFileDialog::DontConfirmOverwrite).toString();
if (!fileName.isEmpty()) {
// If the selected filter is All Files (*) we leave the name exactly as the user
// specified. Otherwise the suffix must be one available in the selected filter. If