some crashes fixed, 0.9.34 dev version

This commit is contained in:
John Preston 2016-03-16 16:29:44 +03:00
parent c8f2f6bc2b
commit b9616bdf75
8 changed files with 38 additions and 30 deletions

View file

@ -69,8 +69,8 @@ PhotoSendBox::PhotoSendBox(const FileLoadResultPtr &file) : AbstractBox(st::boxW
if (_animated) {
int32 limitW = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right();
int32 limitH = st::confirmMaxHeight;
maxW = dimensions.width();
maxH = dimensions.height();
maxW = qMax(dimensions.width(), 1);
maxH = qMax(dimensions.height(), 1);
if (maxW * limitH > maxH * limitW) {
if (maxW < limitW) {
maxH = maxH * limitW / maxW;
@ -446,8 +446,8 @@ EditCaptionBox::EditCaptionBox(HistoryItem *msg) : AbstractBox(st::boxWideWidth)
if (_animated) {
int32 limitW = width() - st::boxPhotoPadding.left() - st::boxPhotoPadding.right();
int32 limitH = st::confirmMaxHeight;
maxW = dimensions.width();
maxH = dimensions.height();
maxW = qMax(dimensions.width(), 1);
maxH = qMax(dimensions.height(), 1);
if (maxW * limitH > maxH * limitW) {
if (maxW < limitW) {
maxH = maxH * limitW / maxW;

View file

@ -20,9 +20,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
static const int32 AppVersion = 9033;
static const wchar_t *AppVersionStr = L"0.9.33";
static const bool DevVersion = false;
static const int32 AppVersion = 9034;
static const wchar_t *AppVersionStr = L"0.9.34";
static const bool DevVersion = true;
//#define BETA_VERSION (9030002ULL) // just comment this line to build public version
static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)";

View file

@ -561,7 +561,7 @@ void PopupTooltip::onShow() {
}
void PopupTooltip::onWndActiveChanged() {
if (!App::wnd()->windowHandle()->isActive()) {
if (!App::wnd() || !App::wnd()->windowHandle() || !App::wnd()->windowHandle()->isActive()) {
PopupTooltip::Hide();
}
}

View file

@ -1118,7 +1118,9 @@ bool DialogsList::del(const PeerId &peerId, DialogRow *replacedBy) {
if (i == rowByPeer.cend()) return false;
DialogRow *row = i.value();
if (App::main()) {
emit App::main()->dialogRowReplaced(row, replacedBy);
}
if (row == current) {
current = row->next;
@ -6179,7 +6181,7 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId id,
, _text(st::msgMinWidth)
, _textWidth(0)
, _textHeight(0)
, _media(0) {
, _media(nullptr) {
UserData *fwdViaBot = fwd->viaBot();
int32 viaBotId = fwdViaBot ? peerToUser(fwdViaBot->id) : 0;
int32 fwdViewsCount = fwd->viewsCount(), views = (fwdViewsCount > 0) ? fwdViewsCount : (isPost() ? 1 : -1);
@ -6197,7 +6199,7 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId id,
, _text(st::msgMinWidth)
, _textWidth(0)
, _textHeight(0)
, _media(0) {
, _media(nullptr) {
create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1);
setText(msg, entities);
@ -6208,7 +6210,7 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_
, _text(st::msgMinWidth)
, _textWidth(0)
, _textHeight(0)
, _media(0) {
, _media(nullptr) {
create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1);
initMediaFromDocument(doc, caption);
@ -6220,7 +6222,7 @@ HistoryItem(history, block, msgId, flags, date, (flags & MTPDmessage::flag_from_
, _text(st::msgMinWidth)
, _textWidth(0)
, _textHeight(0)
, _media(0) {
, _media(nullptr) {
create((flags & MTPDmessage::flag_via_bot_id) ? viaBotId : 0, isPost() ? 1 : -1);
_media = new HistoryPhoto(photo, caption, this);
@ -6516,8 +6518,10 @@ void HistoryMessage::setMedia(const MTPMessageMedia *media) {
bool mediaWasDisplayed = false;
if (_media) {
mediaWasDisplayed = _media->isDisplayed();
_media->unregItem(this);
delete _media;
_media = 0;
_media = nullptr;
}
QString t;
initMedia(media, t);
@ -7504,6 +7508,7 @@ void HistoryServiceMsg::setMessageByAction(const MTPmessageAction &action) {
const MTPDmessageActionChatEditPhoto &d(action.c_messageActionChatEditPhoto());
if (d.vphoto.type() == mtpc_photo) {
_media = new HistoryPhoto(history()->peer, d.vphoto.c_photo(), st::msgServicePhotoWidth);
_media->regItem(this);
}
text = isPost() ? lang(lng_action_changed_photo_channel) : lng_action_changed_photo(lt_from, from);
} break;
@ -7879,8 +7884,11 @@ HistoryServiceMsg::~HistoryServiceMsg() {
App::historyUnregDependency(this, pinned->msg);
}
}
if (_media) {
_media->unregItem(this);
deleteAndMark(_media);
}
}
HistoryDateMsg::HistoryDateMsg(History *history, HistoryBlock *block, const QDate &date) :
HistoryServiceMsg(history, block, clientMsgId(), QDateTime(date), langDayOfMonthFull(date)) {

View file

@ -11,7 +11,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.9.32</string>
<string>0.9.34</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>

View file

@ -34,8 +34,8 @@ IDI_ICON1 ICON "SourceFiles\\art\\icon256.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,9,32,0
PRODUCTVERSION 0,9,32,0
FILEVERSION 0,9,34,0
PRODUCTVERSION 0,9,34,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -51,10 +51,10 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Telegram Messenger LLP"
VALUE "FileVersion", "0.9.32.0"
VALUE "FileVersion", "0.9.34.0"
VALUE "LegalCopyright", "Copyright (C) 2014-2016"
VALUE "ProductName", "Telegram Desktop"
VALUE "ProductVersion", "0.9.32.0"
VALUE "ProductVersion", "0.9.34.0"
END
END
BLOCK "VarFileInfo"

View file

@ -1726,7 +1726,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.9.32;
CURRENT_PROJECT_VERSION = 0.9.34;
DEBUG_INFORMATION_FORMAT = dwarf;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
@ -1745,7 +1745,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 0.9.32;
CURRENT_PROJECT_VERSION = 0.9.34;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_OPTIMIZATION_LEVEL = fast;
GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h;
@ -1774,10 +1774,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.9.32;
CURRENT_PROJECT_VERSION = 0.9.34;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 0.9;
DYLIB_CURRENT_VERSION = 0.9.32;
DYLIB_CURRENT_VERSION = 0.9.34;
ENABLE_STRICT_OBJC_MSGSEND = YES;
FRAMEWORK_SEARCH_PATHS = "";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
@ -1915,10 +1915,10 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0.9.32;
CURRENT_PROJECT_VERSION = 0.9.34;
DEBUG_INFORMATION_FORMAT = dwarf;
DYLIB_COMPATIBILITY_VERSION = 0.9;
DYLIB_CURRENT_VERSION = 0.9.32;
DYLIB_CURRENT_VERSION = 0.9.34;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
FRAMEWORK_SEARCH_PATHS = "";

View file

@ -1,6 +1,6 @@
AppVersion 9033
AppVersion 9034
AppVersionStrMajor 0.9
AppVersionStrSmall 0.9.33
AppVersionStr 0.9.33
DevChannel 0
AppVersionStrSmall 0.9.34
AppVersionStr 0.9.34
DevChannel 1
BetaVersion 0 9030002