2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

stopping gifs on history close, only one gif playing

This commit is contained in:
John Preston
2015-12-16 16:35:15 +03:00
parent 7f6f92ac85
commit 29a7c66e45
11 changed files with 48 additions and 46 deletions

View File

@@ -2428,6 +2428,7 @@ namespace App {
}
void regGifItem(ClipReader *reader, HistoryItem *item) {
stopGifItems();
::gifItems.insert(reader, item);
}
@@ -2439,6 +2440,16 @@ namespace App {
return ::gifItems;
}
void stopGifItems() {
while (!::gifItems.isEmpty()) {
if (HistoryItem *playing = ::gifItems.begin().value()) {
if (playing->getMedia() && playing->getMedia()->type() == MediaTypeGif) {
static_cast<HistoryGif*>(playing->getMedia())->stop(playing);
}
}
}
}
QString phoneFromSharedContact(int32 userId) {
SharedContactItems::const_iterator i = ::sharedContactItems.constFind(userId);
if (i != ::sharedContactItems.cend()) {