Skip to content

Commit

Permalink
Merge pull request #51 from tjohnman/tjohnman-patch-1
Browse files Browse the repository at this point in the history
Some small bug fixes
  • Loading branch information
tjohnman authored Oct 9, 2024
2 parents 17b000d + d31ae2b commit 3eaa4fa
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 26 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,6 @@ qrc_resources.cpp
ui_*.h
object_script.*
.vscode
.qtc_clangd
.qtc_clangd
deploy.ps1
obsession-alpha-qt4-windows.zip
3 changes: 1 addition & 2 deletions Obsession.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
File renamed without changes.
16 changes: 2 additions & 14 deletions src/cdownload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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();
Expand Down
5 changes: 4 additions & 1 deletion src/ctransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -223,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; j<pParameters[i]->length(); j++) {
Expand Down
7 changes: 0 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3eaa4fa

Please sign in to comment.