diff options
author | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2019-09-29 15:16:47 +0200 |
---|---|---|
committer | Maciej S. Szmigiero <mail@maciej.szmigiero.name> | 2019-09-29 15:16:52 +0200 |
commit | 65aa4957ad0167880ef990bb355b8bdcd2875b7d (patch) | |
tree | 6766fbc8836552512850b38d3f7434df1d7b17c9 | |
parent | fd1369d8fcda295af879e5db5e28099881f6ca4a (diff) |
Make sure resources are built just once
Currently, the project resources are built twice: the first time in the
"main" directory and the second time in the "src" directory.
This is because they are specified both in main.pro and src.pro qmake
project files (and in qtpass.pro, too).
They should be specified in just one such project file instead so they
are built just once.
Let's leave them in src.pro since that's where localization *.ts -> *.qm
dependencies are provided.
For this, a Q_INIT_RESOURCE() statement is needed so they are properly
linked to by the main application.
-rw-r--r-- | main/main.cpp | 3 | ||||
-rw-r--r-- | main/main.pro | 2 | ||||
-rw-r--r-- | qtpass.pro | 2 |
3 files changed, 3 insertions, 4 deletions
diff --git a/main/main.cpp b/main/main.cpp index 907aa9e2..c5688537 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -4,6 +4,7 @@ #endif #include <QApplication> +#include <QDir> #include <QTranslator> /*! \mainpage QtPass @@ -67,6 +68,8 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); #endif + Q_INIT_RESOURCE(resources); + QCoreApplication::setOrganizationName("IJHack"); QCoreApplication::setOrganizationDomain("ijhack.org"); QCoreApplication::setApplicationName("QtPass"); diff --git a/main/main.pro b/main/main.pro index 64cf8200..619b6bcc 100644 --- a/main/main.pro +++ b/main/main.pro @@ -17,8 +17,6 @@ macx { SOURCES += main.cpp -RESOURCES += ../resources.qrc - isEmpty(PREFIX) { PREFIX = $$(PREFIX) } @@ -9,8 +9,6 @@ OTHER_FILES += LICENSE \ README.md \ qtpass.1 -RESOURCES += resources.qrc - # add Makefile target to generate code coverage using gcov gcov.target = gcov gcov.commands += cd src/$$OBJECTS_DIR && gcov "*.gcda" 1>/dev/null $$escape_expand(\\n\\t) |