From f5e52aed4ebb964048d7496e437ade41ea3241cb Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 25 Aug 2019 15:38:42 -0400 Subject: [PATCH] Fix qrc resources not working --- README.md | 2 +- TODO.md | 1 + harmonyqml.pro | 2 +- live-reload.sh | 2 ++ src/main.cpp | 5 +++-- src/qml/Pages/Default.qml | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c337d0e3..e2afcf77 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,6 @@ Install the dependencies from Github: git clone cd harmonyqml - qmake && make && sudo make install + qmake harmonyqml.pro && make && sudo make install After this if no errors happened, run `harmonyqml`. diff --git a/TODO.md b/TODO.md index e83da11d..efe05946 100644 --- a/TODO.md +++ b/TODO.md @@ -129,6 +129,7 @@ - Links preview - Client improvements + - Check if username exists on login screen - `pyotherside.atexit()` - Logout previous session if adding an account that's already connected - Image provider: on failed conversion, way to show a "broken image" thumb? diff --git a/harmonyqml.pro b/harmonyqml.pro index b4e082b4..406ccd40 100644 --- a/harmonyqml.pro +++ b/harmonyqml.pro @@ -69,5 +69,5 @@ for(file, $$list($$glob_filenames(*.py))) { } QMAKE_CLEAN *= $$MOC_DIR $$OBJECTS_DIR $$RCC_DIR $$PYCACHE_DIRS $$QRC_FILE -QMAKE_CLEAN *= $$BUILD_DIR Makefile .qmake.stash +QMAKE_CLEAN *= $$BUILD_DIR $$TARGET Makefile .qmake.stash QMAKE_CLEAN *= $$glob_filenames(*.pyc, *.qmlc, *.jsc, *.egg-info) diff --git a/live-reload.sh b/live-reload.sh index db236d49..3f6c80d0 100755 --- a/live-reload.sh +++ b/live-reload.sh @@ -10,6 +10,8 @@ export QT_QPA_PLATFORM=xcb CFG='dev no_embedded' +qmake harmonyqml.pro CONFIG+="$CFG" && make + while true; do find src harmonyqml.pro -type f | entr -cdnr sh -c \ diff --git a/src/main.cpp b/src/main.cpp index 50823eaf..13df18d9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,10 +23,11 @@ int main(int argc, char *argv[]) { objectContext->setContextProperty("debugMode", false); #endif + QFileInfo qrcPath(":/qml/Window.qml"); + QQmlComponent component( &engine, - QFileInfo::exists("qrc:/qml/Window.qml") ? - "qrc:/qml/Window.qml" : "src/qml/Window.qml" + qrcPath.exists() ? "qrc:/qml/Window.qml" : "src/qml/Window.qml" ); component.create(objectContext); diff --git a/src/qml/Pages/Default.qml b/src/qml/Pages/Default.qml index 651536d2..68940b31 100644 --- a/src/qml/Pages/Default.qml +++ b/src/qml/Pages/Default.qml @@ -1,5 +1,5 @@ import "../Base" HNoticePage { - text: "Select or add a room to start." + text: qsTr("Add or select a room to start.") }