In release mode on Unix search translations first in local directory.
--HG-- branch : develop
This commit is contained in:
parent
f17a12d147
commit
95e32b1e44
|
@ -155,15 +155,7 @@ int main(int argc, char *argv[])
|
|||
app.installTranslator(&qtTranslator);
|
||||
|
||||
QTranslator appTranslator;
|
||||
#ifdef Q_OS_WIN
|
||||
appTranslator.load("valentina_" + checkedLocale, qApp->translationsPath());
|
||||
#else
|
||||
#ifdef QT_DEBUG
|
||||
appTranslator.load("valentina_" + checkedLocale, qApp->translationsPath());
|
||||
#else
|
||||
appTranslator.load("valentina_" + checkedLocale, qApp->translationsPath());
|
||||
#endif
|
||||
#endif
|
||||
app.installTranslator(&appTranslator);
|
||||
|
||||
static const char * GENERIC_ICON_TO_CHECK = "document-open";
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
|
||||
const qreal VApplication::PrintDPI = 96.0;
|
||||
|
||||
|
@ -146,7 +147,15 @@ QString VApplication::pathToTables() const
|
|||
#ifdef QT_DEBUG
|
||||
return QApplication::applicationDirPath() + QStringLiteral("/tables/individual");
|
||||
#else
|
||||
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/tables/individual"));
|
||||
if(dir.exist())
|
||||
{
|
||||
return dir.absolutePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
return QStringLiteral("/usr/share/valentina/tables/individual");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -158,7 +167,15 @@ QString VApplication::pathToTables() const
|
|||
#ifdef QT_DEBUG
|
||||
return QApplication::applicationDirPath() + QStringLiteral("/tables/standard");
|
||||
#else
|
||||
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/tables/standard"));
|
||||
if(dir.exist())
|
||||
{
|
||||
return dir.absolutePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
return QStringLiteral("/usr/share/valentina/tables/standard");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -173,9 +190,17 @@ QString VApplication::translationsPath() const
|
|||
#ifdef QT_DEBUG
|
||||
return QApplication::applicationDirPath() + QStringLiteral("/translations");
|
||||
#else
|
||||
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/translations"));
|
||||
if(dir.exist())
|
||||
{
|
||||
return dir.absolutePath();
|
||||
}
|
||||
else
|
||||
{
|
||||
return QStringLiteral("/usr/share/valentina/translations");
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user