Skip to content

Commit a6d0b5b

Browse files
deepin-mozartdeepin-bot[bot]
authored andcommitted
fix: runtime not correct
Log: Change-Id: I3b0e46adb702f8190b1c178e819ccadcc5581e44
1 parent 2be2562 commit a6d0b5b

4 files changed

Lines changed: 21 additions & 14 deletions

File tree

assets/CMakeLists.txt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@ install(DIRECTORY templates/
44
install(DIRECTORY models/
55
DESTINATION "${SOURCES_INSTALL_RPEFIX}/models")
66

7-
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools)
7+
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools REQUIRED)
88

9-
# install translation.
10-
if (CMAKE_BUILD_TYPE STREQUAL "Release")
11-
file(GLOB TS_FILES "translations/*.ts")
12-
foreach(TS_FILE IN LISTS TS_FILES)
13-
message(STATUS "process ts file: ${TS_FILE}")
14-
execute_process(COMMAND lrelease ${TS_FILE})
15-
endforeach()
9+
# Set up translation files
10+
set(TS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/translations")
11+
file(GLOB TS_FILES "${TS_DIR}/*.ts")
12+
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${TS_DIR}")
13+
14+
if (QT_VERSION_MAJOR EQUAL 6)
15+
qt6_add_translation(QM_FILES ${TS_FILES})
16+
else()
17+
qt5_add_translation(QM_FILES ${TS_FILES})
1618
endif()
1719

18-
file(GLOB QM_FILES "translations/*.qm")
20+
add_custom_target(${PROJECT_NAME}_translations ALL DEPENDS ${QM_FILES})
21+
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_translations)
22+
23+
# install translation.
1924
install(FILES ${QM_FILES} DESTINATION "${SOURCES_INSTALL_RPEFIX}/translations")
2025

2126
# install tools

debian/rules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export QT_SELECT=5
44
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
55

66
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
7-
export DEB_CFLAGS_MAINT_APPEND = -Wall -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=1 -fPIC
8-
export DEB_CXXFLAGS_MAINT_APPEND = -Wall -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=1 -fPIC
7+
export DEB_CFLAGS_MAINT_APPEND = -Wall -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC
8+
export DEB_CXXFLAGS_MAINT_APPEND = -Wall -fPIE -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC
99
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -pie
1010

1111
include /usr/share/dpkg/default.mk

src/app/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ static bool loadPlugins()
3636
qInfo() << QString("run application in %0").arg(pluginsPath);
3737
lifeCycle.setPluginPaths({ pluginsPath });
3838

39-
qInfo() << "Depend library paths:" << QApplication::libraryPaths();
39+
QString dependlibs = CustomPaths::global(CustomPaths::DependLibs);
40+
QCoreApplication::addLibraryPath(dependlibs);
41+
QCoreApplication::addLibraryPath(pluginsPath);
42+
43+
qInfo() << "Current library paths:" << QApplication::libraryPaths();
4044
qInfo() << "Load plugin paths: " << dpf::LifeCycle::pluginPaths();
4145

4246
// read all plugins in setting paths

src/plugins/core/uicontroller/controller.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public slots:
3535
//mode : MD_EDIT/MD_DEBUG/MD_RECENT
3636
void raiseMode(const QString &mode);
3737

38-
//1 Plugi -> 1navName -> n widget(name)
39-
void setCurrentPlugin(const QString &plugin);
4038
void registerWidgetToMode(const QString &name, AbstractWidget *abstractWidget, const QString &mode, Position pos, bool replace, bool isVisible);
4139
void registerWidget(const QString &name, AbstractWidget *abstractWidget);
4240
void registerWidgetCreator(const QString &name, std::function<AbstractWidget*()> &widgetCreateFunc);

0 commit comments

Comments
 (0)