]> git.lyx.org Git - features.git/blobdiff - src/support/Package.cpp
Guard new code for builds with OS X 10.11 SDK and lesser (part 2).
[features.git] / src / support / Package.cpp
index 284b5689daf93a77ab909a56d62e2a2a76a0a039..a779544f9999893e416985db15a6e441e10e1fcd 100644 (file)
@@ -43,6 +43,7 @@
 # include "support/qstring_helpers.h"
 # include <QDir>
 # include <QDesktopServices>
+# include <QStandardPaths>
 #endif
 
 using namespace std;
@@ -366,10 +367,7 @@ bool inBuildDir(FileName const & abs_binary,
 bool doesFileExist(FileName & result, string const & search_dir, string const & name)
 {
     result = fileSearch(search_dir, name);
-    if (!result.empty()) {
-        return true;
-    }
-    return false;
+    return !result.empty();
 }
 
 
@@ -382,7 +380,7 @@ bool lyxBinaryPath(FileName & lyx_binary, string const & search_dir, string cons
     } else if (doesFileExist(lyx_binary, search_dir, "lyx" + string(PROGRAM_SUFFIX) + ext)) {
     } else if (doesFileExist(lyx_binary, search_dir, "LyX" + string(PROGRAM_SUFFIX) + ext)){
     }
-    return !lyx_binary.empty() ? true : false;
+    return !lyx_binary.empty();
 }
 
 
@@ -508,9 +506,9 @@ FileName const get_binary_path(string const & exe)
                // This will do nothing if *it is already absolute.
                string const exe_dir = makeAbsPath(*it).absFileName();
 
-               FileName const exe_path(addName(exe_dir, exe_name));
-               if (exe_path.exists())
-                       return exe_path;
+               FileName const exe_path2(addName(exe_dir, exe_name));
+               if (exe_path2.exists())
+                       return exe_path2;
        }
 
        // Didn't find anything.