some fixes for mac build, 0.8.58.dev version

This commit is contained in:
John Preston 2015-09-22 13:19:57 +03:00
parent 776688383c
commit b3cb6fc317
10 changed files with 16 additions and 15 deletions

View file

@ -681,7 +681,7 @@ void Application::checkMapVersion() {
if (Local::oldMapVersion()) { if (Local::oldMapVersion()) {
QString versionFeatures; QString versionFeatures;
if (cDevVersion() && Local::oldMapVersion() < 8058) { if (cDevVersion() && Local::oldMapVersion() < 8058) {
versionFeatures = QString::fromUtf8("\xe2\x80\x94 Limited channels support added, see https://telegram.org/blog/channels\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); versionFeatures = QString::fromUtf8("\xe2\x80\x94 Limited channels support added\n\xe2\x80\x94 Bug fixes and other minor improvements\n\nMore info about channels here:\nhttps://telegram.org/blog/channels");// .replace('@', qsl("@") + QChar(0x200D));
} else if (Local::oldMapVersion() < 8056) { } else if (Local::oldMapVersion() < 8056) {
versionFeatures = lang(lng_new_version_text).trimmed(); versionFeatures = lang(lng_new_version_text).trimmed();
} else { } else {

View file

@ -734,8 +734,8 @@ void ContactsInner::peopleReceived(const QString &query, const QVector<MTPPeer>
PeerData *p = App::peer(peerId); PeerData *p = App::peer(peerId);
if (!p) continue; if (!p) continue;
if ((!p->isUser() || p->asUser()->botInfo && p->asUser()->botInfo->cantJoinGroups) && (_chat || _creating != CreatingGroupNone)) continue; // skip bot's that can't be invited to groups if ((!p->isUser() || (p->asUser()->botInfo && p->asUser()->botInfo->cantJoinGroups)) && (_chat || _creating != CreatingGroupNone)) continue; // skip bot's that can't be invited to groups
if (p->isUser() && p->asUser()->botInfo && _creating == CreatingGroupChannel) continue; // skip bots in channels if (p->isUser() && p->asUser()->botInfo && _channel) continue; // skip bots in channels
ContactData *d = new ContactData(); ContactData *d = new ContactData();
_byUsernameDatas.push_back(d); _byUsernameDatas.push_back(d);

View file

@ -434,8 +434,8 @@ a_placeholderFg(st.placeholderFg->c),
_placeholderFgAnim(animFunc(this, &InputField::placeholderFgStep)), _placeholderFgAnim(animFunc(this, &InputField::placeholderFgStep)),
_placeholderShiftAnim(animFunc(this, &InputField::placeholderShiftStep)), _placeholderShiftAnim(animFunc(this, &InputField::placeholderShiftStep)),
a_borderFg(st.borderFg->c),
a_borderOpacityActive(0), a_borderOpacityActive(0),
a_borderFg(st.borderFg->c),
_borderAnim(animFunc(this, &InputField::borderStep)), _borderAnim(animFunc(this, &InputField::borderStep)),
_focused(false), _error(false), _focused(false), _error(false),

View file

@ -7384,7 +7384,7 @@ QString HistoryServiceMsg::inReplyText() const {
return result.trimmed().startsWith(from()->name) ? result.trimmed().mid(from()->name.size()).trimmed() : result; return result.trimmed().startsWith(from()->name) ? result.trimmed().mid(from()->name.size()).trimmed() : result;
} }
void HistoryServiceMsg::setText(const QString &text) { void HistoryServiceMsg::setServiceText(const QString &text) {
_text.setText(st::msgServiceFont, text, _historySrvOptions); _text.setText(st::msgServiceFont, text, _historySrvOptions);
initDimensions(); initDimensions();
} }
@ -7600,7 +7600,7 @@ bool HistoryGroup::decrementCount() {
} }
void HistoryGroup::updateText() { void HistoryGroup::updateText() {
setText(lng_channel_comments_count(lt_count, _count)/* + qsl(" (%1 .. %2)").arg(_minId).arg(_maxId)*/); setServiceText(lng_channel_comments_count(lt_count, _count)/* + qsl(" (%1 .. %2)").arg(_minId).arg(_maxId)*/);
} }
HistoryCollapse::HistoryCollapse(History *history, HistoryBlock *block, MsgId wasMinId, const QDateTime &date) : HistoryCollapse::HistoryCollapse(History *history, HistoryBlock *block, MsgId wasMinId, const QDateTime &date) :
@ -7618,7 +7618,7 @@ void HistoryCollapse::getState(TextLinkPtr &lnk, HistoryCursorState &state, int3
HistoryJoined::HistoryJoined(History *history, HistoryBlock *block, const QDateTime &inviteDate, UserData *inviter, int32 flags) : HistoryJoined::HistoryJoined(History *history, HistoryBlock *block, const QDateTime &inviteDate, UserData *inviter, int32 flags) :
HistoryServiceMsg(history, block, clientMsgId(), inviteDate, QString(), flags) { HistoryServiceMsg(history, block, clientMsgId(), inviteDate, QString(), flags) {
if (inviter->id == MTP::authedId()) { if (peerToUser(inviter->id) == MTP::authedId()) {
_text.setText(st::msgServiceFont, lang(lng_action_you_joined), _historySrvOptions); _text.setText(st::msgServiceFont, lang(lng_action_you_joined), _historySrvOptions);
} else { } else {
_text.setText(st::msgServiceFont, lng_action_add_you(lt_from, textcmdLink(1, inviter->name)), _historySrvOptions); _text.setText(st::msgServiceFont, lng_action_add_you(lt_from, textcmdLink(1, inviter->name)), _historySrvOptions);

View file

@ -1742,7 +1742,7 @@ public:
return _media ? _media->animating() : false; return _media ? _media->animating() : false;
} }
void setText(const QString &text); void setServiceText(const QString &text);
~HistoryServiceMsg(); ~HistoryServiceMsg();

View file

@ -2302,8 +2302,8 @@ HistoryWidget::HistoryWidget(QWidget *parent) : TWidget(parent)
, _replyReturn(0) , _replyReturn(0)
, _stickersUpdateRequest(0) , _stickersUpdateRequest(0)
, _peer(0) , _peer(0)
, _channel(NoChannel)
, _clearPeer(0) , _clearPeer(0)
, _channel(NoChannel)
, _showAtMsgId(0) , _showAtMsgId(0)
, _fixedInScrollMsgId(0) , _fixedInScrollMsgId(0)
, _fixedInScrollMsgTop(0) , _fixedInScrollMsgTop(0)

View file

@ -47,8 +47,8 @@ ProfileInner::ProfileInner(ProfileWidget *profile, ScrollArea *scroll, const Pee
_invitationLink(this, qsl("telegram.me/joinchat/")), _invitationLink(this, qsl("telegram.me/joinchat/")),
_botSettings(this, lang(lng_profile_bot_settings)), _botSettings(this, lang(lng_profile_bot_settings)),
_botHelp(this, lang(lng_profile_bot_help)), _botHelp(this, lang(lng_profile_bot_help)),
_editLink(this, lang((_peerChannel && _peerChannel->isPublic()) ? lng_profile_edit_public_link : lng_profile_create_public_link)),
_username(this, qsl("https://telegram.me/") + (_peerChannel ? _peerChannel->username : QString())), _username(this, qsl("https://telegram.me/") + (_peerChannel ? _peerChannel->username : QString())),
_editLink(this, lang((_peerChannel && _peerChannel->isPublic()) ? lng_profile_edit_public_link : lng_profile_create_public_link)),
// about // about
_about(st::wndMinWidth - st::profilePadding.left() - st::profilePadding.right()), _about(st::wndMinWidth - st::profilePadding.left() - st::profilePadding.right()),

View file

@ -69,7 +69,7 @@ void MacPrivate::notifyClicked(unsigned long long peer, int msgid) {
App::wnd()->notifyClear(); App::wnd()->notifyClear();
} else { } else {
App::wnd()->hideSettings(); App::wnd()->hideSettings();
bool tomsg = history->peer->chat && (msgid > 0); bool tomsg = !history->peer->isUser() && (msgid > 0);
if (tomsg) { if (tomsg) {
HistoryItem *item = App::histItemById(peerToChannel(PeerId(peer)), MsgId(msgid)); HistoryItem *item = App::histItemById(peerToChannel(PeerId(peer)), MsgId(msgid));
if (!item || !item->notifyByFrom()) { if (!item || !item->notifyByFrom()) {
@ -84,12 +84,12 @@ void MacPrivate::notifyClicked(unsigned long long peer, int msgid) {
void MacPrivate::notifyReplied(unsigned long long peer, int msgid, const char *str) { void MacPrivate::notifyReplied(unsigned long long peer, int msgid, const char *str) {
History *history = App::history(PeerId(peer)); History *history = App::history(PeerId(peer));
App::main()->sendMessage(history, QString::fromUtf8(str), (msgid > 0 && history->peer->chat) ? msgid : 0, false); App::main()->sendMessage(history, QString::fromUtf8(str), (msgid > 0 && !history->peer->isUser()) ? msgid : 0, false);
} }
PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent), PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent),
posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(qsl(":/gui/art/iconbig256.png")), wndIcon(QPixmap::fromImage(iconbig256, Qt::ColorOnly)), posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(qsl(":/gui/art/iconbig256.png")), wndIcon(QPixmap::fromImage(iconbig256, Qt::ColorOnly)),
psLogout(0), psUndo(0), psRedo(0), psCut(0), psCopy(0), psPaste(0), psDelete(0), psSelectAll(0), psContacts(0), psAddContact(0), psNewGroup(0), psShowTelegram(0) { psLogout(0), psUndo(0), psRedo(0), psCut(0), psCopy(0), psPaste(0), psDelete(0), psSelectAll(0), psContacts(0), psAddContact(0), psNewGroup(0), psNewChannel(0), psShowTelegram(0) {
QImage tray(qsl(":/gui/art/osxtray.png")); QImage tray(qsl(":/gui/art/osxtray.png"));
trayImg = tray.copy(0, cRetina() ? 0 : tray.width() / 2, tray.width() / (cRetina() ? 2 : 4), tray.width() / (cRetina() ? 2 : 4)); trayImg = tray.copy(0, cRetina() ? 0 : tray.width() / 2, tray.width() / (cRetina() ? 2 : 4), tray.width() / (cRetina() ? 2 : 4));
trayImgSel = tray.copy(tray.width() / (cRetina() ? 2 : 4), cRetina() ? 0 : tray.width() / 2, tray.width() / (cRetina() ? 2 : 4), tray.width() / (cRetina() ? 2 : 4)); trayImgSel = tray.copy(tray.width() / (cRetina() ? 2 : 4), cRetina() ? 0 : tray.width() / 2, tray.width() / (cRetina() ? 2 : 4), tray.width() / (cRetina() ? 2 : 4));
@ -444,6 +444,7 @@ void PsMainWindow::psMacUpdateMenu() {
_forceDisabled(psContacts, !isLogged || App::passcoded()); _forceDisabled(psContacts, !isLogged || App::passcoded());
_forceDisabled(psAddContact, !isLogged || App::passcoded()); _forceDisabled(psAddContact, !isLogged || App::passcoded());
_forceDisabled(psNewGroup, !isLogged || App::passcoded()); _forceDisabled(psNewGroup, !isLogged || App::passcoded());
_forceDisabled(psNewChannel, !isLogged || App::passcoded());
_forceDisabled(psShowTelegram, App::wnd()->isActive(false)); _forceDisabled(psShowTelegram, App::wnd()->isActive(false));
} }

View file

@ -136,7 +136,7 @@ private:
mutable QTimer psIdleTimer; mutable QTimer psIdleTimer;
QMenuBar psMainMenu; QMenuBar psMainMenu;
QAction *psLogout, *psUndo, *psRedo, *psCut, *psCopy, *psPaste, *psDelete, *psSelectAll, *psContacts, *psAddContact, *psNewGroup, *psShowTelegram; QAction *psLogout, *psUndo, *psRedo, *psCut, *psCopy, *psPaste, *psDelete, *psSelectAll, *psContacts, *psAddContact, *psNewGroup, *psNewChannel, *psShowTelegram;
}; };

View file

@ -311,7 +311,7 @@ DeclareSetting(int, OtherOnline);
DeclareSetting(float64, SongVolume); DeclareSetting(float64, SongVolume);
struct PeerData; class PeerData;
typedef QMap<PeerData*, QDateTime> SavedPeers; typedef QMap<PeerData*, QDateTime> SavedPeers;
typedef QMultiMap<QDateTime, PeerData*> SavedPeersByTime; typedef QMultiMap<QDateTime, PeerData*> SavedPeersByTime;
DeclareRefSetting(SavedPeers, SavedPeers); DeclareRefSetting(SavedPeers, SavedPeers);