2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-10 11:25:30 +00:00

Unify gtk/xdp file dialog getters

This commit is contained in:
Ilya Fedin
2021-03-22 03:13:00 +04:00
committed by John Preston
parent a16b7fbb83
commit ce5579e8f9
2 changed files with 25 additions and 18 deletions

View File

@@ -681,12 +681,15 @@ bool Get(
}
dialog.selectFile(startFile);
int res = dialog.exec();
const auto res = dialog.exec();
QString path = dialog.directory().absolutePath();
if (path != cDialogLastPath()) {
cSetDialogLastPath(path);
Local::writeSettings();
if (type != Type::ReadFolder) {
// Save last used directory for all queries except directory choosing.
const auto path = dialog.directory().absolutePath();
if (!path.isEmpty() && path != cDialogLastPath()) {
cSetDialogLastPath(path);
Local::writeSettings();
}
}
if (res == QDialog::Accepted) {