2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Use Main::Session in download/upload.

This commit is contained in:
John Preston
2020-06-08 19:17:33 +04:00
parent 3878a1b212
commit 4b354b0928
47 changed files with 572 additions and 220 deletions

View File

@@ -157,13 +157,15 @@ void ShowInFolder(const QString &filepath) {
});
}
QString DefaultDownloadPath() {
QString DefaultDownloadPathFolder(not_null<Main::Session*> session) {
return session->supportMode() ? u"Tsupport Desktop"_q : AppName.utf16();
}
QString DefaultDownloadPath(not_null<Main::Session*> session) {
return QStandardPaths::writableLocation(
QStandardPaths::DownloadLocation)
+ '/'
+ (Main::Session::Exists() && Auth().supportMode()
? "Tsupport Desktop"_cs
: AppName).utf16()
+ DefaultDownloadPathFolder(session)
+ '/';
}