Merge branch 'master' of https://github.com/fourtf/chatterino2
This commit is contained in:
@@ -47,6 +47,18 @@ public:
|
||||
return LayoutCreator<T2>(t);
|
||||
}
|
||||
|
||||
template <typename T2, typename Q = T,
|
||||
typename std::enable_if<std::is_base_of<QWidget, Q>::value, int>::type = 0,
|
||||
typename std::enable_if<std::is_base_of<QLayout, T2>::value, int>::type = 0>
|
||||
LayoutCreator<T2> setLayoutType()
|
||||
{
|
||||
T2 *layout = new T2;
|
||||
|
||||
this->item->setLayout(layout);
|
||||
|
||||
return LayoutCreator<T2>(layout);
|
||||
}
|
||||
|
||||
LayoutCreator<T> assign(T **ptr)
|
||||
{
|
||||
*ptr = this->item;
|
||||
|
||||
@@ -37,14 +37,14 @@ static void get(QString url, const QObject *caller,
|
||||
});
|
||||
}
|
||||
|
||||
static void get2(QString url, const QObject *caller,
|
||||
static void get2(QString url, const QObject *caller, bool useQuickLoadCache,
|
||||
std::function<void(const rapidjson::Document &)> successCallback)
|
||||
{
|
||||
util::NetworkRequest req(url);
|
||||
req.setCaller(caller);
|
||||
req.setRawHeader("Client-ID", getDefaultClientID());
|
||||
req.setRawHeader("Accept", "application/vnd.twitchtv.v5+json");
|
||||
req.setUseQuickLoadCache(true);
|
||||
req.setUseQuickLoadCache(useQuickLoadCache);
|
||||
|
||||
req.getJSON2([=](const rapidjson::Document &document) {
|
||||
successCallback(document); //
|
||||
|
||||
Reference in New Issue
Block a user