From 13b9eaa25f842ca8c7389567bf68d30d5e8ada1e Mon Sep 17 00:00:00 2001 From: iaom Date: Fri, 25 Aug 2023 10:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=89=8D=E7=AB=AF=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E6=96=87=E4=BB=B6=E5=AE=89=E8=A3=85=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/CMakeLists.txt | 5 +++-- frontend/ukui-search-gui.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/CMakeLists.txt b/frontend/CMakeLists.txt index f78b0fe..401c86a 100644 --- a/frontend/CMakeLists.txt +++ b/frontend/CMakeLists.txt @@ -65,9 +65,10 @@ add_executable(ukui-search ${QRC_FILES} ${UKUI_SEARCH_QM_FILES} ${UKUI_SEARCH_APP_WIDGET_QM_FILES}) - +set(UKUI_SEARCH_QM_INSTALL_PATH /usr/share/ukui-search/translations/ukui-search) target_compile_definitions(ukui-search PRIVATE VERSION="${UKUI_SEARCH_VERSION}" + UKUI_SEARCH_QM_INSTALL_PATH="${UKUI_SEARCH_QM_INSTALL_PATH}" ) target_link_libraries(ukui-search PRIVATE @@ -117,7 +118,7 @@ install(FILES ${UKUI_SEARCH_APP_WIDGET_QM_FILES} DESTINATION /usr/share/appwidge #二进制 install(TARGETS ukui-search RUNTIME DESTINATION /usr/bin) #翻译 -install(FILES ${UKUI_SEARCH_QM_FILES} DESTINATION /usr/share/ukui-search/translations/) +install(FILES ${UKUI_SEARCH_QM_FILES} DESTINATION ${UKUI_SEARCH_QM_INSTALL_PATH}) #desktop文件 install(FILES ../data/ukui-search-menu.desktop DESTINATION /usr/share/applications) install(FILES ../data/ukui-search.desktop DESTINATION /etc/xdg/autostart) diff --git a/frontend/ukui-search-gui.cpp b/frontend/ukui-search-gui.cpp index 8611627..9fab07b 100644 --- a/frontend/ukui-search-gui.cpp +++ b/frontend/ukui-search-gui.cpp @@ -45,10 +45,10 @@ UkuiSearchGui::UkuiSearchGui(int &argc, char *argv[], const QString &application //load translations. QTranslator *translator = new QTranslator(this); try { - if(! translator->load("/usr/share/ukui-search/translations/" + QLocale::system().name())) throw - 1; + if(! translator->load(UKUI_SEARCH_QM_INSTALL_PATH"/" + QLocale::system().name())) throw - 1; this->installTranslator(translator); } catch(...) { - qDebug() << "Load translations file" << QLocale() << "failed!"; + qDebug() << "Load translations file: " << UKUI_SEARCH_QM_INSTALL_PATH << QLocale() << "failed!"; } QTranslator *qt_translator = new QTranslator(this);