projects/guix·blob java-team · refs

51 lines · 2.2 KiB

1This patch distinguishes between the data directory path for GUI and the one
2for non-GUI by allowing to set the former path.
3
4highlight package has two outputs: out and gui. Both outputs have files which
5will be in the same directory /share/highlight/ without this patch (see also
6install and install-gui tasks in makefile). In the gui's data directory,
7there are GUI specific files in /share/highlight/gui-files/{l10n,ext}/.
8
9diff --git a/src/gui-qt/main.cpp b/src/gui-qt/main.cpp
10index 4700dc1..3567745 100644
11--- a/src/gui-qt/main.cpp
12+++ b/src/gui-qt/main.cpp
13@@ -47,8 +47,8 @@ int main(int argc, char *argv[])
14 {
15 QApplication app(argc, argv);
16 QTranslator translator;
17-#ifdef DATA_DIR
18- translator.load(QString("%1/gui_files/l10n/highlight_%2").arg(DATA_DIR).arg(QLocale::system().name()));
19+#ifdef GUI_DATA_DIR
20+ translator.load(QString("%1/gui_files/l10n/highlight_%2").arg(GUI_DATA_DIR).arg(QLocale::system().name()));
21 #else
22 translator.load(QString("%1/gui_files/l10n/highlight_%2").arg(QDir::currentPath()).arg(QLocale::system().name()));
23 #endif
24diff --git a/src/gui-qt/mainwindow.cpp b/src/gui-qt/mainwindow.cpp
25index 3a21ad2..f060431 100644
26--- a/src/gui-qt/mainwindow.cpp
27+++ b/src/gui-qt/mainwindow.cpp
28@@ -2131,8 +2131,8 @@ QString MainWindow::getDistFileFilterPath(){
29 #ifdef Q_OS_OSX
30 return QCoreApplication::applicationDirPath()+"/../Resources/gui_files/ext/fileopenfilter.conf";
31 #else
32- #ifdef DATA_DIR
33- return QString(DATA_DIR) + "/gui_files/ext/fileopenfilter.conf";
34+ #ifdef GUI_DATA_DIR
35+ return QString(GUI_DATA_DIR) + "/gui_files/ext/fileopenfilter.conf";
36 #else
37 return QDir::currentPath()+"/gui_files/ext/fileopenfilter.conf";
38 #endif
39diff --git a/src/makefile b/src/makefile
40index b1d7988..2963105 100644
41--- a/src/makefile
42+++ b/src/makefile
43@@ -118,7 +118,7 @@ gui-qt: highlight-gui
44
45 highlight-gui: libhighlight.a ${GUI_OBJECTS}
46 cd gui-qt && \
47- ${QMAKE} 'DEFINES+=DATA_DIR=\\\"${HL_DATA_DIR}\\\" CONFIG_DIR=\\\"${HL_CONFIG_DIR}\\\" DOC_DIR=\\\"${HL_DOC_DIR}\\\" ' && \
48+ ${QMAKE} 'DEFINES+=DATA_DIR=\\\"${HL_DATA_DIR}\\\" CONFIG_DIR=\\\"${HL_CONFIG_DIR}\\\" DOC_DIR=\\\"${HL_DOC_DIR}\\\" GUI_DATA_DIR=\\\"${GUI_DATA_DIR}\\\" ' && \
49 $(MAKE)
50
51 $(OBJECTFILES) : makefile