Skip to content

Commit

Permalink
Proxy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
coslyk committed Jul 29, 2023
1 parent 1585955 commit 3f7781b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ add_definitions(-DQT_NO_CAST_FROM_ASCII)
fix_project_version()

find_package(Qt6 REQUIRED COMPONENTS Gui Qml Quick OpenGL Network LinguistTools)
find_package(Qt6Gui REQUIRED)
find_package(MPV REQUIRED)

add_subdirectory(3rdparty)
Expand Down
3 changes: 0 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

# Include Qt Gui private headers
include_directories(${Qt6Gui_PRIVATE_INCLUDE_DIRS})

# Include MPV
include_directories(${MPV_INCLUDE_DIRS})

Expand Down
4 changes: 3 additions & 1 deletion src/mpvObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ void MpvObject::open(const QUrl& fileUrl, const QUrl& danmakuUrl, const QUrl& au
m_mpv.set_option("user-agent", NetworkAccessManager::instance()->userAgentOf(fileUrl).constData());

// set proxy
if (NetworkAccessManager::HTTP_PROXY == (NetworkAccessManager::ProxyType) settings.value("network/proxy_type").toInt())
NetworkAccessManager::ProxyType proxyType = (NetworkAccessManager::ProxyType) settings.value("network/proxy_type").toInt();
bool proxyForParseOnly = settings.value(QStringLiteral("network/proxy_only_for_parsing", false)).toBool();
if (!proxyForParseOnly && proxyType == NetworkAccessManager::HTTP_PROXY)
{
QByteArray proxy = QByteArrayLiteral("http://") + settings.value("network/proxy").toByteArray();
m_mpv.set_option("http-proxy", proxy.constData());
Expand Down

0 comments on commit 3f7781b

Please sign in to comment.