Commit 0e316414099d36b96f5ea06dbd2c631c6ebdc14d

Authored by Austin Blanton
1 parent 1a79e098

Append system paths to list of paths to check

Showing 1 changed file with 5 additions and 0 deletions
openbr/openbr_plugin.cpp
@@ -899,8 +899,12 @@ void br::Context::initialize(int &argc, char *argv[], QString sdkPath, bool useG @@ -899,8 +899,12 @@ void br::Context::initialize(int &argc, char *argv[], QString sdkPath, bool useG
899 { 899 {
900 qInstallMessageHandler(messageHandler); 900 qInstallMessageHandler(messageHandler);
901 901
  902 + QString sep;
902 #ifndef _WIN32 903 #ifndef _WIN32
903 useGui = useGui && (getenv("DISPLAY") != NULL); 904 useGui = useGui && (getenv("DISPLAY") != NULL);
  905 + sep = ":";
  906 +#else
  907 + sep = ";";
904 #endif // not _WIN32 908 #endif // not _WIN32
905 909
906 // We take in argc as a reference due to: 910 // We take in argc as a reference due to:
@@ -944,6 +948,7 @@ void br::Context::initialize(int &argc, char *argv[], QString sdkPath, bool useG @@ -944,6 +948,7 @@ void br::Context::initialize(int &argc, char *argv[], QString sdkPath, bool useG
944 // Search for SDK 948 // Search for SDK
945 if (sdkPath.isEmpty()) { 949 if (sdkPath.isEmpty()) {
946 QStringList checkPaths; checkPaths << QDir::currentPath() << QCoreApplication::applicationDirPath(); 950 QStringList checkPaths; checkPaths << QDir::currentPath() << QCoreApplication::applicationDirPath();
  951 + checkPaths << QString(getenv("PATH")).split(sep, QString::SkipEmptyParts);
947 952
948 bool foundSDK = false; 953 bool foundSDK = false;
949 foreach (const QString &path, checkPaths) { 954 foreach (const QString &path, checkPaths) {