fixed code for old Qt versions
This commit is contained in:
		
							parent
							
								
									5502f2503f
								
							
						
					
					
						commit
						de8ffc78d7
					
				
					 4 changed files with 10 additions and 5 deletions
				
			
		| 
						 | 
					@ -762,7 +762,8 @@ void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (pack.isEmpty()) {
 | 
						if (pack.isEmpty()) {
 | 
				
			||||||
		cRefStickerSetsOrder().removeOne(setId);
 | 
							int32 removeIndex = cStickerSetsOrder().indexOf(setId);
 | 
				
			||||||
 | 
							if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex);
 | 
				
			||||||
		sets.erase(it);
 | 
							sets.erase(it);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		it->stickers = pack;
 | 
							it->stickers = pack;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -105,7 +105,8 @@ void StickerSetInner::installDone(const MTPBool &result) {
 | 
				
			||||||
	StickerSets::iterator custom = sets.find(CustomStickerSetId);
 | 
						StickerSets::iterator custom = sets.find(CustomStickerSetId);
 | 
				
			||||||
	if (custom != sets.cend()) {
 | 
						if (custom != sets.cend()) {
 | 
				
			||||||
		for (int32 i = 0, l = _pack.size(); i < l; ++i) {
 | 
							for (int32 i = 0, l = _pack.size(); i < l; ++i) {
 | 
				
			||||||
			custom->stickers.removeOne(_pack.at(i));
 | 
								int32 removeIndex = custom->stickers.indexOf(_pack.at(i));
 | 
				
			||||||
 | 
								if (removeIndex >= 0) custom->stickers.removeAt(removeIndex);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (custom->stickers.isEmpty()) {
 | 
							if (custom->stickers.isEmpty()) {
 | 
				
			||||||
			sets.erase(custom);
 | 
								sets.erase(custom);
 | 
				
			||||||
| 
						 | 
					@ -846,7 +847,8 @@ void StickersBox::onSave() {
 | 
				
			||||||
					it->flags |= MTPDstickerSet::flag_disabled;
 | 
										it->flags |= MTPDstickerSet::flag_disabled;
 | 
				
			||||||
				} else {
 | 
									} else {
 | 
				
			||||||
					_disenableRequests.insert(MTP::send(MTPmessages_UninstallStickerSet(setId), rpcDone(&StickersBox::disenableDone), rpcFail(&StickersBox::disenableFail), 0, 5), NullType());
 | 
										_disenableRequests.insert(MTP::send(MTPmessages_UninstallStickerSet(setId), rpcDone(&StickersBox::disenableDone), rpcFail(&StickersBox::disenableFail), 0, 5), NullType());
 | 
				
			||||||
					cRefStickerSetsOrder().removeOne(it->id);
 | 
										int32 removeIndex = cStickerSetsOrder().indexOf(it->id);
 | 
				
			||||||
 | 
										if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex);
 | 
				
			||||||
					sets.erase(it);
 | 
										sets.erase(it);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2668,7 +2668,8 @@ void EmojiPan::onRemoveSetSure() {
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		cRefStickerSets().erase(it);
 | 
							cRefStickerSets().erase(it);
 | 
				
			||||||
		cRefStickerSetsOrder().removeOne(_removingSetId);
 | 
							int32 removeIndex = cStickerSetsOrder().indexOf(_removingSetId);
 | 
				
			||||||
 | 
							if (removeIndex >= 0) cRefStickerSetsOrder().removeAt(removeIndex);
 | 
				
			||||||
		cSetStickersHash(stickersCountHash());
 | 
							cSetStickersHash(stickersCountHash());
 | 
				
			||||||
		refreshStickers();
 | 
							refreshStickers();
 | 
				
			||||||
		Local::writeStickers();
 | 
							Local::writeStickers();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4626,7 +4626,8 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
 | 
				
			||||||
				StickerSets::iterator custom = sets.find(CustomStickerSetId);
 | 
									StickerSets::iterator custom = sets.find(CustomStickerSetId);
 | 
				
			||||||
				if (custom != sets.cend()) {
 | 
									if (custom != sets.cend()) {
 | 
				
			||||||
					for (int32 i = 0, l = pack.size(); i < l; ++i) {
 | 
										for (int32 i = 0, l = pack.size(); i < l; ++i) {
 | 
				
			||||||
						custom->stickers.removeOne(pack.at(i));
 | 
											int32 removeIndex = custom->stickers.indexOf(pack.at(i));
 | 
				
			||||||
 | 
											if (removeIndex >= 0) custom->stickers.removeAt(removeIndex);
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
					if (custom->stickers.isEmpty()) {
 | 
										if (custom->stickers.isEmpty()) {
 | 
				
			||||||
						sets.erase(custom);
 | 
											sets.erase(custom);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue