mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 22:46:10 +00:00
fixed file saving with bad names, version 0.5.12 prepared
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB |
@@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://tdesktop.com
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
static const int32 AppVersion = 5011;
|
||||
static const wchar_t *AppVersionStr = L"0.5.11";
|
||||
static const int32 AppVersion = 5012;
|
||||
static const wchar_t *AppVersionStr = L"0.5.12";
|
||||
#ifdef Q_OS_WIN
|
||||
static const wchar_t *AppName = L"Telegram Win (Unofficial)";
|
||||
#else
|
||||
|
@@ -227,6 +227,13 @@ void PhotoLink::onClick(Qt::MouseButton button) const {
|
||||
}
|
||||
|
||||
QString saveFileName(const QString &title, const QString &filter, const QString &prefix, QString name, bool savingAs, const QDir &dir = QDir()) {
|
||||
#ifdef Q_OS_WIN
|
||||
name = name.replace(QRegularExpression(qsl("[\\\\\\/\\:\\*\\?\\\"\\<\\>\\|]")), qsl("_"));
|
||||
#elif defined Q_OS_MAC
|
||||
name = name.replace(QRegularExpression(qsl("[\\:]")), qsl("_"));
|
||||
#elif defined Q_OS_LINUX
|
||||
name = name.replace(QRegularExpression(qsl("[\\/]")), qsl("_"));
|
||||
#endif
|
||||
if (cAskDownloadPath() || savingAs) {
|
||||
if (!name.isEmpty() && name.at(0) == QChar::fromLatin1('.')) {
|
||||
name = filedialogDefaultName(prefix, name);
|
||||
|
Reference in New Issue
Block a user