From ec1d547f27b9aac51082d53d4115f4a62cd1104f Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 15 Jun 2015 20:36:16 +0300 Subject: [PATCH] warnings fixed, 0.8.25.dev code for os x and linux --- Telegram/SourceFiles/app.cpp | 6 +++++- Telegram/SourceFiles/history.cpp | 4 ++-- Telegram/SourceFiles/historywidget.cpp | 5 +++-- Telegram/SourceFiles/structs.cpp | 2 +- Telegram/SourceFiles/structs.h | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 38d7df1300..b4e755c4f1 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -381,7 +381,11 @@ namespace App { bool showPhone = !isServiceUser(data->id) && !(flags & (MTPDuser_flag_self | MTPDuser_flag_contact | MTPDuser_flag_mutual_contact)); QString pname = (showPhone && !data->phone.isEmpty()) ? formatPhone(data->phone) : QString(); data->setName(fname, lname, QString(), uname); - data->setPhoto(d.has_photo() ? d.vphoto : MTP_userProfilePhotoEmpty()); + if (d.has_photo()) { + data->setPhoto(d.vphoto); + } else { + data->setPhoto(MTP_userProfilePhotoEmpty()); + } if (d.has_access_hash()) data->access = d.vaccess_hash.v; status = d.has_status() ? &d.vstatus : &emptyStatus; } diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 4ac7c817c9..f4eba9340f 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -307,11 +307,11 @@ History::History(const PeerId &peerId) : width(0), height(0) , lastMsg(0) , activeMsgId(0) , draftToId(0) -, lastKeyboardId(0) -, lastKeyboardFrom(0) , lastWidth(0) , lastScrollTop(History::ScrollMax) , mute(isNotifyMuted(peer->notify)) +, lastKeyboardId(0) +, lastKeyboardFrom(0) , sendRequestId(0) , textCachedFor(0) , lastItemTextCache(st::dlgRichMinWidth) diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index f47960b824..2278d35fe0 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -1446,7 +1446,8 @@ void MessageField::focusInEvent(QFocusEvent *e) { emit focused(); } -BotKeyboard::BotKeyboard() : _wasForMsgId(0), _hoverAnim(animFunc(this, &BotKeyboard::hoverStep)), _st(&st::botKbButton), _sel(-1), _down(-1) { +BotKeyboard::BotKeyboard() : _wasForMsgId(0), +_sel(-1), _down(-1), _hoverAnim(animFunc(this, &BotKeyboard::hoverStep)), _st(&st::botKbButton) { setGeometry(0, 0, _st->margin, _st->margin); setMouseTracking(true); @@ -4343,7 +4344,7 @@ void HistoryWidget::addMessagesToBack(const QVector &messages) { void HistoryWidget::updateBotKeyboard() { bool changed = false; bool wasVisible = _kbShown; - if (_replyToId && !_replyTo || !hist) { + if ((_replyToId && !_replyTo) || !hist) { changed = _keyboard.updateMarkup(0); } else if (_replyTo) { changed = _keyboard.updateMarkup(_replyTo); diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 2ced16112c..56345676f6 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -224,7 +224,7 @@ void UserData::setBotInfo(const MTPBotInfo &info) { break; case mtpc_botInfo: { const MTPDbotInfo &d(info.c_botInfo()); - if (d.vuser_id.v != id) return; + if (App::peerFromUser(d.vuser_id.v) != id) return; if (botInfo) { botInfo->version = d.vversion.v; diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index 81157ab882..5c3af20f79 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -136,7 +136,7 @@ struct BotInfo { struct PhotoData; struct UserData : public PeerData { - UserData(const PeerId &id) : PeerData(id), lnk(new PeerLink(this)), photoId(0), onlineTill(0), contact(-1), photosCount(-1), botInfo(0) { + UserData(const PeerId &id) : PeerData(id), photoId(0), lnk(new PeerLink(this)), onlineTill(0), contact(-1), photosCount(-1), botInfo(0) { } void setPhoto(const MTPUserProfilePhoto &photo); void setName(const QString &first, const QString &last, const QString &phoneName, const QString &username);