File: LXQtPluginTranslationLoader.cpp.in

package info (click to toggle)
lxqt-build-tools 2.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: perl: 42; sh: 14; makefile: 6
file content (25 lines) | stat: -rw-r--r-- 985 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* This file has been generated by the CMake lxqt_plugin_translation_loader().
 * It loads LXQt plugin translations.
 *
 * Attention: All changes will be overwritten!!!
 */

#include <QCoreApplication>
#include <QLatin1String>

#include <LXQt/Translator>

/* 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(QLatin1String("@catalog_name@"), QLatin1String("@plugin_type@"));
}

Q_COREAPP_STARTUP_FUNCTION(loadPluginTranslation)