--- qsampler/trunk/src/main.cpp 2008/01/13 16:36:14 1642 +++ qsampler/trunk/src/main.cpp 2008/01/13 16:44:00 1643 @@ -27,7 +27,9 @@ #include #include #include - +#if defined(__APPLE__) // Toshi Nagata 20080105 +#include +#endif //------------------------------------------------------------------------- // main - The main program trunk. @@ -52,6 +54,22 @@ app.installTranslator(&translator); } + #if defined(__APPLE__) // Toshi Nagata 20080105 + { + // Set the plugin path to @exetutable_path/../plugins + QDir dir(QApplication::applicationDirPath()); + dir.cdUp(); // "Contents" directory + QApplication::setLibraryPaths(QStringList(dir.absolutePath() + "/plugins")); + + // Set the PATH environment variable to include @executable_path/../../.. + dir.cdUp(); + dir.cdUp(); + QString path(getenv("PATH")); + path = dir.absolutePath() + ":" + path; + setenv("PATH", path.toUtf8().constData(), 1); + } + #endif + // Construct default settings; override with command line arguments. QSampler::Options options; if (!options.parse_args(app.argc(), app.argv())) {