From 747787eae9abd578102f39cd9113ffe564cbb84e Mon Sep 17 00:00:00 2001 From: Daniel Brunner <0xFEEDC0DE64@gmail.com> Date: Sun, 14 Oct 2018 15:35:08 +0200 Subject: [PATCH] cmake plugin cleanups --- CMakeLists.txt | 8 +++++++- lunchmealplugin.cpp | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eed9ceb..fbbded4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,13 @@ set(FORMS lunchmealdialog.ui ) -add_library(zeiterfassung-plugins-lunchmealplugin SHARED ${HEADERS} ${SOURCES} ${RESOURCES} ${FORMS}) +set(OTHER_FILES + lunchmealplugin.json +) + +add_library(zeiterfassung-plugins-lunchmealplugin SHARED ${HEADERS} ${SOURCES} ${RESOURCES} ${FORMS} ${OTHER_FILES}) + +set_target_properties(zeiterfassung-plugins-lunchmealplugin PROPERTIES OUTPUT_NAME lunchmealplugin PREFIX "") target_link_libraries(zeiterfassung-plugins-lunchmealplugin Qt5::Core Qt5::Gui Qt5::Widgets zeiterfassungguilib zeiterfassungnetworklib) diff --git a/lunchmealplugin.cpp b/lunchmealplugin.cpp index a7414d8..52da55a 100644 --- a/lunchmealplugin.cpp +++ b/lunchmealplugin.cpp @@ -6,6 +6,8 @@ #include #include +#include "utils/fileutils.h" + #include "mainwindow.h" #include "stripswidget.h" @@ -17,9 +19,7 @@ LunchMealPlugin::LunchMealPlugin(QObject *parent) : { qDebug() << "called"; - static auto dir = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(QStringLiteral("translations")); - - if(m_translator.load(QLocale(), QStringLiteral("lunchmealplugin"), QStringLiteral("_"), dir)) + if(m_translator.load(QLocale(), QStringLiteral("lunchmealplugin"), QStringLiteral("_"), translationsDir())) { if(!QCoreApplication::installTranslator(&m_translator)) {