QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlTranslator Class Reference

A subclass of QTranslator with extended file search capabilities. More...

Inheritance diagram for QtlTranslator:

Public Member Functions

 QtlTranslator (const QString &fileNamePrefix, const QString &localeName=QString(), const QStringList &directories=QStringList(), QObject *parent=0)
 Constructor. More...
 

Static Public Member Functions

static QStringList loadedLocales ()
 Get the list of all loaded locales using this class. More...
 
static QString searchLocaleFile (const QString &fileName)
 Search a locale variant of a file, based on all loaded locales. More...
 

Private Member Functions

 QtlTranslator () Q_DECL_EQ_DELETE
 

Static Private Attributes

static QStringList _loadedLocales
 List of loaded locales. More...
 
static QMutex _loadedLocalesMutex
 Synchronize access to _loadedLocales. More...
 

Detailed Description

A subclass of QTranslator with extended file search capabilities.

Constructor & Destructor Documentation

◆ QtlTranslator() [1/2]

QtlTranslator::QtlTranslator ( const QString &  fileNamePrefix,
const QString &  localeName = QString(),
const QStringList &  directories = QStringList(),
QObject *  parent = 0 
)
explicit

Constructor.

The translator is automatically installed in the application.

Parameters
[in]fileNamePrefixSame as the filename parameter in QTranslator::load() without the locale name part.
[in]localeNameLocale name. Defaults to the system locale.
[in]directoriesList of directories to search for the file. The Qt translation directory is automatically added at the end of the list.
[in]parentOptional parent object.

◆ QtlTranslator() [2/2]

QtlTranslator::QtlTranslator ( )
private

Member Function Documentation

◆ loadedLocales()

QStringList QtlTranslator::loadedLocales ( )
static

Get the list of all loaded locales using this class.

Returns
The list of all loaded locales using this class, most recent first. This list is never empty, its last element is the system locale.

◆ searchLocaleFile()

QString QtlTranslator::searchLocaleFile ( const QString &  fileName)
static

Search a locale variant of a file, based on all loaded locales.

In the list of all loaded locales, seach the first existing file in the form {basename}_{locale}.{suffix}.

Parameters
[in]fileNameA file name.
Returns
The first existing locale variant or fileName if none is found.

Member Data Documentation

◆ _loadedLocales

QStringList QtlTranslator::_loadedLocales
staticprivate

List of loaded locales.

◆ _loadedLocalesMutex

QMutex QtlTranslator::_loadedLocalesMutex
staticprivate

Synchronize access to _loadedLocales.


The documentation for this class was generated from the following files: