make install. Corrected paths to translations.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-08-08 11:22:51 +03:00
parent 65c09f7547
commit 1dece1e9e5
3 changed files with 78 additions and 50 deletions

View File

@ -241,34 +241,40 @@ QString MApplication::translationsPath() const
{ {
return QApplication::applicationDirPath() + "/../../valentina/bin" + trPath; return QApplication::applicationDirPath() + "/../../valentina/bin" + trPath;
} }
#else #elif defined(Q_OS_MAC)
#ifdef QT_DEBUG QDir dirBundle(QApplication::applicationDirPath() + QStringLiteral("/../Resources") + trPath);
if (dirBundle.exists())
{
return dirBundle.absolutePath();
}
else
{
QDir dir(QApplication::applicationDirPath() + trPath); QDir dir(QApplication::applicationDirPath() + trPath);
if (dir.exists()) if (dir.exists())
{ {
return dir.absolutePath(); return dir.absolutePath();
} }
else else
{
return QApplication::applicationDirPath() + "/../../valentina/bin" + trPath;
}
#else
QDir dir1(QApplication::applicationDirPath() + trPath);
if (dir1.exists())
{
return dir1.absolutePath();
}
QDir dir2(QApplication::applicationDirPath() + "/../../valentina/bin" + trPath);
if (dir2.exists())
{
return dir2.absolutePath();
}
else
{ {
return QStringLiteral("/usr/share/valentina/translations"); return QStringLiteral("/usr/share/valentina/translations");
} }
#endif }
#else // Unix
QDir dir1(QApplication::applicationDirPath() + trPath);
if (dir1.exists())
{
return dir1.absolutePath();
}
QDir dir2(QApplication::applicationDirPath() + "/../../valentina/bin" + trPath);
if (dir2.exists())
{
return dir2.absolutePath();
}
else
{
return QStringLiteral("/usr/share/valentina/translations");
}
#endif #endif
} }
@ -277,17 +283,15 @@ QString MApplication::diagramsPath() const
{ {
const QString dPath = QStringLiteral("/diagrams.rcc"); const QString dPath = QStringLiteral("/diagrams.rcc");
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QFileInfo file(QApplication::applicationDirPath() + dPath); return QApplication::applicationDirPath() + dPath;
if (file.exists()) #elif defined(Q_OS_MAC)
QFileInfo fileBundle(QApplication::applicationDirPath() + QStringLiteral("/../Resources") + dPath);
if (fileBundle.exists())
{ {
return file.absoluteFilePath(); return fileBundle.absoluteFilePath();
} }
else else
{ {
return QApplication::applicationDirPath() + "../../app/tape/bin" + dPath;
}
#else
#ifdef QT_DEBUG
QFileInfo file(QApplication::applicationDirPath() + dPath); QFileInfo file(QApplication::applicationDirPath() + dPath);
if (file.exists()) if (file.exists())
{ {
@ -295,25 +299,19 @@ QString MApplication::diagramsPath() const
} }
else else
{ {
return QApplication::applicationDirPath() + "../../app/tape/bin" + dPath; return QStringLiteral("/usr/share/valentina") + dPath;
} }
#else }
QFileInfo file1(QApplication::applicationDirPath() + dPath); #else // Unix
if (file1.exists()) QFileInfo file(QApplication::applicationDirPath() + dPath);
{ if (file.exists())
return file1.absoluteFilePath(); {
} return file.absoluteFilePath();
}
QFileInfo file2(QApplication::applicationDirPath() + "../../app/tape/bin" + dPath); else
if (file2.exists()) {
{ return QStringLiteral("/usr/share/valentina") + dPath;
return file2.absoluteFilePath(); }
}
else
{
return QStringLiteral("/usr/share/valentina");
}
#endif
#endif #endif
} }

View File

@ -277,10 +277,14 @@ QString VApplication::translationsPath() const
const QString trPath = QStringLiteral("/translations"); const QString trPath = QStringLiteral("/translations");
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
return QApplication::applicationDirPath() + trPath; return QApplication::applicationDirPath() + trPath;
#else #elif defined(Q_OS_MAC)
#ifdef QT_DEBUG QDir dirBundle(QApplication::applicationDirPath() + QStringLiteral("/../Resources") + trPath);
return QApplication::applicationDirPath() + trPath; if (dirBundle.exists())
#else {
return dirBundle.absolutePath();
}
else
{
QDir dir(QApplication::applicationDirPath() + trPath); QDir dir(QApplication::applicationDirPath() + trPath);
if (dir.exists()) if (dir.exists())
{ {
@ -290,7 +294,17 @@ QString VApplication::translationsPath() const
{ {
return QStringLiteral("/usr/share/valentina/translations"); return QStringLiteral("/usr/share/valentina/translations");
} }
#endif }
#else // Unix
QDir dir(QApplication::applicationDirPath() + trPath);
if (dir.exists())
{
return dir.absolutePath();
}
else
{
return QStringLiteral("/usr/share/valentina/translations");
}
#endif #endif
} }

View File

@ -988,6 +988,9 @@ unix{
# Path to bin file after installation # Path to bin file after installation
target.path = $$PREFIX/bin target.path = $$PREFIX/bin
tape.path = $$PREFIX/bin
tape.files += $${OUT_PWD}/../tape/$${DESTDIR}/tape
# .desktop file # .desktop file
desktop.path = $$DATADIR/applications/ desktop.path = $$DATADIR/applications/
desktop.files += ../../../dist/$${TARGET}.desktop desktop.files += ../../../dist/$${TARGET}.desktop
@ -1007,6 +1010,7 @@ unix{
INSTALLS += \ INSTALLS += \
target \ target \
tape \
desktop \ desktop \
pixmaps \ pixmaps \
translations \ translations \
@ -1788,6 +1792,9 @@ unix{
libraries.files += $${OUT_PWD}/../../libs/qmuparser/$${DESTDIR}/libqmuparser.2.dylib libraries.files += $${OUT_PWD}/../../libs/qmuparser/$${DESTDIR}/libqmuparser.2.dylib
libraries.files += $${OUT_PWD}/../../libs/vpropertyexplorer/$${DESTDIR}/libvpropertyexplorer.1.dylib libraries.files += $${OUT_PWD}/../../libs/vpropertyexplorer/$${DESTDIR}/libvpropertyexplorer.1.dylib
tape.path = $$MACOS_DIR
tape.files += $${OUT_PWD}/../tape/$${DESTDIR}/tape
# Utility pdftops need for saving a layout image to PS and EPS formates. # Utility pdftops need for saving a layout image to PS and EPS formates.
xpdf.path = $$MACOS_DIR xpdf.path = $$MACOS_DIR
xpdf.files += $${PWD}/../../../dist/macx/bin64/pdftops xpdf.files += $${PWD}/../../../dist/macx/bin64/pdftops
@ -1799,10 +1806,16 @@ unix{
standard.path = $$RESOURCES_DIR/tables/standard/ standard.path = $$RESOURCES_DIR/tables/standard/
standard.files = $$INSTALL_STANDARD_MEASHUREMENTS standard.files = $$INSTALL_STANDARD_MEASHUREMENTS
# Copy to bundle standard measurements files
diagrams.path = $$RESOURCES_DIR/
diagrams.files = $${OUT_PWD}/../tape/$${DESTDIR}/diagrams.rcc
QMAKE_BUNDLE_DATA += \ QMAKE_BUNDLE_DATA += \
standard \ standard \
libraries \ libraries \
xpdf tape \
xpdf \
diagrams
} }
} }
@ -1813,6 +1826,9 @@ win32{
package.files += \ package.files += \
$${OUT_PWD}/$${DESTDIR}/valentina.exe \ $${OUT_PWD}/$${DESTDIR}/valentina.exe \
$${OUT_PWD}/$${DESTDIR}/valentina.exe.dbg \ $${OUT_PWD}/$${DESTDIR}/valentina.exe.dbg \
$${OUT_PWD}/../tape/$${DESTDIR}/tape.exe \
$${OUT_PWD}/../tape/$${DESTDIR}/tape.exe.dbg \
$${OUT_PWD}/../tape/$${DESTDIR}/diagrams.rcc \
$$PWD/../../../dist/win/valentina.ico \ $$PWD/../../../dist/win/valentina.ico \
$$PWD/../../../dist/win/curl.exe \ $$PWD/../../../dist/win/curl.exe \
$$PWD/../../../dist/win/exchndl.dll \ $$PWD/../../../dist/win/exchndl.dll \