Commit cf938262 authored by Ronan Abhamon's avatar Ronan Abhamon

fix(src/app/translator/DefaultTranslator): ignore qrc QtQuick files

parent f50be474
...@@ -92,7 +92,7 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) { ...@@ -92,7 +92,7 @@ App::App (int &argc, char *argv[]) : SingleApplication(argc, argv, true) {
} }
App::~App () { App::~App () {
qInfo() << "Destroying app..."; qInfo() << QStringLiteral("Destroying app...");
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
...@@ -34,8 +34,12 @@ DefaultTranslator::DefaultTranslator (QObject *parent) : QTranslator(parent) { ...@@ -34,8 +34,12 @@ DefaultTranslator::DefaultTranslator (QObject *parent) : QTranslator(parent) {
if (info.suffix() == "qml") { if (info.suffix() == "qml") {
// Ignore extra selectors. // Ignore extra selectors.
QString dir = info.absoluteDir().dirName(); QString dir = info.absoluteDir().absolutePath();
if (dir == "+linux" || dir == "+mac" || dir == "+windows") if (dir.contains("+linux") || dir.contains("+mac") || dir.contains("+windows"))
continue;
// Ignore default imports.
if (dir.startsWith(":/QtQuick"))
continue; continue;
QString basename = info.baseName(); QString basename = info.baseName();
...@@ -53,6 +57,9 @@ QString DefaultTranslator::translate ( ...@@ -53,6 +57,9 @@ QString DefaultTranslator::translate (
const char *disambiguation, const char *disambiguation,
int n int n
) const { ) const {
if (!context)
return QStringLiteral("");
QString translation = QTranslator::translate(context, source_text, disambiguation, n); QString translation = QTranslator::translate(context, source_text, disambiguation, n);
if (translation.length() == 0 && m_contexts.contains(context)) if (translation.length() == 0 && m_contexts.contains(context))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment