| 1 | This patch distinguishes between the data directory path for GUI and the one
|
| 2 | for non-GUI by allowing to set the former path.
|
| 3 |
|
| 4 | highlight package has two outputs: out and gui. Both outputs have files which
|
| 5 | will be in the same directory /share/highlight/ without this patch (see also
|
| 6 | install and install-gui tasks in makefile). In the gui's data directory,
|
| 7 | there are GUI specific files in /share/highlight/gui-files/{l10n,ext}/.
|
| 8 |
|
| 9 | diff --git a/src/gui-qt/main.cpp b/src/gui-qt/main.cpp
|
| 10 | index 4700dc1..3567745 100644
|
| 11 | |
| 12 | |
| 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
|
| 24 | diff --git a/src/gui-qt/mainwindow.cpp b/src/gui-qt/mainwindow.cpp
|
| 25 | index 3a21ad2..f060431 100644
|
| 26 | |
| 27 | |
| 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
|
| 39 | diff --git a/src/makefile b/src/makefile
|
| 40 | index b1d7988..2963105 100644
|
| 41 | |
| 42 | |
| 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
|