Handle cancel for default download path in Linux sandbox

This commit is contained in:
Ilya Fedin 2022-11-09 19:17:42 +04:00 committed by John Preston
parent 9229c57e7a
commit 0cd0ad7a5b
3 changed files with 3 additions and 0 deletions

View File

@ -195,6 +195,7 @@ QString DefaultDownloadPath(not_null<Main::Session*> session) {
Core::App().saveSettings();
return result;
}
return QString();
}
return realDefaultPath;
}

View File

@ -155,6 +155,7 @@ QString FileNameUnsafe(
return path;
}
}();
if (path.isEmpty()) return QString();
if (name.isEmpty()) name = qsl(".unknown");
if (name.at(0) == QChar::fromLatin1('.')) {
if (!QDir().exists(path)) QDir().mkpath(path);

View File

@ -1750,6 +1750,7 @@ void OverlayWidget::downloadMedia() {
} else {
path = Core::App().settings().downloadPath();
}
if (path.isEmpty()) return;
QString toName;
if (_document) {
const auto &location = _document->location(true);