Mercurial > minori
comparison src/gui/widgets/poster.cc @ 286:53e3c015a973
anime: initial cross-service support
currently the Kitsu and MAL services don't work when chosen in the
GUI. This is because they haven't been implemented yet :)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Wed, 08 May 2024 16:44:27 -0400 |
parents | f31305b9f60a |
children | 9a88e1725fd2 |
comparison
equal
deleted
inserted
replaced
285:65df2813d0de | 286:53e3c015a973 |
---|---|
42 connect(thread, &HTTP::GetThread::finished, thread, &HTTP::GetThread::deleteLater); | 42 connect(thread, &HTTP::GetThread::finished, thread, &HTTP::GetThread::deleteLater); |
43 | 43 |
44 thread->start(); | 44 thread->start(); |
45 } | 45 } |
46 | 46 |
47 service_url_ = Strings::ToQString(anime.GetServiceUrl()); | 47 std::optional<std::string> url = anime.GetServiceUrl(session.config.service); |
48 if (url) | |
49 service_url_ = Strings::ToQString(url.value()); | |
48 | 50 |
49 if (clickable_) { | 51 if (clickable_) { |
50 label_.disconnect(); | 52 label_.disconnect(); |
51 connect(&label_, &ClickableLabel::clicked, this, [this] { QDesktopServices::openUrl(service_url_); }); | 53 connect(&label_, &ClickableLabel::clicked, this, [this] { QDesktopServices::openUrl(service_url_); }); |
52 } | 54 } |