Mercurial > minori
comparison src/gui/widgets/poster.cc @ 232:ff0061e75f0f
theme: add OS detection with glib
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sat, 13 Jan 2024 11:06:16 -0500 |
parents | 2f5a9247e501 |
children | 4d461ef7d424 |
comparison
equal
deleted
inserted
replaced
231:69f4768a820c | 232:ff0061e75f0f |
---|---|
34 SetAnime(anime); | 34 SetAnime(anime); |
35 } | 35 } |
36 | 36 |
37 void Poster::SetAnime(const Anime::Anime& anime) { | 37 void Poster::SetAnime(const Anime::Anime& anime) { |
38 { | 38 { |
39 QByteArray ba; | 39 QByteArray* ba = new QByteArray; |
40 | 40 |
41 QThread* thread = QThread::create([&] { | 41 QThread* thread = QThread::create([ba, anime] { |
42 ba = HTTP::Get(anime.GetPosterUrl(), {}); | 42 *ba = HTTP::Get(anime.GetPosterUrl(), {}); |
43 }); | 43 }); |
44 | 44 |
45 connect(thread, &QThread::finished, this, [&] { | 45 connect(thread, &QThread::finished, this, [this, ba] { |
46 ImageDownloadFinished(ba); | 46 ImageDownloadFinished(*ba); |
47 delete ba; | |
47 }); | 48 }); |
48 | 49 |
49 thread->start(); | 50 thread->start(); |
50 } | 51 } |
51 | 52 |