From 4b7e5750ec4ebd1becad2744b1942d2f03e19331 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 11 Apr 2017 20:31:20 +0300 Subject: [PATCH] Alpha 1.0.31: Fix crash in localstorage. --- Telegram/Resources/uwp/AppX/AppxManifest.xml | 2 +- Telegram/Resources/winrc/Telegram.rc | 8 ++++---- Telegram/Resources/winrc/Updater.rc | 8 ++++---- Telegram/SourceFiles/core/version.h | 4 ++-- Telegram/SourceFiles/storage/localstorage.cpp | 13 +++++++++++-- Telegram/build/version | 6 +++--- changelog.txt | 4 ++++ 7 files changed, 29 insertions(+), 16 deletions(-) diff --git a/Telegram/Resources/uwp/AppX/AppxManifest.xml b/Telegram/Resources/uwp/AppX/AppxManifest.xml index 268de6f02..0919a5ede 100644 --- a/Telegram/Resources/uwp/AppX/AppxManifest.xml +++ b/Telegram/Resources/uwp/AppX/AppxManifest.xml @@ -9,7 +9,7 @@ + Version="1.0.31.0" /> Telegram Desktop Telegram Messenger LLP diff --git a/Telegram/Resources/winrc/Telegram.rc b/Telegram/Resources/winrc/Telegram.rc index 0b00112eb..c97f6a540 100644 --- a/Telegram/Resources/winrc/Telegram.rc +++ b/Telegram/Resources/winrc/Telegram.rc @@ -34,8 +34,8 @@ IDI_ICON1 ICON "..\\art\\icon256.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,30,0 - PRODUCTVERSION 1,0,30,0 + FILEVERSION 1,0,31,0 + PRODUCTVERSION 1,0,31,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -52,10 +52,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Desktop" - VALUE "FileVersion", "1.0.30.0" + VALUE "FileVersion", "1.0.31.0" VALUE "LegalCopyright", "Copyright (C) 2014-2017" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.0.30.0" + VALUE "ProductVersion", "1.0.31.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/Resources/winrc/Updater.rc b/Telegram/Resources/winrc/Updater.rc index e8d92a4c9..863c338f7 100644 --- a/Telegram/Resources/winrc/Updater.rc +++ b/Telegram/Resources/winrc/Updater.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,0,30,0 - PRODUCTVERSION 1,0,30,0 + FILEVERSION 1,0,31,0 + PRODUCTVERSION 1,0,31,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,10 +43,10 @@ BEGIN BEGIN VALUE "CompanyName", "Telegram Messenger LLP" VALUE "FileDescription", "Telegram Desktop Updater" - VALUE "FileVersion", "1.0.30.0" + VALUE "FileVersion", "1.0.31.0" VALUE "LegalCopyright", "Copyright (C) 2014-2017" VALUE "ProductName", "Telegram Desktop" - VALUE "ProductVersion", "1.0.30.0" + VALUE "ProductVersion", "1.0.31.0" END END BLOCK "VarFileInfo" diff --git a/Telegram/SourceFiles/core/version.h b/Telegram/SourceFiles/core/version.h index 96d753543..4b2b6bc5e 100644 --- a/Telegram/SourceFiles/core/version.h +++ b/Telegram/SourceFiles/core/version.h @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #define BETA_VERSION_MACRO (0ULL) -constexpr int AppVersion = 1000030; -constexpr str_const AppVersionStr = "1.0.30"; +constexpr int AppVersion = 1000031; +constexpr str_const AppVersionStr = "1.0.31"; constexpr bool AppAlphaVersion = true; constexpr uint64 AppBetaVersion = BETA_VERSION_MACRO; diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp index 65806fa70..de5cceb12 100644 --- a/Telegram/SourceFiles/storage/localstorage.cpp +++ b/Telegram/SourceFiles/storage/localstorage.cpp @@ -1710,7 +1710,16 @@ void _writeUserSettings() { } auto userDataInstance = StoredAuthSessionCache ? &StoredAuthSessionCache->data : Messenger::Instance().getAuthSessionData(); auto userData = userDataInstance ? userDataInstance->serialize() : QByteArray(); - auto dialogsWidthRatio = StoredAuthSessionCache ? StoredAuthSessionCache->dialogsWidthRatio : (App::wnd() ? App::wnd()->controller()->dialogsWidthRatio().value() : Window::Controller::kDefaultDialogsWidthRatio); + auto dialogsWidthRatio = [] { + if (StoredAuthSessionCache) { + return StoredAuthSessionCache->dialogsWidthRatio; + } else if (auto window = App::wnd()) { + if (auto controller = window->controller()) { + return controller->dialogsWidthRatio().value(); + } + } + return Window::Controller::kDefaultDialogsWidthRatio; + }; uint32 size = 21 * (sizeof(quint32) + sizeof(qint32)); size += sizeof(quint32) + Serialize::stringSize(Global::AskDownloadPath() ? QString() : Global::DownloadPath()) + Serialize::bytearraySize(Global::AskDownloadPath() ? QByteArray() : Global::DownloadPathBookmark()); @@ -1755,7 +1764,7 @@ void _writeUserSettings() { data.stream << quint32(dbiDialogsMode) << qint32(Global::DialogsModeEnabled() ? 1 : 0) << static_cast(Global::DialogsMode()); data.stream << quint32(dbiModerateMode) << qint32(Global::ModerateModeEnabled() ? 1 : 0); data.stream << quint32(dbiAutoPlay) << qint32(cAutoPlayGif() ? 1 : 0); - data.stream << quint32(dbiDialogsWidthRatio) << qint32(snap(qRound(dialogsWidthRatio * 1000000), 0, 1000000)); + data.stream << quint32(dbiDialogsWidthRatio) << qint32(snap(qRound(dialogsWidthRatio() * 1000000), 0, 1000000)); data.stream << quint32(dbiUseExternalVideoPlayer) << qint32(cUseExternalVideoPlayer()); if (!userData.isEmpty()) { data.stream << quint32(dbiAuthSessionData) << userData; diff --git a/Telegram/build/version b/Telegram/build/version index 3d2f9c3e0..ba1ec6315 100644 --- a/Telegram/build/version +++ b/Telegram/build/version @@ -1,6 +1,6 @@ -AppVersion 1000030 +AppVersion 1000031 AppVersionStrMajor 1.0 -AppVersionStrSmall 1.0.30 -AppVersionStr 1.0.30 +AppVersionStrSmall 1.0.31 +AppVersionStr 1.0.31 AlphaChannel 1 BetaVersion 0 diff --git a/changelog.txt b/changelog.txt index 61ce567e1..14da681d4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +1.0.31 alpha (11.04.17) + +- Bug fixes and other minor improvements. + 1.0.30 alpha (11.04.17) - The new Emoji, Stickers, and Saved GIFs panel becomes a separate space on the right when Telegram is running in a wide enough window.