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
4 changes: 2 additions & 2 deletions 3rd_party/ExternalProject_JCON.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
libname(jcon jcon)
find_package(Qt5 COMPONENTS Network WebSockets Test REQUIRED)
find_package(Qt6 COMPONENTS Network WebSockets Test REQUIRED)

ExternalProject_Add(
jcon_BUILD
Expand All @@ -18,4 +18,4 @@ add_dependencies(jcon_IMP jcon_BUILD)
file(MAKE_DIRECTORY ${ThirdParty_Install_Dir}/include)
set_property(TARGET jcon_IMP PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${ThirdParty_Install_Dir}/include)
SET_PROPERTY(TARGET jcon_IMP APPEND PROPERTY IMPORTED_LOCATION ${jcon_LIBRARY_STATIC} )
set_property(TARGET jcon_IMP APPEND PROPERTY INTERFACE_LINK_LIBRARIES Qt5::Network Qt5::WebSockets Qt5::Test)
set_property(TARGET jcon_IMP APPEND PROPERTY INTERFACE_LINK_LIBRARIES Qt6::Network Qt6::WebSockets Qt6::Test)
4 changes: 2 additions & 2 deletions 3rd_party/jcon-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0043 NEW)
cmake_policy(SET CMP0053 NEW)

Expand All @@ -24,7 +24,7 @@ if(MINGW)
endif()

if(APPLE OR UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wno-conversion -Wno-sign-compare -Wno-strict-aliasing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-conversion -Wno-sign-compare -Wno-strict-aliasing") #-Werror
endif()

if(APPLE)
Expand Down
8 changes: 6 additions & 2 deletions 3rd_party/jcon-cpp/jcon/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
project(jcon)

set(QTDIR $ENV{QTDIR})
set(QT6_DIR $ENV{QTDIR})

set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_PREFIX_PATH ${QTDIR})

file(GLOB ${PROJECT_NAME}_headers *.h)
file(GLOB ${PROJECT_NAME}_sources *.cpp)
Expand All @@ -10,13 +14,13 @@ file(GLOB ${PROJECT_NAME}_sources *.cpp)

add_library(${PROJECT_NAME} STATIC ${${PROJECT_NAME}_headers} ${${PROJECT_NAME}_sources})
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${${PROJECT_NAME}_headers}")
find_package(Qt5 COMPONENTS Core Network WebSockets)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Network)

find_package(Qt6 COMPONENTS Core Network Test WebSockets)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include/jcon
)
target_compile_definitions(jcon PUBLIC NDEBUG)
target_link_libraries(jcon PUBLIC Qt6::Core Qt6::Network Qt6::WebSockets)
22 changes: 0 additions & 22 deletions 3rd_party/jcon-cpp/jcon/CMakeLists.txt.autosave

This file was deleted.

2 changes: 1 addition & 1 deletion 3rd_party/jcon-cpp/jcon/jcon.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include <QtCore/qglobal.h>
#include <QtGlobal>

//#ifndef JCON_DLL
//#define JCON_DLL
Expand Down
4 changes: 3 additions & 1 deletion 3rd_party/jcon-cpp/jcon/json_rpc_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "jcon_assert.h"
#include "string_util.h"


#include <QUuid>
#include <QEventLoop>
#include <QCoreApplication>
Expand All @@ -13,6 +14,8 @@

namespace jcon {

const QString JsonRpcClient::InvalidRequestId = "";

JsonRpcClient::JsonRpcClient(std::shared_ptr<JsonRpcSocket> socket,
QObject* parent,
std::shared_ptr<JsonRpcLogger> logger,
Expand Down Expand Up @@ -157,7 +160,6 @@ JsonRpcClient::doCallNamedParams(const QString& method,

return request;
}

int JsonRpcClient::outstandingRequestCount() const
{
return m_outstanding_request_count;
Expand Down
2 changes: 1 addition & 1 deletion 3rd_party/jcon-cpp/jcon/json_rpc_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private slots:
void jsonResponseReceived(const QJsonObject& obj);

private:
const QString InvalidRequestId = "";
static const QString InvalidRequestId;

static QString formatLogMessage(const QString& method,
const QVariantList& args,
Expand Down
2 changes: 1 addition & 1 deletion 3rd_party/jcon-cpp/jcon/json_rpc_debug_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <QDebug>

namespace jcon {

void JsonRpcDebugLogger::logDebug(const QString& message)
{
qDebug().noquote() << message;
Expand Down
5 changes: 3 additions & 2 deletions 3rd_party/jcon-cpp/jcon/json_rpc_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <QJsonObject>
#include <QVariant>
#include <QMetaMethod>
#include <QMetaType>

namespace {
QString logInvoke(const QMetaMethod& meta_method,
Expand Down Expand Up @@ -376,8 +377,8 @@ bool JsonRpcServer::doCall(QObject* object,
}

const char* return_type_name = meta_method.typeName();
int return_type = QMetaType::type(return_type_name);
if (return_type != QMetaType::Void) {
QMetaType return_type = QMetaType::fromName(return_type_name);
if (return_type.id() != QMetaType::Void) {
return_value = QVariant(return_type, nullptr);
}

Expand Down
4 changes: 3 additions & 1 deletion 3rd_party/jcon-cpp/jcon/json_rpc_websocket.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <QtGlobal>

#include "json_rpc_websocket.h"
#include "jcon_assert.h"

Expand Down Expand Up @@ -41,7 +43,7 @@ void JsonRpcWebSocket::setupSocket()
this, &JsonRpcWebSocket::dataReady);

void (QWebSocket::*errorPtr)(QAbstractSocket::SocketError) =
&QWebSocket::error;
&QWebSocket::errorOccurred;
connect(m_socket, errorPtr, this,
[this](QAbstractSocket::SocketError error) {
emit socketError(m_socket, error);
Expand Down
1 change: 0 additions & 1 deletion 3rd_party/jcon-cpp/jcon/string_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ QStringList variantMapToStringList(const QVariantMap& m)
}
return res;
}

}
1 change: 0 additions & 1 deletion 3rd_party/jcon-cpp/jcon/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,4 @@ JCON_API QStringList variantListToStringList(const QVariantList& l);
* @return A list with the string representations of each element in the list.
*/
JCON_API QStringList variantMapToStringList(const QVariantMap& m);

}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ add_subdirectory(3rd_party)
link_directories(${PROJECT_SOURCE_DIR}/lib) # ERICEDIT: Changed to lowercase.

include(LocateQt5)
find_package(Qt5 COMPONENTS Core Sql REQUIRED)
find_package(Qt6 COMPONENTS Core Sql REQUIRED)

link_directories(${ThirdParty_Install_Dir}/lib)
include_directories(SYSTEM ${ThirdParty_Install_Dir}/include)
Expand Down
14 changes: 7 additions & 7 deletions CMakeScripts/LocateQt5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ IF(MSVC)
# get root path so we can search for 5.3, 5.4, 5.5, etc
STRING(REPLACE "/Tools" ";" QT_BIN "${QT_BIN}")
LIST(GET QT_BIN 0 QT_BIN)
FILE(GLOB QT_VERSIONS "${QT_BIN}/5.*")
FILE(GLOB QT_VERSIONS "${QT_BIN}/6.*")
LIST(SORT QT_VERSIONS)

# assume the latest version will be last alphabetically
Expand Down Expand Up @@ -44,11 +44,11 @@ ENDMACRO(TO_NATIVE_PATH)
# use Qt_DIR approach so you can find Qt after cmake has been invoked
IF(NOT QT_MISSING)
MESSAGE("-- Qt found: ${QT_PATH}")
SET(Qt5_DIR "${QT_PATH}/lib/cmake/Qt5/")
SET(Qt5Test_DIR "${QT_PATH}/lib/cmake/Qt5Test")
SET(Qt6_DIR "${QT_PATH}/lib/cmake/Qt6/")
SET(Qt6Test_DIR "${QT_PATH}/lib/cmake/Qt6Test")
ENDIF()
find_package(Qt5 REQUIRED COMPONENTS Core)
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(Qt5_BIN_DIR "${_qmake_executable}" DIRECTORY)
TO_NATIVE_PATH("${Qt5_BIN_DIR}" Qt5_BIN_DIR)
find_package(Qt6 REQUIRED COMPONENTS Core)
get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
get_filename_component(Qt6_BIN_DIR "${_qmake_executable}" DIRECTORY)
TO_NATIVE_PATH("${Qt6_BIN_DIR}" Qt6_BIN_DIR)

4 changes: 2 additions & 2 deletions CMakeScripts/Windeployqt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

find_package(Qt5Core REQUIRED)
find_package(Qt6 COMPONENTS Core REQUIRED)

# Retrieve the absolute path to qmake and then use that path to find
# the windeployqt binary
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")

Expand Down
6 changes: 3 additions & 3 deletions SEGSLauncher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.14)

project(SEGSLauncher LANGUAGES CXX)

Expand All @@ -7,7 +7,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt5 COMPONENTS Core Quick Multimedia REQUIRED)
find_package(Qt6 COMPONENTS Core Quick Multimedia Network REQUIRED)
set(CMAKE_DEBUG_POSTFIX "d")

set(SEGSLAUNCHER_SOURCES
Expand All @@ -23,7 +23,7 @@ set(SEGSLAUNCHER_SOURCES

add_executable(${PROJECT_NAME} WIN32 ${SEGSLAUNCHER_SOURCES})
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Quick Qt5::Multimedia jcon_IMP)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick Qt6::Multimedia Qt6::Network jcon_IMP)


#message("Copying required Qt libraries and binaries to output directory....")
Expand Down
3 changes: 3 additions & 0 deletions SEGSLauncher/Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
#include <QDir>


const QVersionNumber Launcher::m_version = QVersionNumber(0,0,1);

Launcher::Launcher(QObject *parent) : QObject(parent)
{
m_update_channel = "stable";
// Worker thread for getting server status (RPC call)
Worker *worker = new Worker;
worker->moveToThread(&worker_thread);
Expand Down
18 changes: 13 additions & 5 deletions SEGSLauncher/Launcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <QVariantMap>
#include <QJsonObject>
#include <QThread>
#include <QVersionNumber>

class QProcess;
class QNetworkAccessManager;
Expand All @@ -13,8 +14,13 @@ class QNetworkReply;
class Launcher : public QObject
{
Q_OBJECT

// allow qml to access the launcher version QVersionNumber
Q_PROPERTY(QVersionNumber version READ get_launcher_version CONSTANT)
// allow access to the update_channel from qml
Q_PROPERTY(QString update_channel READ update_channel WRITE set_update_channel NOTIFY update_channel_changed)
public:
static QVersionNumber get_launcher_version() { return m_version; }

explicit Launcher(QObject *parent = nullptr);
~Launcher() override;
void fetch_server_status();
Expand All @@ -31,7 +37,9 @@ class Launcher : public QObject
Q_INVOKABLE QVariantMap get_last_used_server();
Q_INVOKABLE QJsonObject get_server_list();
Q_INVOKABLE QJsonObject get_server_information();

// Property helpers
QString update_channel() const { return m_update_channel; }
void set_update_channel(const QString &channel) { m_update_channel = channel; emit update_channel_changed(); }

public slots:
void handle_servers_reply();
Expand All @@ -44,8 +52,10 @@ public slots:
void fetchReleasesFinished();
void getServerStatus();
void serverStatusReady();

void update_channel_changed();
private:
static const QVersionNumber m_version;
QString m_update_channel;
QProcess *m_start_cox;
QProcess *m_start_segsadmin;
QNetworkReply *m_servers_network_reply;
Expand All @@ -58,6 +68,4 @@ public slots:
QString m_server_name;
QThread worker_thread; // Move to Private -- test it
bool m_server_status;


};
Loading