diff --git a/assets/CMakeLists.txt b/assets/CMakeLists.txt index 3b25b1c1b..851ebfbf7 100644 --- a/assets/CMakeLists.txt +++ b/assets/CMakeLists.txt @@ -4,18 +4,23 @@ install(DIRECTORY templates/ install(DIRECTORY models/ DESTINATION "${SOURCES_INSTALL_RPEFIX}/models") -find_package(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools REQUIRED) -# install translation. -if (CMAKE_BUILD_TYPE STREQUAL "Release") - file(GLOB TS_FILES "translations/*.ts") - foreach(TS_FILE IN LISTS TS_FILES) - message(STATUS "process ts file: ${TS_FILE}") - execute_process(COMMAND lrelease ${TS_FILE}) - endforeach() +# Set up translation files +set(TS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/translations") +file(GLOB TS_FILES "${TS_DIR}/*.ts") +set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${TS_DIR}") + +if (QT_VERSION_MAJOR EQUAL 6) + qt6_add_translation(QM_FILES ${TS_FILES}) +else() + qt5_add_translation(QM_FILES ${TS_FILES}) endif() -file(GLOB QM_FILES "translations/*.qm") +add_custom_target(${PROJECT_NAME}_translations ALL DEPENDS ${QM_FILES}) +add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_translations) + +# install translation. install(FILES ${QM_FILES} DESTINATION "${SOURCES_INSTALL_RPEFIX}/translations") # install tools diff --git a/debian/rules b/debian/rules index 47bb90a76..550cb949c 100755 --- a/debian/rules +++ b/debian/rules @@ -4,8 +4,8 @@ export QT_SELECT=5 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) export DEB_BUILD_MAINT_OPTIONS = hardening=+all -export DEB_CFLAGS_MAINT_APPEND = -Wall -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=1 -fPIC -export DEB_CXXFLAGS_MAINT_APPEND = -Wall -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=1 -fPIC +export DEB_CFLAGS_MAINT_APPEND = -Wall -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC +export DEB_CXXFLAGS_MAINT_APPEND = -Wall -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -pie include /usr/share/dpkg/default.mk diff --git a/src/app/main.cpp b/src/app/main.cpp index 32cf578fe..bebb840d9 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -36,7 +36,11 @@ static bool loadPlugins() qInfo() << QString("run application in %0").arg(pluginsPath); lifeCycle.setPluginPaths({ pluginsPath }); - qInfo() << "Depend library paths:" << QApplication::libraryPaths(); + QString dependlibs = CustomPaths::global(CustomPaths::DependLibs); + QCoreApplication::addLibraryPath(dependlibs); + QCoreApplication::addLibraryPath(pluginsPath); + + qInfo() << "Current library paths:" << QApplication::libraryPaths(); qInfo() << "Load plugin paths: " << dpf::LifeCycle::pluginPaths(); // read all plugins in setting paths diff --git a/src/plugins/core/uicontroller/controller.h b/src/plugins/core/uicontroller/controller.h index dd8b7e4b9..feb6e486d 100644 --- a/src/plugins/core/uicontroller/controller.h +++ b/src/plugins/core/uicontroller/controller.h @@ -35,8 +35,6 @@ public slots: //mode : MD_EDIT/MD_DEBUG/MD_RECENT void raiseMode(const QString &mode); - //1 Plugi -> 1navName -> n widget(name) - void setCurrentPlugin(const QString &plugin); void registerWidgetToMode(const QString &name, AbstractWidget *abstractWidget, const QString &mode, Position pos, bool replace, bool isVisible); void registerWidget(const QString &name, AbstractWidget *abstractWidget); void registerWidgetCreator(const QString &name, std::function &widgetCreateFunc);