27 |
#include <QApplication> |
#include <QApplication> |
28 |
#include <QTranslator> |
#include <QTranslator> |
29 |
#include <QLocale> |
#include <QLocale> |
30 |
|
#if defined(__APPLE__) // Toshi Nagata 20080105 |
31 |
|
#include <QDir> |
32 |
|
#endif |
33 |
|
|
34 |
//------------------------------------------------------------------------- |
//------------------------------------------------------------------------- |
35 |
// main - The main program trunk. |
// main - The main program trunk. |
54 |
app.installTranslator(&translator); |
app.installTranslator(&translator); |
55 |
} |
} |
56 |
|
|
57 |
|
#if defined(__APPLE__) // Toshi Nagata 20080105 |
58 |
|
{ |
59 |
|
// Set the plugin path to @exetutable_path/../plugins |
60 |
|
QDir dir(QApplication::applicationDirPath()); |
61 |
|
dir.cdUp(); // "Contents" directory |
62 |
|
QApplication::setLibraryPaths(QStringList(dir.absolutePath() + "/plugins")); |
63 |
|
|
64 |
|
// Set the PATH environment variable to include @executable_path/../../.. |
65 |
|
dir.cdUp(); |
66 |
|
dir.cdUp(); |
67 |
|
QString path(getenv("PATH")); |
68 |
|
path = dir.absolutePath() + ":" + path; |
69 |
|
setenv("PATH", path.toUtf8().constData(), 1); |
70 |
|
} |
71 |
|
#endif |
72 |
|
|
73 |
// Construct default settings; override with command line arguments. |
// Construct default settings; override with command line arguments. |
74 |
QSampler::Options options; |
QSampler::Options options; |
75 |
if (!options.parse_args(app.argc(), app.argv())) { |
if (!options.parse_args(app.argc(), app.argv())) { |