icon in search in supergroup fixed, edit button for supergroup admins added, crash fix in cached image loading

This commit is contained in:
John Preston 2015-11-23 19:05:30 +03:00
parent 46df0f32c8
commit e5c82fad21
4 changed files with 17 additions and 8 deletions

View File

@ -302,7 +302,7 @@ void DialogsInner::searchInPeerPaint(Painter &p, int32 w, bool onlyBackground) c
QRect rectForName(nameleft, st::dlgPaddingVer + st::dlgNameTop, namewidth, st::msgNameFont->height);
// draw chat icon
if (_searchInPeer->isChat()) {
if (_searchInPeer->isChat() || _searchInPeer->isMegagroup()) {
p.drawPixmap(QPoint(rectForName.left() + st::dlgChatImgPos.x(), rectForName.top() + st::dlgChatImgPos.y()), App::sprite(), st::dlgChatImg);
rectForName.setLeft(rectForName.left() + st::dlgImgSkip);
} else if (_searchInPeer->isChannel()) {

View File

@ -75,11 +75,20 @@ void TaskQueue::wakeThread() {
}
void TaskQueue::cancelTask(TaskId id) {
QMutexLocker lock(&_tasksToProcessMutex);
for (int32 i = 0, l = _tasksToProcess.size(); i < l; ++i) {
if (_tasksToProcess.at(i)->id() == id) {
_tasksToProcess.removeAt(i);
break;
{
QMutexLocker lock(&_tasksToProcessMutex);
for (int32 i = 0, l = _tasksToProcess.size(); i != l; ++i) {
if (_tasksToProcess.at(i)->id() == id) {
_tasksToProcess.removeAt(i);
return;
}
}
}
QMutexLocker lock(&_tasksToFinishMutex);
for (int32 i = 0, l = _tasksToFinish.size(); i != l; ++i) {
if (_tasksToFinish.at(i)->id() == id) {
_tasksToFinish.removeAt(i);
return;
}
}
}

View File

@ -318,7 +318,7 @@ void TopBarWidget::showAll() {
_forward.hide();
_mediaType.hide();
} else {
if (p && p->isChannel() && p->asChannel()->amCreator()) {
if (p && p->isChannel() && (p->asChannel()->amCreator() || (p->isMegagroup() && p->asChannel()->amEditor()))) {
_edit.show();
} else {
_edit.hide();

View File

@ -1265,7 +1265,7 @@ void ProfileInner::resizeEvent(QResizeEvent *e) {
_members.move(_left + st::profilePhotoSize + st::profileStatusLeft, top + addbyname + st::profileStatusTop);
addbyname += st::profileStatusTop + st::linkFont->ascent - (st::profileNameTop + st::profileNameFont->ascent);
_admins.move(_left + st::profilePhotoSize + st::profileStatusLeft, top + addbyname + st::profileStatusTop);
if (_amCreator) {
if ((_peerChat && _amCreator && _peerChat->canEdit()) || (_peerChannel && (_amCreator || _peerChannel->amEditor() || _peerChannel->amModerator()))) {
_cancelPhoto.move(_left + _width - _cancelPhoto.width(), top + st::profilePhotoSize - st::linkFont->height);
} else {
_cancelPhoto.move(_left + _width - _cancelPhoto.width(), top + st::profilePhoneTop);