cppcheck/cppcheck-1.77-translations.patch
Jon Ciesla 1121bba936 1.77
2017-01-31 15:02:36 -06:00

32 lines
1.6 KiB
Diff

diff -up cppcheck-1.75/gui/translationhandler.cpp.translations cppcheck-1.75/gui/translationhandler.cpp
--- cppcheck-1.75/gui/translationhandler.cpp.translations 2016-08-06 18:49:40.000000000 +0200
+++ cppcheck-1.75/gui/translationhandler.cpp 2016-08-09 06:46:30.207146245 +0200
@@ -116,15 +116,7 @@ bool TranslationHandler::SetLanguage(con
if (datadir.isEmpty())
datadir = appPath;
- QString translationFile;
- if (QFile::exists(datadir + "/lang/" + mTranslations[index].mFilename + ".qm"))
- translationFile = datadir + "/lang/" + mTranslations[index].mFilename + ".qm";
-
- else if (QFile::exists(datadir + "/" + mTranslations[index].mFilename + ".qm"))
- translationFile = datadir + "/" + mTranslations[index].mFilename + ".qm";
-
- else
- translationFile = appPath + "/" + mTranslations[index].mFilename + ".qm";
+ QString translationFile("/usr/share/CppCheck/lang/" + mTranslations[index].mFilename + ".qm");
if (!mTranslator->load(translationFile) && !failure) {
translationFile += ".qm";
--- cppcheck-1.77/gui/CMakeLists.txt.orig 2017-01-31 12:51:02.798598710 -0600
+++ cppcheck-1.77/gui/CMakeLists.txt 2017-01-31 12:51:50.049356022 -0600
@@ -29,7 +29,7 @@
target_link_libraries(cppcheck-gui tinyxml2)
install(TARGETS cppcheck-gui RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)
- install(FILES ${qms} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT applications)
+ install(FILES ${qms} DESTINATION share/${PROJECT_NAME}/lang/ COMPONENT applications)
install(FILES cppcheck-gui.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)