mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 03:30:44 +00:00
Fix resource paths on MacOS
This commit is contained in:
parent
caefe700ff
commit
b3b354d00d
@ -9,6 +9,8 @@
|
|||||||
#include <QGLWidget>
|
#include <QGLWidget>
|
||||||
#include <QOpenGLFunctions>
|
#include <QOpenGLFunctions>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
#include "SleepLib/common.h"
|
#include "SleepLib/common.h"
|
||||||
#include "common_gui.h"
|
#include "common_gui.h"
|
||||||
@ -86,6 +88,16 @@ QString getBranchVersion()
|
|||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString appResourcePath()
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
QString path = QDir::cleanPath(QCoreApplication::applicationDirPath() + "/../Resources");
|
||||||
|
#else
|
||||||
|
// not sure where it goes on Linux yet
|
||||||
|
QString path = QCoreApplication::applicationDirPath();
|
||||||
|
#endif
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
Qt::DayOfWeek firstDayOfWeekFromLocale()
|
Qt::DayOfWeek firstDayOfWeekFromLocale()
|
||||||
{
|
{
|
||||||
|
@ -18,6 +18,7 @@ Qt::DayOfWeek firstDayOfWeekFromLocale();
|
|||||||
|
|
||||||
QString getBranchVersion();
|
QString getBranchVersion();
|
||||||
|
|
||||||
|
QString appResourcePath();
|
||||||
|
|
||||||
const QString CSTR_GFX_ANGLE = "ANGLE";
|
const QString CSTR_GFX_ANGLE = "ANGLE";
|
||||||
const QString CSTR_GFX_OpenGL = "OpenGL";
|
const QString CSTR_GFX_OpenGL = "OpenGL";
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
#include "common_gui.h"
|
||||||
#include "help.h"
|
#include "help.h"
|
||||||
#include "ui_help.h"
|
#include "ui_help.h"
|
||||||
|
|
||||||
@ -22,11 +23,9 @@ Help::Help(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
helpEngine = new QHelpEngine(QCoreApplication::applicationDirPath() + "/Help/help.qhc", this);
|
helpEngine = new QHelpEngine(appResourcePath() + "/Help/help.qhc", this);
|
||||||
helpEngine->setupData();
|
helpEngine->setupData();
|
||||||
|
|
||||||
// QString helpFile = QCoreApplication::applicationDirPath() + "/Help/help_en.qch";
|
|
||||||
|
|
||||||
/*if (!helpEngine->registeredDocumentations().contains(helpFile)) {
|
/*if (!helpEngine->registeredDocumentations().contains(helpFile)) {
|
||||||
if (helpEngine->registerDocumentation(helpFile)) {
|
if (helpEngine->registerDocumentation(helpFile)) {
|
||||||
qDebug() << "Registered" << helpFile;
|
qDebug() << "Registered" << helpFile;
|
||||||
|
@ -321,14 +321,15 @@ win32 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mac {
|
macx {
|
||||||
TransFiles.files = $$files(../Translations/*.qm)
|
TransFiles.files = $$files(../Translations/*.qm)
|
||||||
TransFiles.path = Contents/Resources/Translations
|
TransFiles.path = Contents/Resources/Translations
|
||||||
HelpFiles.files = $$files(../Help/*.qch)
|
HelpFiles.files = $$files(help/*.qch)
|
||||||
HelpFiles.files += $$files(../Help/help.qhc)
|
HelpFiles.files += $$files(help/help.qhc)
|
||||||
HelpFiles.path = Contents/Resources/Help
|
HelpFiles.path = Contents/Resources/Help
|
||||||
QMAKE_BUNDLE_DATA += TransFiles
|
QMAKE_BUNDLE_DATA += TransFiles
|
||||||
QMAKE_BUNDLE_DATA += HelpFiles
|
QMAKE_BUNDLE_DATA += HelpFiles
|
||||||
|
message("Setting up Translations & Help Transfers")
|
||||||
}
|
}
|
||||||
|
|
||||||
#include(../3rdparty/quazip/quazip/quazip.pri)
|
#include(../3rdparty/quazip/quazip/quazip.pri)
|
||||||
|
@ -20,9 +20,11 @@
|
|||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
|
|
||||||
#ifndef nullptr
|
#include "common_gui.h"
|
||||||
#define nullptr NULL
|
|
||||||
#endif
|
//#ifndef nullptr
|
||||||
|
//#define nullptr NULL
|
||||||
|
//#endif
|
||||||
|
|
||||||
#include "translation.h"
|
#include "translation.h"
|
||||||
|
|
||||||
@ -42,11 +44,7 @@ void initTranslations(QSettings & settings) {
|
|||||||
|
|
||||||
QHash<QString, QString> langFiles;
|
QHash<QString, QString> langFiles;
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
const QString transdir = appResourcePath() +"/Translations";
|
||||||
QString transdir = QDir::cleanPath(QCoreApplication::applicationDirPath() + "/../Resources/Translations/");
|
|
||||||
#else
|
|
||||||
const QString transdir = QCoreApplication::applicationDirPath() + "/Translations/";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QDir dir(transdir);
|
QDir dir(transdir);
|
||||||
qDebug() << "Scanning" << transdir.toLocal8Bit().data();
|
qDebug() << "Scanning" << transdir.toLocal8Bit().data();
|
||||||
|
Loading…
Reference in New Issue
Block a user