diff --git a/cmake/modules/LXQtPluginTranslationLoader.cpp.in b/cmake/modules/LXQtPluginTranslationLoader.cpp.in new file mode 100644 index 0000000..a337eac --- /dev/null +++ b/cmake/modules/LXQtPluginTranslationLoader.cpp.in @@ -0,0 +1,23 @@ +/* This file has been generated by the CMake lxqt_plugin_translation_loader(). + * It loads LXQt plugin translations. + * + * Attention: All changes will be overwritten!!! + */ + +#include +#include + +/* Dummy helper symbol for referencing. + * In case plugin is linked as static (lib*.a) unreferenced objects are stripped in linking time + * => we need to reference some symbol from this file to be not stripped as a whole. + */ +void * loadPluginTranslation_@catalog_name@_helper = nullptr; + +static void loadPluginTranslation() +{ + //XXX: we don't use the QStringLiteral here because it causes SEGFAULT in static finalization time + // (the string is stored in static QHash and it's destructor can reference already deleted static QString (generated by QStringLiteral)) + LXQt::Translator::translatePlugin("@catalog_name@", "@plugin_type@"); +} + +Q_COREAPP_STARTUP_FUNCTION(loadPluginTranslation) diff --git a/cmake/modules/LXQtTranslationLoader.cmake b/cmake/modules/LXQtTranslationLoader.cmake index c619e14..b29bdaf 100644 --- a/cmake/modules/LXQtTranslationLoader.cmake +++ b/cmake/modules/LXQtTranslationLoader.cmake @@ -59,3 +59,15 @@ function(lxqt_lib_translation_loader source_files catalog_name) ) set(${source_files} ${${source_files}} ${CMAKE_CURRENT_BINARY_DIR}/LXQtLibTranslationLoader.cpp PARENT_SCOPE) endfunction() + +# lxqt_plugin_translation_loader( ) +# The generated .cpp file is added to +# Translations catalog to be loaded +# Plugin type. Example: lxqt-panel +function(lxqt_plugin_translation_loader source_files catalog_name plugin_type) + configure_file( + ${LXQT_CMAKE_MODULES_DIR}/LXQtPluginTranslationLoader.cpp.in + LXQtPluginTranslationLoader.cpp @ONLY + ) + set(${source_files} ${${source_files}} ${CMAKE_CURRENT_BINARY_DIR}/LXQtPluginTranslationLoader.cpp PARENT_SCOPE) +endfunction() diff --git a/configdialog/lxqtconfigdialog.cpp b/configdialog/lxqtconfigdialog.cpp index e469d94..6217761 100644 --- a/configdialog/lxqtconfigdialog.cpp +++ b/configdialog/lxqtconfigdialog.cpp @@ -59,6 +59,12 @@ void ConfigDialog::addPage(QWidget* page, const QString& name, const QString& ic void ConfigDialog::addPage(QWidget* page, const QString& name, const QStringList& iconNames) { + Q_ASSERT(page); + if (!page) + { + return; + } + /* We set the layout margin to 0. In the default configuration, one page * only, it aligns buttons with the page. In multi-page it saves a little * bit of space, without clutter. diff --git a/debian/changelog b/debian/changelog index 0c3e639..de438b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -liblxqt (0.9.0+20150930-1) experimental; urgency=medium +liblxqt (0.9.0+20151019-1) experimental; urgency=medium - * Cherry-picked upstream-version 0.9.0+20150930. + * Cherry-picked upstream-version 0.9.0+20151019-1. * Remove --list-missing from rules, it's included in --fail-missing - -- Alf Gaida Sat, 03 Oct 2015 10:29:34 +0200 + -- Alf Gaida Fri, 23 Oct 2015 22:27:13 +0200 liblxqt (0.9.0+20150911-2) experimental; urgency=medium