From 2fa58cb14f0c2e8ae886761aef99add56b057e70 Mon Sep 17 00:00:00 2001 From: tjohnman Date: Wed, 9 Oct 2024 15:05:41 +0200 Subject: [PATCH 1/9] Some small bug fixes As implemented by @zquestz in #50 --- src/ctransaction.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ctransaction.cpp b/src/ctransaction.cpp index e03a7de..27fbabe 100644 --- a/src/ctransaction.cpp +++ b/src/ctransaction.cpp @@ -123,6 +123,7 @@ void CTransaction::addData(const char * data) { case 110: case 115: newParameter.type = TYPE_STRING; + break; case 116: if(size <= 2) { newParameter.type = TYPE_SHORT; From d6d655ad0db791796e1d2f712beb6b2ad43002d7 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 9 Oct 2024 15:10:08 +0200 Subject: [PATCH 2/9] Remove unused debug log file. --- src/main.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 1936770..a252cac 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,13 +13,6 @@ void * __gxx_personality_v0=0; qint32 main(qint32 argc, char *argv[]) { - FILE * debugLog = fopen("log.txt", "a"); - if(debugLog) - { - fwrite("\n", 1, 1, debugLog); - fclose(debugLog); - } - QApplication a(argc, argv); MainWindow w(0, true); From a6e5037051055ce57f23a825461d2760e3753646 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 9 Oct 2024 15:11:14 +0200 Subject: [PATCH 3/9] Removed duplicate resources file. --- Obsession.pro | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Obsession.pro b/Obsession.pro index bb341c6..11c158a 100644 --- a/Obsession.pro +++ b/Obsession.pro @@ -114,8 +114,7 @@ FORMS += src/mainwindow.ui \ INCLUDEPATH += src/ RESOURCES += resources/resources.qrc \ resources/icons1.qrc \ - resources/icons2.qrc \ - resources/resources.qrc + resources/icons2.qrc RC_ICONS = resources/icon.ico ICON = resources/icon.icns win32:RC_FILE += Obsession.rc From 28f44b32d135b07b72b983c451579218d02aed36 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 9 Oct 2024 15:11:46 +0200 Subject: [PATCH 4/9] Properly check socket state. --- src/cdownload.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cdownload.cpp b/src/cdownload.cpp index cdf2e07..db8e72a 100644 --- a/src/cdownload.cpp +++ b/src/cdownload.cpp @@ -212,7 +212,7 @@ void CDownload::startDownloading() { if(connection->pSocket.isValid() && connection->pSocket.state() == QAbstractSocket::ConnectedState) { socket.connectToHost(connection->pSocket.peerAddress(), connection->pSocket.peerPort()+1, QIODevice::ReadWrite); socket.waitForConnected(); - if(socket.state() == !QAbstractSocket::ConnectedState) { + if(socket.state() != QAbstractSocket::ConnectedState) { return; } From af8e906a3c34155058e982fac5bb48fb00e307b9 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 9 Oct 2024 15:16:39 +0200 Subject: [PATCH 5/9] Removed unused HXD flag --- src/cdownload.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/cdownload.cpp b/src/cdownload.cpp index db8e72a..c723449 100644 --- a/src/cdownload.cpp +++ b/src/cdownload.cpp @@ -292,21 +292,9 @@ void CDownload::serverReady() { return; } - char * forkInfo = socket.read(forkSize).data(); - - qint32 nameSize = forkSize - 72; - - bool hxd = false; - - char * reportedName = (char *)malloc(nameSize); - memcpy(reportedName, forkInfo+72, nameSize); - - if(!strncmp(reportedName, "hxd", 3)) { - hxd = true; - } + char * _forkInfo = socket.read(forkSize).data(); char * dataHeader = new char[16]; - if (!socket.read(dataHeader, 16)) { socket.close(); From fb5682201ee56e014eb07c9b44b39889e0eba553 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 9 Oct 2024 15:20:02 +0200 Subject: [PATCH 6/9] Fixed wrong qint16 variable for 32-bit value. --- src/ctransaction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ctransaction.cpp b/src/ctransaction.cpp index 27fbabe..2b5a2e6 100644 --- a/src/ctransaction.cpp +++ b/src/ctransaction.cpp @@ -224,7 +224,9 @@ char * CTransaction::bytes() { qint16 plen = qToBigEndian(pParameters[i]->length()); memcpy(b+24+offset, &plen, 2); - qint16 sval, ival; + qint16 sval; + qint32 ival; + switch(pParameters[i]->type()) { case TYPE_STRING: for(qint32 j=0; jlength(); j++) { From ec35cb15c6be35d19bbb4fbfc827caf510ca19b1 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 9 Oct 2024 15:24:24 +0200 Subject: [PATCH 7/9] Ignore build files. --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 172fedb..44518b8 100644 --- a/.gitignore +++ b/.gitignore @@ -223,4 +223,6 @@ qrc_resources.cpp ui_*.h object_script.* .vscode -.qtc_clangd \ No newline at end of file +.qtc_clangd +deploy.ps1 +obsession-alpha-qt4-windows.zip From ba4227c404fe149f183394e9fe6315d004c6a179 Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 9 Oct 2024 15:27:39 +0200 Subject: [PATCH 8/9] Change deploy script to track example instead of actual script. --- README.md | 1 + deploy.ps1 => deploy.ps1.example.ps1 | 0 2 files changed, 1 insertion(+) rename deploy.ps1 => deploy.ps1.example.ps1 (100%) diff --git a/README.md b/README.md index f66e437..b94c3cd 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ This repository includes a convenience script that deploys a release package on - Download and install [MinGW 4.8.2](http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.8.2/threads-posix/dwarf/i686-4.8.2-release-posix-dwarf-rt_v3-rev3.7z/download). - Download and install [Qt 4.8.7](https://download.qt.io/archive/qt/4.8/4.8.7/qt-opensource-windows-x86-mingw482-4.8.7.exe). - Download this repository and unpack it. +- Copy `deploy.ps1.example` with the name `deploy.ps1`. - Open `deploy.ps1` with your text editor, and adjust the `$mingwPath` and `$qtPath` variables to point to the `bin` directories for your MinGW and Qt installations, respectively. - Run `.\deploy.ps1` from the root directory of the repository. diff --git a/deploy.ps1 b/deploy.ps1.example.ps1 similarity index 100% rename from deploy.ps1 rename to deploy.ps1.example.ps1 From d31ae2b71b27bb8714b044b552e1f54f66fefd3a Mon Sep 17 00:00:00 2001 From: nobody Date: Wed, 9 Oct 2024 15:32:40 +0200 Subject: [PATCH 9/9] Update version number. --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index a49545e..571b608 100644 --- a/src/version.h +++ b/src/version.h @@ -1,2 +1,2 @@ #define VERSION_MAJOR 109 // 3 digits max -#define VERSION_MINOR 4 // 2 digits max +#define VERSION_MINOR 5 // 2 digits max