1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
diff -Naur re-typeset-1.2.0/re-typeset-src/mainwindow.cpp re-typeset-1.2.0.patched/re-typeset-src/mainwindow.cpp
--- re-typeset-1.2.0/re-typeset-src/mainwindow.cpp 2016-10-13 15:51:19.000000000 -0400
+++ re-typeset-1.2.0.patched/re-typeset-src/mainwindow.cpp 2018-12-25 12:17:28.448448693 -0500
@@ -22,6 +22,7 @@
#include "mainwindow.hpp"
#include "license.hpp"
#include "ui_mainwindow.h"
+#include <QLibraryInfo>
#include <QImage>
#include <QDebug>
#include <QPainter>
@@ -43,7 +44,7 @@
ui->pageSizeWidth->setSuffix( " px" );
createLanguageMenu();
- setWindowIcon( QIcon( QApplication::applicationDirPath() + "res/re-typeset.png" ) );
+ setWindowIcon( QIcon( "/usr/share/pixmaps/re-typeset.png" ) );
QString locale = QLocale::system().name();
locale.truncate(locale.lastIndexOf('_'));
@@ -332,8 +333,8 @@
currLang_ = rLanguage;
QLocale locale = QLocale(currLang_);
QLocale::setDefault(locale);
- switchTranslator(translator_, QString("res/re-typeset_%1.qm").arg(rLanguage));
- switchTranslator(translatorQt_, QString("languages/qt_%1.qm").arg(rLanguage));
+ switchTranslator(translator_, QString("/usr/share/re-typeset/re-typeset_%1.qm").arg(rLanguage));
+ switchTranslator(translatorQt_, QString("%1/qt_%2.qm").arg(QLibraryInfo::location(QLibraryInfo::TranslationsPath)).arg(rLanguage));
}
}
@@ -343,8 +344,7 @@
connect(langGroup, SIGNAL(triggered(QAction *)), this, SLOT(slotLanguageChanged(QAction *)));
QString defaultLocale = QLocale::system().name(); // e.g. "de_DE" // format systems language
defaultLocale.truncate(defaultLocale.lastIndexOf('_')); // e.g. "de"
- langPath_ = QApplication::applicationDirPath();
- langPath_.append("/res");
+ langPath_ = QString("/usr/share/re-typeset");
QDir dir(langPath_);
QStringList fileNames = dir.entryList(QStringList("re-typeset_*.qm"));
if( fileNames.size() == 0 ) {
|