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);
|
app.installTranslator(&qtTranslator);
|
||||||
|
|
||||||
QTranslator appTranslator;
|
QTranslator appTranslator;
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
appTranslator.load("valentina_" + checkedLocale, qApp->translationsPath());
|
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);
|
app.installTranslator(&appTranslator);
|
||||||
|
|
||||||
static const char * GENERIC_ICON_TO_CHECK = "document-open";
|
static const char * GENERIC_ICON_TO_CHECK = "document-open";
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
const qreal VApplication::PrintDPI = 96.0;
|
const qreal VApplication::PrintDPI = 96.0;
|
||||||
|
|
||||||
|
@ -146,7 +147,15 @@ QString VApplication::pathToTables() const
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
return QApplication::applicationDirPath() + QStringLiteral("/tables/individual");
|
return QApplication::applicationDirPath() + QStringLiteral("/tables/individual");
|
||||||
#else
|
#else
|
||||||
return QStringLiteral("/usr/share/valentina/tables/individual");
|
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/tables/individual"));
|
||||||
|
if(dir.exist())
|
||||||
|
{
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return QStringLiteral("/usr/share/valentina/tables/individual");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -158,7 +167,15 @@ QString VApplication::pathToTables() const
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
return QApplication::applicationDirPath() + QStringLiteral("/tables/standard");
|
return QApplication::applicationDirPath() + QStringLiteral("/tables/standard");
|
||||||
#else
|
#else
|
||||||
return QStringLiteral("/usr/share/valentina/tables/standard");
|
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/tables/standard"));
|
||||||
|
if(dir.exist())
|
||||||
|
{
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return QStringLiteral("/usr/share/valentina/tables/standard");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -172,10 +189,18 @@ QString VApplication::translationsPath() const
|
||||||
#else
|
#else
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
return QApplication::applicationDirPath() + QStringLiteral("/translations");
|
return QApplication::applicationDirPath() + QStringLiteral("/translations");
|
||||||
#else
|
#else
|
||||||
|
QDir dir(QApplication::applicationDirPath() + QStringLiteral("/translations"));
|
||||||
|
if(dir.exist())
|
||||||
|
{
|
||||||
|
return dir.absolutePath();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
return QStringLiteral("/usr/share/valentina/translations");
|
return QStringLiteral("/usr/share/valentina/translations");
|
||||||
#endif
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user