mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
removed experimental profile banner code for now
This commit is contained in:
parent
125774ecb2
commit
54b162afdd
2 changed files with 6 additions and 36 deletions
|
@ -14,10 +14,9 @@
|
|||
#include "util/PostToThread.hpp"
|
||||
#include "widgets/Label.hpp"
|
||||
#include "widgets/dialogs/LogsPopup.hpp"
|
||||
#include "widgets/helper/ChannelView.hpp"
|
||||
#include "widgets/helper/EffectLabel.hpp"
|
||||
#include "widgets/helper/Line.hpp"
|
||||
#include "widgets/helper/ChannelView.hpp"
|
||||
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QDesktopServices>
|
||||
|
@ -377,9 +376,6 @@ void UserInfoPopup::updateUserData()
|
|||
|
||||
this->loadAvatar(QUrl(obj.value("logo").toString()));
|
||||
|
||||
this->loadProfileBanner(
|
||||
QUrl(obj.value("profile_banner").toString()));
|
||||
|
||||
return Success;
|
||||
});
|
||||
|
||||
|
@ -464,31 +460,6 @@ void UserInfoPopup::loadAvatar(const QUrl &url)
|
|||
});
|
||||
}
|
||||
|
||||
void UserInfoPopup::loadProfileBanner(const QUrl &url)
|
||||
{
|
||||
QNetworkRequest req(url);
|
||||
static auto manager = new QNetworkAccessManager();
|
||||
auto *reply = manager->get(req);
|
||||
|
||||
QObject::connect(reply, &QNetworkReply::finished, this, [=] {
|
||||
if (reply->error() == QNetworkReply::NoError)
|
||||
{
|
||||
const auto data = reply->readAll();
|
||||
|
||||
// might want to cache the banner image
|
||||
QPixmap banner;
|
||||
banner.loadFromData(data);
|
||||
this->ui_.profileBanner =
|
||||
banner.scaled(600, 200, Qt::KeepAspectRatio);
|
||||
}
|
||||
else
|
||||
{
|
||||
QPixmap emptyBanner;
|
||||
this->ui_.profileBanner = emptyBanner;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// TimeoutWidget
|
||||
//
|
||||
|
@ -614,7 +585,8 @@ void UserInfoPopup::TimeoutWidget::paintEvent(QPaintEvent *)
|
|||
// / 2);
|
||||
}
|
||||
|
||||
void UserInfoPopup::fillLatestMessages(){
|
||||
void UserInfoPopup::fillLatestMessages()
|
||||
{
|
||||
LimitedQueueSnapshot<MessagePtr> snapshot = this->channel_->getMessageSnapshot();
|
||||
ChannelPtr channelPtr(new Channel("search", Channel::Type::None));
|
||||
for (size_t i = 0; i < snapshot.size(); i++)
|
||||
|
|
|
@ -31,7 +31,6 @@ private:
|
|||
void fillLatestMessages();
|
||||
|
||||
void loadAvatar(const QUrl &url);
|
||||
void loadProfileBanner(const QUrl &url);
|
||||
bool isMod_;
|
||||
bool isBroadcaster_;
|
||||
|
||||
|
@ -48,7 +47,6 @@ private:
|
|||
Button *avatarButton = nullptr;
|
||||
|
||||
// RippleEffectLabel2 *viewLogs = nullptr;
|
||||
QPixmap profileBanner;
|
||||
Label *nameLabel = nullptr;
|
||||
Label *viewCountLabel = nullptr;
|
||||
Label *followerCountLabel = nullptr;
|
||||
|
|
Loading…
Reference in a new issue