Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ project(dde-cooperation VERSION 0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# GCC 8 (UOS 20) keeps std::filesystem in a separate archive, GCC >= 9 folds it
# into libstdc++ and the separate archive may no longer exist.
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lstdc++fs")
endif()

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if (NOT WIN32)
Expand Down
5 changes: 5 additions & 0 deletions src/lib/common/manager/tunnelmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ void TunnelManager::setupSocket(Stream *stream)
connect(socket, &QTcpSocket::disconnected, this, [this, id] {
destroyStream(id, "socket closed", true);
});
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
connect(socket, &QTcpSocket::errorOccurred, this, [this, id](QAbstractSocket::SocketError error) {
#else
connect(socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this,
[this, id](QAbstractSocket::SocketError error) {
#endif
Q_UNUSED(error)
Stream *stream = findStream(id);
if (!stream)
Expand Down
6 changes: 6 additions & 0 deletions src/lib/cooperation/core/net/helper/sharehelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,8 +706,14 @@ void ShareHelperPrivate::probeBarrierServer(const QString &ip, int attemptsLeft)
startClientBarrier();
});

// Error handling function
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
connect(socket, &QTcpSocket::errorOccurred, this,
[this, ip, attemptsLeft, finish](QAbstractSocket::SocketError error) {
#else
connect(socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this,
[this, ip, attemptsLeft, finish](QAbstractSocket::SocketError error) {
#endif
Q_UNUSED(error)
if (!finish())
return;
Expand Down
Loading