mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 10:11:41 -05:00
Fix build for old OS X with Qt 5.3.2
This commit is contained in:
parent
80d9938e96
commit
6861059d18
5 changed files with 19 additions and 27 deletions
|
@ -395,9 +395,9 @@ bool History::updateSendActionNeedsAnimating(TimeMs ms, bool force) {
|
||||||
void ChannelHistory::getRangeDifference() {
|
void ChannelHistory::getRangeDifference() {
|
||||||
auto fromId = MsgId(0);
|
auto fromId = MsgId(0);
|
||||||
auto toId = MsgId(0);
|
auto toId = MsgId(0);
|
||||||
for (auto blockIndex = 0, blocksCount = blocks.size(); blockIndex < blocksCount; ++blockIndex) {
|
for (auto blockIndex = 0, blocksCount = int(blocks.size()); blockIndex < blocksCount; ++blockIndex) {
|
||||||
auto block = blocks[blockIndex];
|
auto block = blocks[blockIndex];
|
||||||
for (auto itemIndex = 0, itemsCount = block->items.size(); itemIndex < itemsCount; ++itemIndex) {
|
for (auto itemIndex = 0, itemsCount = int(block->items.size()); itemIndex < itemsCount; ++itemIndex) {
|
||||||
auto item = block->items[itemIndex];
|
auto item = block->items[itemIndex];
|
||||||
if (item->id > 0) {
|
if (item->id > 0) {
|
||||||
fromId = item->id;
|
fromId = item->id;
|
||||||
|
@ -518,7 +518,7 @@ void ChannelHistory::checkJoinedMessage(bool createUnread) {
|
||||||
|
|
||||||
QDateTime inviteDate = peer->asChannel()->inviteDate;
|
QDateTime inviteDate = peer->asChannel()->inviteDate;
|
||||||
QDateTime firstDate, lastDate;
|
QDateTime firstDate, lastDate;
|
||||||
if (!blocks.isEmpty()) {
|
if (!blocks.empty()) {
|
||||||
firstDate = blocks.front()->items.front()->date;
|
firstDate = blocks.front()->items.front()->date;
|
||||||
lastDate = blocks.back()->items.back()->date;
|
lastDate = blocks.back()->items.back()->date;
|
||||||
}
|
}
|
||||||
|
@ -1418,7 +1418,7 @@ HistoryBlock *History::prepareBlockForAddingItem() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto addNewBlock = blocks.isEmpty() || (blocks.back()->items.size() >= kNewBlockEachMessage);
|
auto addNewBlock = blocks.empty() || (blocks.back()->items.size() >= kNewBlockEachMessage);
|
||||||
if (!addNewBlock) {
|
if (!addNewBlock) {
|
||||||
return blocks.back();
|
return blocks.back();
|
||||||
}
|
}
|
||||||
|
@ -1817,7 +1817,7 @@ void History::getNextShowFrom(HistoryBlock *block, int i) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto j = block->indexInHistory() + 1, s = blocks.size(); j < s; ++j) {
|
for (auto j = block->indexInHistory() + 1, s = int(blocks.size()); j < s; ++j) {
|
||||||
block = blocks[j];
|
block = blocks[j];
|
||||||
for_const (auto item, block->items) {
|
for_const (auto item, block->items) {
|
||||||
if (item->id > 0) {
|
if (item->id > 0) {
|
||||||
|
@ -1933,7 +1933,7 @@ HistoryItem *History::addNewInTheMiddle(HistoryItem *newItem, int32 blockIndex,
|
||||||
auto block = blocks[blockIndex];
|
auto block = blocks[blockIndex];
|
||||||
|
|
||||||
newItem->attachToBlock(block, itemIndex);
|
newItem->attachToBlock(block, itemIndex);
|
||||||
block->items.insert(itemIndex, newItem);
|
block->items.insert(block->items.begin() + itemIndex, newItem);
|
||||||
newItem->previousItemChanged();
|
newItem->previousItemChanged();
|
||||||
if (itemIndex + 1 < block->items.size()) {
|
if (itemIndex + 1 < block->items.size()) {
|
||||||
for (int i = itemIndex + 1, l = block->items.size(); i < l; ++i) {
|
for (int i = itemIndex + 1, l = block->items.size(); i < l; ++i) {
|
||||||
|
@ -2434,14 +2434,14 @@ void History::changeMsgId(MsgId oldId, MsgId newId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void History::removeBlock(HistoryBlock *block) {
|
void History::removeBlock(HistoryBlock *block) {
|
||||||
Expects(block->items.isEmpty());
|
Expects(block->items.empty());
|
||||||
|
|
||||||
if (_buildingFrontBlock && block == _buildingFrontBlock->block) {
|
if (_buildingFrontBlock && block == _buildingFrontBlock->block) {
|
||||||
_buildingFrontBlock->block = nullptr;
|
_buildingFrontBlock->block = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = block->indexInHistory();
|
int index = block->indexInHistory();
|
||||||
blocks.removeAt(index);
|
blocks.erase(blocks.begin() + index);
|
||||||
if (index < blocks.size()) {
|
if (index < blocks.size()) {
|
||||||
for (int i = index, l = blocks.size(); i < l; ++i) {
|
for (int i = index, l = blocks.size(); i < l; ++i) {
|
||||||
blocks[i]->setIndexInHistory(i);
|
blocks[i]->setIndexInHistory(i);
|
||||||
|
@ -2503,11 +2503,11 @@ void HistoryBlock::removeItem(HistoryItem *item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
item->detachFast();
|
item->detachFast();
|
||||||
items.remove(itemIndex);
|
items.erase(items.begin() + itemIndex);
|
||||||
for (auto i = itemIndex, l = items.size(); i < l; ++i) {
|
for (auto i = itemIndex, l = int(items.size()); i < l; ++i) {
|
||||||
items[i]->setIndexInBlock(i);
|
items[i]->setIndexInBlock(i);
|
||||||
}
|
}
|
||||||
if (items.isEmpty()) {
|
if (items.empty()) {
|
||||||
_history->removeBlock(this);
|
_history->removeBlock(this);
|
||||||
} else if (itemIndex < items.size()) {
|
} else if (itemIndex < items.size()) {
|
||||||
items[itemIndex]->previousItemChanged();
|
items[itemIndex]->previousItemChanged();
|
||||||
|
@ -2517,7 +2517,7 @@ void HistoryBlock::removeItem(HistoryItem *item) {
|
||||||
_history->blocks.back()->items.back()->nextItemChanged();
|
_history->blocks.back()->items.back()->nextItemChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (items.isEmpty()) {
|
if (items.empty()) {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,7 +216,7 @@ public:
|
||||||
History *migrateFrom() const;
|
History *migrateFrom() const;
|
||||||
|
|
||||||
bool isEmpty() const {
|
bool isEmpty() const {
|
||||||
return blocks.isEmpty();
|
return blocks.empty();
|
||||||
}
|
}
|
||||||
bool isDisplayedEmpty() const;
|
bool isDisplayedEmpty() const;
|
||||||
|
|
||||||
|
@ -376,7 +376,7 @@ public:
|
||||||
void eraseFromUnreadMentions(MsgId msgId);
|
void eraseFromUnreadMentions(MsgId msgId);
|
||||||
void addUnreadMentionsSlice(const MTPmessages_Messages &result);
|
void addUnreadMentionsSlice(const MTPmessages_Messages &result);
|
||||||
|
|
||||||
using Blocks = QList<HistoryBlock*>;
|
using Blocks = std::deque<HistoryBlock*>;
|
||||||
Blocks blocks;
|
Blocks blocks;
|
||||||
|
|
||||||
int width = 0;
|
int width = 0;
|
||||||
|
@ -658,7 +658,7 @@ public:
|
||||||
HistoryBlock(const HistoryBlock &) = delete;
|
HistoryBlock(const HistoryBlock &) = delete;
|
||||||
HistoryBlock &operator=(const HistoryBlock &) = delete;
|
HistoryBlock &operator=(const HistoryBlock &) = delete;
|
||||||
|
|
||||||
QVector<HistoryItem*> items;
|
std::vector<HistoryItem*> items;
|
||||||
|
|
||||||
void clear(bool leaveItems = false);
|
void clear(bool leaveItems = false);
|
||||||
~HistoryBlock() {
|
~HistoryBlock() {
|
||||||
|
|
|
@ -988,7 +988,7 @@ protected:
|
||||||
return _block->items.at(_indexInBlock - 1);
|
return _block->items.at(_indexInBlock - 1);
|
||||||
}
|
}
|
||||||
if (auto previous = _block->previousBlock()) {
|
if (auto previous = _block->previousBlock()) {
|
||||||
Assert(!previous->items.isEmpty());
|
Assert(!previous->items.empty());
|
||||||
return previous->items.back();
|
return previous->items.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1000,7 +1000,7 @@ protected:
|
||||||
return _block->items.at(_indexInBlock + 1);
|
return _block->items.at(_indexInBlock + 1);
|
||||||
}
|
}
|
||||||
if (auto next = _block->nextBlock()) {
|
if (auto next = _block->nextBlock()) {
|
||||||
Assert(!next->items.isEmpty());
|
Assert(!next->items.empty());
|
||||||
return next->items.front();
|
return next->items.front();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,14 +30,6 @@ namespace CommonGroups {
|
||||||
InnerWidget::InnerWidget(QWidget *parent, not_null<UserData*> user)
|
InnerWidget::InnerWidget(QWidget *parent, not_null<UserData*> user)
|
||||||
: RpWidget(parent)
|
: RpWidget(parent)
|
||||||
, _user(user) {
|
, _user(user) {
|
||||||
base::lambda<void(int)> launch = [this, &launch](int counter) {
|
|
||||||
QTimer::singleShot(500, this, [this, launch, counter] {
|
|
||||||
_rowsHeightFake += 300;
|
|
||||||
resizeToWidth(width(), _minHeight);
|
|
||||||
launch(counter - 1);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
launch(10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InnerWidget::visibleTopBottomUpdated(
|
void InnerWidget::visibleTopBottomUpdated(
|
||||||
|
|
|
@ -539,7 +539,7 @@ public:
|
||||||
details::is_specific_handlers_v<Value, Error, Handlers>>>
|
details::is_specific_handlers_v<Value, Error, Handlers>>>
|
||||||
consumer &operator=(
|
consumer &operator=(
|
||||||
const details::consumer_base<Value, Error, Handlers> &other) {
|
const details::consumer_base<Value, Error, Handlers> &other) {
|
||||||
_handlers = other._handlers;
|
this->_handlers = other._handlers;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,7 +549,7 @@ public:
|
||||||
details::is_specific_handlers_v<Value, Error, Handlers>>>
|
details::is_specific_handlers_v<Value, Error, Handlers>>>
|
||||||
consumer &operator=(
|
consumer &operator=(
|
||||||
details::consumer_base<Value, Error, Handlers> &&other) {
|
details::consumer_base<Value, Error, Handlers> &&other) {
|
||||||
_handlers = std::move(other._handlers);
|
this->_handlers = std::move(other._handlers);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue