Skip to content

Commit

Permalink
Fixed resource error with klippercommands.json
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalArtifex committed Jan 23, 2025
1 parent 86de2af commit cd18215
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
17 changes: 15 additions & 2 deletions QKlipper.pro
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
QT += core network websockets quick

NAME = Klipper
NAME = QKlipper
CONFIG += c++17 metatypes shared create_prl
TARGET = $$qtLibraryTarget(QKlipper)
TARGET = $$qtLibraryTarget(qklipper)
TEMPLATE = lib
DEFINES += DALIB
VERSION = 1.0.1

unix {
LIBEXTENSION = .so
STATICLIBEXTENSION = .a
}

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
Expand Down Expand Up @@ -249,10 +255,17 @@ prl.files = $$OUT_PWD/lib$$TARGET$$PRLEXTENSION
prl.path = $$[QT_HOST_LIBS]/
INSTALLS += prl
staticlib.files = $$OUT_PWD/lib$$TARGET$$STATICLIBEXTENSION
staticlib.path = $$[QT_HOST_LIBS]/
INSTALLS += staticlib
target.path = $$[QT_HOST_LIBS]/
INSTALLS += target
#this will be removed in the final release once I fix some of the operators
# *-g++* {
# QMAKE_CXXFLAGS += -fpermissive
# }
RESOURCES += \
data.qrc
2 changes: 1 addition & 1 deletion QKlipper/QKlipperConsole/qklippercommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void QKlipperCommand::initialize()
{
m_isInitializing = true;

QFile commandsFile(QString(":/data/klipper_commands.json"));
QFile commandsFile(QString(":/qrc/data/klipper_commands.json"));

if(!commandsFile.open(QFile::ReadOnly))
{
Expand Down
5 changes: 5 additions & 0 deletions data.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/qrc">
<file>data/klipper_commands.json</file>
</qresource>
</RCC>

0 comments on commit cd18215

Please sign in to comment.