mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-17 19:20:46 +00:00
Merge branch 'master' into version
This commit is contained in:
commit
844add8c92
@ -19,6 +19,7 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
|
|
||||||
#include "SleepLib/common.h"
|
#include "SleepLib/common.h"
|
||||||
@ -214,12 +215,36 @@ QStringList getBuildInfo() {
|
|||||||
|
|
||||||
QString appResourcePath()
|
QString appResourcePath()
|
||||||
{
|
{
|
||||||
|
static QString path;
|
||||||
|
if ( path.size() != 0 )
|
||||||
|
return path;
|
||||||
|
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
QString path = QDir::cleanPath(QCoreApplication::applicationDirPath() + "/../Resources");
|
path = QDir::cleanPath(QCoreApplication::applicationDirPath() + "/../Resources");
|
||||||
#else
|
#else
|
||||||
// not sure where it goes on Linux yet
|
// QStringList paths = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
|
||||||
QString path = QCoreApplication::applicationDirPath();
|
// Check the Appiication Path first, so we can execute out of the build directory
|
||||||
|
QStringList paths;
|
||||||
|
// This one will be used if the Html and Translations folders
|
||||||
|
// are in the same folder as the OSCAR executable
|
||||||
|
paths.push_back( QCoreApplication::applicationDirPath() );
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
paths.push_back( QString( "/usr/share/" ) + QCoreApplication::applicationName() );
|
||||||
|
paths.push_back( QString( "/usr/local/share/" ) + QCoreApplication::applicationName() );
|
||||||
|
#endif
|
||||||
|
for (auto p = begin(paths); p != end(paths); ++p ) {
|
||||||
|
QString fname = *p+QString("/Translations/oscar_qt_fr.qm");
|
||||||
|
qDebug() << "Trying" << fname;
|
||||||
|
QFileInfo f = QFileInfo(fname);
|
||||||
|
if ( f.exists() ) {
|
||||||
|
path = *p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( path.size() == 0 )
|
||||||
|
path = QCoreApplication::applicationDirPath();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,6 +361,9 @@ int main(int argc, char *argv[]) {
|
|||||||
// selection QDialog, which waits indefinitely for user input before MainWindow is constructed.
|
// selection QDialog, which waits indefinitely for user input before MainWindow is constructed.
|
||||||
|
|
||||||
qDebug().noquote() << "OSCAR starting" << QDateTime::currentDateTime().toString();
|
qDebug().noquote() << "OSCAR starting" << QDateTime::currentDateTime().toString();
|
||||||
|
qDebug() << "APP-NAME:" << QCoreApplication::applicationName();
|
||||||
|
qDebug() << "APP-PATH:" << QCoreApplication::applicationDirPath();
|
||||||
|
qDebug() << "APP-RESOURCES:" << appResourcePath();
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
QString relinfo = " debug";
|
QString relinfo = " debug";
|
||||||
|
Loading…
Reference in New Issue
Block a user