This commit is contained in:
John Preston
2016-03-24 20:31:55 +03:00
11 changed files with 141 additions and 25 deletions
+5 -5
View File
@@ -2447,9 +2447,10 @@ void History::clearOnDestroy() {
}
QPair<int32, int32> History::adjustByPosInChatsList(DialogsIndexed &indexed) {
int32 movedFrom = _chatListLinks[0]->pos * st::dlgHeight;
DialogRow *lnk = mainChatListLink();
int32 movedFrom = lnk->pos * st::dlgHeight;
indexed.adjustByPos(_chatListLinks);
int32 movedTo = _chatListLinks[0]->pos * st::dlgHeight;
int32 movedTo = lnk->pos * st::dlgHeight;
return qMakePair(movedFrom, movedTo);
}
@@ -2461,8 +2462,7 @@ DialogRow *History::addToChatList(DialogsIndexed &indexed) {
if (App::wnd()) App::wnd()->updateCounter();
}
}
t_assert(!_chatListLinks.isEmpty());
return _chatListLinks[0];
return mainChatListLink();
}
void History::removeFromChatList(DialogsIndexed &indexed) {
@@ -2493,7 +2493,7 @@ void History::addChatListEntryByLetter(QChar letter, DialogRow *row) {
void History::updateChatListEntry() const {
if (MainWidget *m = App::main()) {
if (inChatList()) {
m->dlgUpdated(_chatListLinks[0]);
m->dlgUpdated(mainChatListLink());
}
}
}
+6 -2
View File
@@ -293,8 +293,7 @@ public:
return !_chatListLinks.isEmpty();
}
int32 posInChatList() const {
t_assert(inChatList());
return _chatListLinks[0]->pos;
return mainChatListLink()->pos;
}
DialogRow *addToChatList(DialogsIndexed &indexed);
void removeFromChatList(DialogsIndexed &indexed);
@@ -488,6 +487,11 @@ private:
Flags _flags;
ChatListLinksMap _chatListLinks;
DialogRow *mainChatListLink() const {
auto it = _chatListLinks.constFind(0);
t_assert(it != _chatListLinks.cend());
return it.value();
}
uint64 _sortKeyInChatList; // like ((unixtime) << 32) | (incremented counter)
typedef QMap<MsgId, NullType> MediaOverviewIds;
+4
View File
@@ -19,6 +19,9 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "logs.h"
#include <signal.h>
#include "pspecific.h"
@@ -34,6 +37,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#elif defined Q_OS_MAC // Q_OS_WIN
#include <unistd.h>
#ifdef MAC_USE_BREAKPAD
#include "client/mac/handler/exception_handler.h"
#else // MAC_USE_BREAKPAD
+1 -1
View File
@@ -173,7 +173,7 @@ private:
bool _needSessionReset;
void resetSession();
uint32 dc;
ShiftedDcId dc;
Connection *_owner;
AbstractConnection *_conn, *_conn4, *_conn6;
@@ -29,6 +29,9 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
namespace MTP {
namespace internal {
AbstractConnection::~AbstractConnection() {
}
mtpBuffer AbstractConnection::preparePQFake(const MTPint128 &nonce) {
MTPReq_pq req_pq(nonce);
mtpBuffer buffer;
@@ -35,8 +35,7 @@ public:
}
AbstractConnection(const AbstractConnection &other) = delete;
AbstractConnection &operator=(const AbstractConnection &other) = delete;
virtual ~AbstractConnection() = 0 {
}
virtual ~AbstractConnection() = 0;
// virtual constructor
static AbstractConnection *create(QThread *thread);
@@ -49,6 +49,9 @@ AbstractTCPConnection::AbstractTCPConnection(QThread *thread) : AbstractConnecti
, currentPos((char*)shortBuffer) {
}
AbstractTCPConnection::~AbstractTCPConnection() {
}
void AbstractTCPConnection::socketRead() {
if (sock.state() != QAbstractSocket::ConnectedState) {
LOG(("MTP error: socket not connected in socketRead(), state: %1").arg(sock.state()));
@@ -33,8 +33,7 @@ class AbstractTCPConnection : public AbstractConnection {
public:
AbstractTCPConnection(QThread *thread);
virtual ~AbstractTCPConnection() = 0 {
}
virtual ~AbstractTCPConnection() = 0;
public slots:
+1 -1
View File
@@ -945,7 +945,7 @@ struct MTPStringLogger {
char *b = new char[newsize];
memcpy(b, p, size);
alloced = newsize;
delete p;
delete[] p;
p = b;
}
char *p;