From c98608967f1c7e07af05bd36527ce40c970a269d Mon Sep 17 00:00:00 2001 From: dismine Date: Thu, 21 Nov 2013 15:06:23 +0200 Subject: [PATCH] Make install in qmake. Path to translation in release build. --HG-- branch : develop --- Valentina.pro | 15 +++++++++++++++ src/main.cpp | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/Valentina.pro b/Valentina.pro index cbecf8c36..6ea590d3b 100644 --- a/Valentina.pro +++ b/Valentina.pro @@ -107,3 +107,18 @@ message(Settings: $$[QT_INSTALL_SETTINGS]) message(Examples: $$[QT_INSTALL_EXAMPLES]) win32:RC_FILE = share/resources/valentina.rc + +unix { +#VARIABLES +isEmpty(PREFIX) { + PREFIX = /usr +} +BINDIR = $$PREFIX/bin +DATADIR =$$PREFIX/share +DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\" +#MAKE INSTALL +target.path = /usr/bin +translations.path = /usr/share/valentina/translations +translations.files = bin/*.qm +INSTALLS += target translations +} diff --git a/src/main.cpp b/src/main.cpp index 52f4bd901..adae5182d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -69,7 +69,11 @@ int main(int argc, char *argv[]) app.installTranslator(&qtTranslator); QTranslator appTranslator; +#ifdef QT_DEBUG appTranslator.load("valentina_" + QLocale::system().name(), "."); +#else + appTranslator.load("valentina_" + QLocale::system().name(), "/usr/share/valentina/translations"); +#endif app.installTranslator(&appTranslator); MainWindow w;