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
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ option(ENABLE_PQXX "Build with Postgres supoort" ON)

option(ENABLE_FROTZ "Build Frotz plugin" ON)
option(ENABLE_IRC "Build IRC plugin" ON)
option(ENABLE_QT6 "Build IRC plugin with QT6 libraries" OFF)
option(ENABLE_PURPLE "Build Libpurple plugin" ON)
option(ENABLE_SMSTOOLS3 "Build SMSTools3 plugin" ON)
option(ENABLE_XMPP "Build XMPP plugin" ON)
Expand Down Expand Up @@ -190,7 +191,11 @@ endif()

if(ENABLE_IRC)
find_package(Communi)
find_package(Qt5 COMPONENTS Core Network)
if(ENABLE_QT6)
find_package(Qt6 COMPONENTS Core Network)
else()
find_package(Qt5 COMPONENTS Core Network)
endif()
endif()

find_package(event)
Expand Down
7 changes: 7 additions & 0 deletions backends/libcommuni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ file(GLOB HEADERS *.h)

if(ENABLE_QT4)
QT4_WRAP_CPP(SRC ${HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
elseif(ENABLE_QT6)
QT6_WRAP_CPP(SRC ${HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
include_directories(${Qt6Core_INCLUDE_DIRS} ${Qt6Network_INCLUDE_DIRS})
else()
QT5_WRAP_CPP(SRC ${HEADERS} OPTIONS -DBOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Network_INCLUDE_DIRS})
Expand All @@ -15,12 +18,16 @@ target_compile_features(spectrum2_libcommuni_backend PUBLIC cxx_std_11)
if(NOT WIN32)
if(ENABLE_QT4)
target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt4::QtNetwork Qt4::QtCore transport-plugin)
elseif(ENABLE_QT6)
target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt6::Network Qt6::Core transport-plugin)
else()
target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt5::Network Qt5::Core transport-plugin)
endif()
else()
if(ENABLE_QT4)
target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt4::QtNetwork Qt4::QtCore transport-plugin)
elseif(ENABLE_QT6)
target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt6::Network Qt6::Core transport-plugin)
else()
target_link_libraries(spectrum2_libcommuni_backend ${IRC_LIBRARY} Qt5::Network Qt5::Core transport-plugin)
endif()
Expand Down
70 changes: 0 additions & 70 deletions backends/libcommuni/backports.h

This file was deleted.

3 changes: 1 addition & 2 deletions backends/libcommuni/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <IrcMessage>
#include <IrcUser>
#include <IrcChannel>
#include "backports.h"

#include "ircnetworkplugin.h"

Expand Down Expand Up @@ -409,7 +408,7 @@ void MyIrcSession::sendMessageToFrontend(const std::string &channel, const std::
void MyIrcSession::on_messageReceived(IrcMessage *message) {
IrcPrivateMessage *m = (IrcPrivateMessage *) message;
if (m->isRequest()) {
QString request = m->content().split(" ", QString::SkipEmptyParts).value(0).toUpper();
QString request = m->content().split(" ", Qt::SkipEmptyParts).value(0).toUpper();
if (request == "PING" || request == "TIME" || request == "VERSION") {
LOG4CXX_INFO(connectionLogger, m_user << ": " << TO_UTF8(request) << " received and has been answered");
return;
Expand Down
4 changes: 4 additions & 0 deletions cmake_modules/FindCommuni.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
if( ENABLE_QT4 )
find_package(Qt4)
include( ${QT_USE_FILE} )
elseif(ENABLE_QT6)
find_package(Qt6Network)
else()
find_package(Qt5Network)
endif()

FIND_LIBRARY(IRC_LIBRARY NAMES IrcCore PATHS ${QT_LIBRARY_DIR})
if( ENABLE_QT4 )
FIND_PATH(IRC_INCLUDE_DIR NAMES "IrcCore/ircglobal.h" PATHS ${QT_INCLUDE_DIR} PATH_SUFFIXES Communi)
elseif(ENABLE_QT6)
FIND_PATH(IRC_INCLUDE_DIR NAMES "IrcCore/ircglobal.h" PATHS ${Qt6Core_INCLUDE_DIRS} ${Qt6Core_INCLUDE_DIRS}"/.." PATH_SUFFIXES Communi)
else()
FIND_PATH(IRC_INCLUDE_DIR NAMES "IrcCore/ircglobal.h" PATHS ${Qt5Core_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS}"/.." PATH_SUFFIXES Communi)
endif()
Expand Down
Loading