Remove USEWEBENGINE (#4757)

This code has been sitting behind a define since 2018 (de3a490). I'm not opposed to this code coming back however in this state, it feels better to remove it.
This commit is contained in:
Mm2PL
2023-08-07 20:24:17 +02:00
committed by GitHub
parent 59160c5d04
commit ec0d77643f
9 changed files with 1 additions and 97 deletions
-35
View File
@@ -1,35 +0,0 @@
#include "StreamView.hpp"
#include "common/Channel.hpp"
#include "util/Helpers.hpp"
#include "util/LayoutCreator.hpp"
#include "widgets/helper/ChannelView.hpp"
#include "widgets/splits/Split.hpp"
#ifdef USEWEBENGINE
# include <QtWebEngineWidgets>
#endif
namespace chatterino {
StreamView::StreamView(ChannelPtr channel, const QUrl &url)
{
LayoutCreator<StreamView> layoutCreator(this);
#ifdef USEWEBENGINE
auto web =
layoutCreator.emplace<QWebEngineView>(this).assign(&this->stream);
web->setUrl(url);
web->settings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled,
true);
#endif
auto chat = layoutCreator.emplace<ChannelView>();
chat->setFixedWidth(300);
chat->setChannel(std::move(channel));
this->layout()->setSpacing(0);
this->layout()->setContentsMargins(0, 0, 0, 0);
}
} // namespace chatterino
-25
View File
@@ -1,25 +0,0 @@
#pragma once
#include <QUrl>
#include <QWidget>
#include <memory>
class QWebEngineView;
namespace chatterino {
class Channel;
class StreamView : public QWidget
{
public:
StreamView(std::shared_ptr<Channel> channel, const QUrl &url);
private:
#ifdef USEWEBENGINE
QWebEngineView *stream;
#endif
};
} // namespace chatterino
-21
View File
@@ -524,11 +524,6 @@ void Split::addShortcuts()
this->setFiltersDialog();
return "";
}},
{"startWatching",
[this](std::vector<QString>) -> QString {
this->startWatching();
return "";
}},
{"openInBrowser",
[this](std::vector<QString>) -> QString {
if (this->getChannel()->getType() == Channel::Type::TwitchWhispers)
@@ -1401,22 +1396,6 @@ void Split::openSubPage()
}
}
void Split::startWatching()
{
#ifdef USEWEBENGINE
ChannelPtr _channel = this->getChannel();
TwitchChannel *tc = dynamic_cast<TwitchChannel *>(_channel.get());
if (tc != nullptr)
{
StreamView *view = new StreamView(
_channel,
"https://player.twitch.tv/?parent=twitch.tv&channel=" + tc->name);
view->setAttribute(Qt::WA_DeleteOnClose, true);
view->show();
}
#endif
}
void Split::setFiltersDialog()
{
SelectChannelFiltersDialog d(this->getFilters(), this);
-1
View File
@@ -184,7 +184,6 @@ public slots:
void openBrowserPlayer();
void openInStreamlink();
void openWithCustomScheme();
void startWatching();
void setFiltersDialog();
void showSearch(bool singleChannel);
void showViewerList();
-11
View File
@@ -37,10 +37,6 @@
#include <cmath>
#ifdef USEWEBENGINE
# include "widgets/StreamView.hpp"
#endif
namespace {
using namespace chatterino;
@@ -383,11 +379,6 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
"Set filters", this->split_, &Split::setFiltersDialog,
h->getDisplaySequence(HotkeyCategory::Split, "pickFilters"));
menu->addSeparator();
#ifdef USEWEBENGINE
this->dropdownMenu.addAction(
"Start watching", this->split_, &Split::startWatching;
h->getDisplaySequence(HotkeyCategory::Split, "startWatching"));
#endif
auto *twitchChannel =
dynamic_cast<TwitchChannel *>(this->split_->getChannel().get());
@@ -397,12 +388,10 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
menu->addAction(
OPEN_IN_BROWSER, this->split_, &Split::openInBrowser,
h->getDisplaySequence(HotkeyCategory::Split, "openInBrowser"));
#ifndef USEWEBENGINE
menu->addAction(OPEN_PLAYER_IN_BROWSER, this->split_,
&Split::openBrowserPlayer,
h->getDisplaySequence(HotkeyCategory::Split,
"openPlayerInBrowser"));
#endif
menu->addAction(
OPEN_IN_STREAMLINK, this->split_, &Split::openInStreamlink,
h->getDisplaySequence(HotkeyCategory::Split, "openInStreamlink"));