Remove UrlFetch file

This commit is contained in:
Rasmus Karlsson 2018-07-15 12:11:46 +00:00
parent f1af162dab
commit f60d649f5e
13 changed files with 16 additions and 54 deletions

View file

@ -256,7 +256,6 @@ HEADERS += \
src/common/ProviderId.hpp \
src/common/SerializeCustom.hpp \
src/common/SignalVectorModel.hpp \
src/common/UrlFetch.hpp \
src/common/Version.hpp \
src/controllers/accounts/Account.hpp \
src/controllers/accounts/AccountController.hpp \

View file

@ -1,36 +0,0 @@
#pragma once
#include "common/NetworkRequest.hpp"
#include <QObject>
#include <QString>
namespace chatterino {
// Not sure if I like these, but I'm trying them out
static NetworkRequest makeGetChannelRequest(const QString &channelId,
const QObject *caller = nullptr)
{
QString url("https://api.twitch.tv/kraken/channels/" + channelId);
auto request = NetworkRequest::twitchRequest(url);
request.setCaller(caller);
return request;
}
static NetworkRequest makeGetStreamRequest(const QString &channelId,
const QObject *caller = nullptr)
{
QString url("https://api.twitch.tv/kraken/streams/" + channelId);
auto request = NetworkRequest::twitchRequest(url);
request.setCaller(caller);
return request;
}
} // namespace chatterino

View file

@ -1,8 +1,7 @@
#include "messages/Image.hpp"
#include "Application.hpp"
#include "common/NetworkManager.hpp"
#include "common/UrlFetch.hpp"
#include "common/NetworkRequest.hpp"
#include "debug/Log.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/WindowManager.hpp"

View file

@ -1,6 +1,6 @@
#include "providers/bttv/BttvEmotes.hpp"
#include "common/UrlFetch.hpp"
#include "common/NetworkRequest.hpp"
#include "debug/Log.hpp"
#include "messages/Image.hpp"

View file

@ -1,6 +1,6 @@
#include "providers/ffz/FfzEmotes.hpp"
#include "common/UrlFetch.hpp"
#include "common/NetworkRequest.hpp"
#include "debug/Log.hpp"
#include "messages/Image.hpp"

View file

@ -1,7 +1,6 @@
#include "providers/twitch/TwitchAccount.hpp"
#include "common/NetworkRequest.hpp"
#include "common/UrlFetch.hpp"
#include "debug/Log.hpp"
#include "providers/twitch/PartialTwitchUser.hpp"
#include "providers/twitch/TwitchCommon.hpp"

View file

@ -1,7 +1,7 @@
#include "providers/twitch/TwitchChannel.hpp"
#include "common/Common.hpp"
#include "common/UrlFetch.hpp"
#include "common/NetworkRequest.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "debug/Log.hpp"
#include "messages/Message.hpp"
@ -336,7 +336,8 @@ void TwitchChannel::refreshLiveStatus()
std::weak_ptr<Channel> weak = this->shared_from_this();
auto request = makeGetStreamRequest(this->roomID, QThread::currentThread());
auto request = NetworkRequest::twitchRequest(url);
request.setCaller(QThread::currentThread());
request.onSuccess([weak](auto result) {
auto d = result.parseRapidJson();

View file

@ -1,6 +1,6 @@
#include "providers/twitch/TwitchEmotes.hpp"
#include "common/UrlFetch.hpp"
#include "common/NetworkRequest.hpp"
#include "debug/Benchmark.hpp"
#include "debug/Log.hpp"
#include "messages/Image.hpp"

View file

@ -1,7 +1,7 @@
#include "widgets/dialogs/LoginDialog.hpp"
#include "common/Common.hpp"
#include "common/UrlFetch.hpp"
#include "common/NetworkRequest.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "providers/twitch/PartialTwitchUser.hpp"

View file

@ -1,7 +1,7 @@
#include "UserInfoPopup.hpp"
#include "Application.hpp"
#include "common/UrlFetch.hpp"
#include "common/NetworkRequest.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "providers/twitch/PartialTwitchUser.hpp"
#include "providers/twitch/TwitchChannel.hpp"
@ -250,7 +250,10 @@ void UserInfoPopup::updateUserData()
this->userId_ = id;
auto request = makeGetChannelRequest(id, this);
QString url("https://api.twitch.tv/kraken/channels/" + id);
auto request = NetworkRequest::twitchRequest(url);
request.setCaller(this);
request.onSuccess([this](auto result) {
auto obj = result.parseJson();

View file

@ -2,7 +2,7 @@
#include "Application.hpp"
#include "common/Common.hpp"
#include "common/UrlFetch.hpp"
#include "common/NetworkRequest.hpp"
#include "providers/twitch/EmoteValue.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchMessageBuilder.hpp"
@ -27,6 +27,7 @@
#include <QDesktopServices>
#include <QDockWidget>
#include <QDrag>
#include <QJsonArray>
#include <QListWidget>
#include <QMimeData>
#include <QPainter>

View file

@ -1,7 +1,6 @@
#include "widgets/splits/SplitHeader.hpp"
#include "Application.hpp"
#include "common/UrlFetch.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchServer.hpp"
@ -80,9 +79,7 @@ SplitHeader::SplitHeader(Split *_split)
// dropdown->setScaleIndependantSize(23, 23);
this->addDropdownItems(dropdown.getElement());
QObject::connect(dropdown.getElement(), &RippleEffectButton::leftMousePress, this, [this] {
QTimer::singleShot(80, [&, this] {
this->dropdownMenu_.popup(QCursor::pos());
});
QTimer::singleShot(80, [&, this] { this->dropdownMenu_.popup(QCursor::pos()); });
});
}

View file

@ -1,7 +1,6 @@
#include "widgets/splits/SplitInput.hpp"
#include "Application.hpp"
#include "common/UrlFetch.hpp"
#include "controllers/commands/CommandController.hpp"
#include "providers/twitch/TwitchChannel.hpp"
#include "providers/twitch/TwitchServer.hpp"