Skip to content

Commit

Permalink
merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Protostars committed May 29, 2022
2 parents 55d72a1 + 59dadf2 commit 0e5e15b
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 1,618 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "Script/lua"]
path = Script/lua
url = https://github.com/lua/lua.git
branch = v5.3
33 changes: 23 additions & 10 deletions KikoPlay.pro
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,29 @@ win32 {
}

# UNIX related settings
macx {
LIBS += -L/usr/lib -L/usr/local/lib -L/opt/local/lib -L$$PWD/lib/mac
LIBS += -llua5.3
}

linux-g++* {
PRE_TARGETDEPS = Script/lua/liblua.a
liblua.target = $$PRE_TARGETDEPS
liblua.depends = FORCE
liblua.commands = cd Script/lua && make MYCFLAGS=-fPIC\ -DLUA_USE_LINUX\ -DLUA_COMPAT_5_2 liblua.a
QMAKE_EXTRA_TARGETS += liblua
QMAKE_LFLAGS += -fuse-ld=gold -Wl,--exclude-libs,liblua.a

# Link library settings by ARCH
contains(QT_ARCH, i386) {
LIBS += -L/usr/lib -L$$PWD/lib/linux
} else {
LIBS += -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu -L$$PWD/lib/x64/linux
}
LIBS += -LScript/lua -l:liblua.a
LIBS += -lm -ldl
}

unix {
# Install settings
target.path += /usr/bin
Expand All @@ -357,16 +380,6 @@ unix {
INSTALLS += target icons desktop web
DEFINES += CONFIG_UNIX_DATA

# Link library settings by ARCH
contains(QT_ARCH, i386) {
LIBS += -L/usr/lib/ -L$$PWD/lib/linux
} else {
LIBS += -L/usr/lib64/ -L$$PWD/lib/x64/linux -L$$PWD/lib64/linux
}

LIBS += -lmpv
LIBS += -lz
LIBS += -lm
LIBS += -llua5.3
LIBS += -ldl
}
4 changes: 2 additions & 2 deletions LANServer/filehandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ void FileHandler::processFile(stefanfrings::HttpRequest &request, stefanfrings::
// Return the file content, do not store in cache
while (!file.atEnd() && !file.error() && file.pos() <= to && response.isConnected())
{
qint64 blockSize = qMin<int64_t>(65536, to - file.pos() + 1);
qint64 blockSize = qMin<qint64>(65536, to - file.pos() + 1);
response.write(file.read(blockSize), file.atEnd());
}
}

bool FileHandler::getRange(const QString &range, int64_t fileSize, int64_t &from, int64_t &to)
bool FileHandler::getRange(const QString &range, qint64 fileSize, qint64 &from, qint64 &to)
{
static QRegExp regExp("^(\\d*)-(\\d*)$");

Expand Down
2 changes: 1 addition & 1 deletion LANServer/filehandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class FileHandler : public stefanfrings::HttpRequestHandler
void processDirectory(stefanfrings::HttpRequest& request, stefanfrings::HttpResponse& response, const QString &path);
void processFile(stefanfrings::HttpRequest& request, stefanfrings::HttpResponse& response, const QString &path);

bool getRange(const QString &range, int64_t fileSize, int64_t &from, int64_t &to);
bool getRange(const QString &range, qint64 fileSize, qint64 &from, qint64 &to);
};

#endif // FILEHANDLER_H
1 change: 1 addition & 0 deletions Script/lua
Submodule lua added at 75ea9c
6 changes: 3 additions & 3 deletions Script/lua/lua.hpp → Script/lua.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// <<extern "C">> not supplied automatically because Lua also compiles as C++

extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#include "lua/lua.h"
#include "lua/lualib.h"
#include "lua/lauxlib.h"
}
264 changes: 0 additions & 264 deletions Script/lua/lauxlib.h

This file was deleted.

Loading

0 comments on commit 0e5e15b

Please # to comment.