removed experimental profile banner code for now

This commit is contained in:
TranRed 2019-07-25 13:55:37 +02:00
parent 125774ecb2
commit 54b162afdd
2 changed files with 6 additions and 36 deletions

View file

@ -14,10 +14,9 @@
#include "util/PostToThread.hpp" #include "util/PostToThread.hpp"
#include "widgets/Label.hpp" #include "widgets/Label.hpp"
#include "widgets/dialogs/LogsPopup.hpp" #include "widgets/dialogs/LogsPopup.hpp"
#include "widgets/helper/ChannelView.hpp"
#include "widgets/helper/EffectLabel.hpp" #include "widgets/helper/EffectLabel.hpp"
#include "widgets/helper/Line.hpp" #include "widgets/helper/Line.hpp"
#include "widgets/helper/ChannelView.hpp"
#include <QCheckBox> #include <QCheckBox>
#include <QDesktopServices> #include <QDesktopServices>
@ -377,9 +376,6 @@ void UserInfoPopup::updateUserData()
this->loadAvatar(QUrl(obj.value("logo").toString())); this->loadAvatar(QUrl(obj.value("logo").toString()));
this->loadProfileBanner(
QUrl(obj.value("profile_banner").toString()));
return Success; 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 // TimeoutWidget
// //
@ -614,7 +585,8 @@ void UserInfoPopup::TimeoutWidget::paintEvent(QPaintEvent *)
// / 2); // / 2);
} }
void UserInfoPopup::fillLatestMessages(){ void UserInfoPopup::fillLatestMessages()
{
LimitedQueueSnapshot<MessagePtr> snapshot = this->channel_->getMessageSnapshot(); LimitedQueueSnapshot<MessagePtr> snapshot = this->channel_->getMessageSnapshot();
ChannelPtr channelPtr(new Channel("search", Channel::Type::None)); ChannelPtr channelPtr(new Channel("search", Channel::Type::None));
for (size_t i = 0; i < snapshot.size(); i++) for (size_t i = 0; i < snapshot.size(); i++)

View file

@ -31,7 +31,6 @@ private:
void fillLatestMessages(); void fillLatestMessages();
void loadAvatar(const QUrl &url); void loadAvatar(const QUrl &url);
void loadProfileBanner(const QUrl &url);
bool isMod_; bool isMod_;
bool isBroadcaster_; bool isBroadcaster_;
@ -48,7 +47,6 @@ private:
Button *avatarButton = nullptr; Button *avatarButton = nullptr;
// RippleEffectLabel2 *viewLogs = nullptr; // RippleEffectLabel2 *viewLogs = nullptr;
QPixmap profileBanner;
Label *nameLabel = nullptr; Label *nameLabel = nullptr;
Label *viewCountLabel = nullptr; Label *viewCountLabel = nullptr;
Label *followerCountLabel = nullptr; Label *followerCountLabel = nullptr;