Skip to content

Commit

Permalink
Merge pull request #15 from oblivioncth/dev
Browse files Browse the repository at this point in the history
Merge to master for v0.3.1
  • Loading branch information
oblivioncth authored May 3, 2023
2 parents 95c7d61 + 55da5f5 commit 21941f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-libfp-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: Install OpenGL lib
run: sudo apt-get install libglu1-mesa-dev
- name: Install XCB-XKB
run: sudo apt-get install libxkbcommon-dev libxcb-xkb-dev
run: sudo apt-get install libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-*-dev
- name: Install Ninja
run: sudo apt-get install ninja-build
- name: Install Harfbuzz
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.23.0...3.25.0)
# Project
# NOTE: DON'T USE TRAILING ZEROS IN VERSIONS
project(libfp
VERSION 0.3
VERSION 0.3.1
LANGUAGES CXX
DESCRIPTION "C++ support library for Flashpoint"
)
Expand Down Expand Up @@ -52,7 +52,7 @@ set(LIBFP_QX_COMPONENTS

include(OB/FetchQx)
ob_fetch_qx(
REF "v0.5"
REF "v0.5.0.1"
COMPONENTS
${LIBFP_QX_COMPONENTS}
)
Expand Down
17 changes: 1 addition & 16 deletions lib/include/fp/fp-json.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class FP_FP_EXPORT Json
static inline const QString KEY_BROWSER_MODE_PROXY = "browserModeProxy";
};

class Object_Server
class Object_ServerDaemon
{
public:
static inline const QString KEY_NAME = "name";
Expand All @@ -83,21 +83,6 @@ class FP_FP_EXPORT Json
static inline const QString KEY_ARGUMENTS = "arguments";
};

class Object_Daemon
{
public:
/* NOTE: Unused since daemons/server are handled the same, maybe remove this
*
* static inline const QString KEY_NAME = "name";
* static inline const QString KEY_PATH = "path";
* static inline const QString KEY_FILENAME = "filename";
* static inline const QString KEY_ARGUMENTS = "arguments";
* static inline const QString KEY_KILL = "kill";
*/
static inline const QString KNOWN_DAEMON_DOCKER_NAME = "Docker GameZip";
static inline const QString KNOWN_DAEMON_QEMU_NAME = "QEMU GameZip";
};

class Object_Services
{
public:
Expand Down
18 changes: 10 additions & 8 deletions lib/src/fp-json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ Qx::GenericError Json::ServicesReader::parseDocument(const QJsonDocument& servic
/* NOTE: If for some reason this list becomes large, use a hash instead
* (e.g. if(hash.contains("NAME")){ recognizedDaemons.setFlag(hash["NAME]); } )
*/
if(daemonBuffer.name == Object_Daemon::KNOWN_DAEMON_DOCKER_NAME)
targetServices->recognizedDaemons.setFlag(KnownDaemon::Docker);
else if(daemonBuffer.name == Object_Daemon::KNOWN_DAEMON_QEMU_NAME)
if(daemonBuffer.name.contains("qemu", Qt::CaseInsensitive) ||
daemonBuffer.filename.contains("qemu", Qt::CaseInsensitive))
targetServices->recognizedDaemons.setFlag(KnownDaemon::Qemu);
else if(daemonBuffer.name.contains("docker", Qt::CaseInsensitive) ||
daemonBuffer.filename.contains("docker", Qt::CaseInsensitive))
targetServices->recognizedDaemons.setFlag(KnownDaemon::Docker);
}

// Get starts
Expand Down Expand Up @@ -331,21 +333,21 @@ Qx::GenericError Json::ServicesReader::parseServerDaemon(ServerDaemon& serverBuf
Qx::GenericError valueError;

// Get direct values
if((valueError = Qx::Json::checkedKeyRetrieval(serverBuffer.name, joServer, Object_Server::KEY_NAME)).isValid())
if((valueError = Qx::Json::checkedKeyRetrieval(serverBuffer.name, joServer, Object_ServerDaemon::KEY_NAME)).isValid())
return valueError.setErrorLevel(Qx::GenericError::Critical);

if((valueError = Qx::Json::checkedKeyRetrieval(serverBuffer.path, joServer, Object_Server::KEY_PATH)).isValid())
if((valueError = Qx::Json::checkedKeyRetrieval(serverBuffer.path, joServer, Object_ServerDaemon::KEY_PATH)).isValid())
return valueError.setErrorLevel(Qx::GenericError::Critical);

if((valueError = Qx::Json::checkedKeyRetrieval(serverBuffer.filename, joServer, Object_Server::KEY_FILENAME)).isValid())
if((valueError = Qx::Json::checkedKeyRetrieval(serverBuffer.filename, joServer, Object_ServerDaemon::KEY_FILENAME)).isValid())
return valueError.setErrorLevel(Qx::GenericError::Critical);

if((valueError = Qx::Json::checkedKeyRetrieval(serverBuffer.kill, joServer, Object_Server::KEY_KILL)).isValid())
if((valueError = Qx::Json::checkedKeyRetrieval(serverBuffer.kill, joServer, Object_ServerDaemon::KEY_KILL)).isValid())
return valueError.setErrorLevel(Qx::GenericError::Critical);

// Get arguments
QJsonArray jaArgs;
if((valueError = Qx::Json::checkedKeyRetrieval(jaArgs, joServer, Object_Server::KEY_ARGUMENTS)).isValid())
if((valueError = Qx::Json::checkedKeyRetrieval(jaArgs, joServer, Object_ServerDaemon::KEY_ARGUMENTS)).isValid())
return valueError.setErrorLevel(Qx::GenericError::Critical);

for(const QJsonValue& jvArg : qAsConst(jaArgs))
Expand Down

0 comments on commit 21941f6

Please sign in to comment.