mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Hide default download folder option if it's not available
This commit is contained in:
@@ -595,11 +595,9 @@ void Application::saveSettings() {
|
||||
Local::writeSettings();
|
||||
}
|
||||
|
||||
bool Application::canSaveFileWithoutAskingForPath() const {
|
||||
if (Core::App().settings().askDownloadPath()) {
|
||||
return false;
|
||||
} else if (KSandbox::isInside()
|
||||
&& Core::App().settings().downloadPath().isEmpty()) {
|
||||
bool Application::canReadDefaultDownloadPath(bool always) const {
|
||||
if (KSandbox::isInside()
|
||||
&& (always || Core::App().settings().downloadPath().isEmpty())) {
|
||||
const auto path = QStandardPaths::writableLocation(
|
||||
QStandardPaths::DownloadLocation);
|
||||
return base::CanReadDirectory(path);
|
||||
@@ -607,6 +605,11 @@ bool Application::canSaveFileWithoutAskingForPath() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Application::canSaveFileWithoutAskingForPath() const {
|
||||
return !Core::App().settings().askDownloadPath()
|
||||
&& canReadDefaultDownloadPath();
|
||||
}
|
||||
|
||||
MTP::Config &Application::fallbackProductionConfig() const {
|
||||
if (!_fallbackProductionConfig) {
|
||||
_fallbackProductionConfig = std::make_unique<MTP::Config>(
|
||||
|
Reference in New Issue
Block a user