diff options
author | Sune Vuorela <sune@vuorela.dk> | 2012-12-29 23:56:27 +0100 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2013-05-18 23:57:33 +0200 |
commit | 980c64c7fac5cfe39593e5a12e233be69d0742e3 (patch) | |
tree | 4c028da7b5e4a871382dff84ed3d16014e42be92 /src/qtchooser/main.cpp | |
parent | 50373acdaf8ecd56d9fc0b31ee2f8f06f448c1a3 (diff) |
create a system default pathqtchooser-31-g980c64c
Make it possible to build qtchooser with a system default search path
build using make QTCHOOSER_GLOBAL_DIR=/usr/share/ will make qtchooser
fall back to search in /usr/share/qtchooser/ as a last option if
XDG_CONFIG_DIRS is not set
Change-Id: Ie0d438ddc1e259d4c5fb70aa332bd6bfef2448e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/qtchooser/main.cpp')
-rw-r--r-- | src/qtchooser/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qtchooser/main.cpp b/src/qtchooser/main.cpp index 514503d..61d8731 100644 --- a/src/qtchooser/main.cpp +++ b/src/qtchooser/main.cpp @@ -279,6 +279,13 @@ vector<string> ToolWrapper::searchPaths() const vector<string> xdgPaths = stringSplit(qgetenv("XDG_CONFIG_DIRS", "/etc/xdg").c_str()); paths.insert(paths.end(), xdgPaths.begin(), xdgPaths.end()); +#if defined(QTCHOOSER_GLOBAL_DIR) + if (qgetenv("XDG_CONFIG_DIRS").empty()) { + vector<string> globalPaths = stringSplit(QTCHOOSER_GLOBAL_DIR); + paths.insert(paths.end(), globalPaths.begin(), globalPaths.end()); + } +#endif + for (vector<string>::iterator it = paths.begin(); it != paths.end(); ++it) *it += "/qtchooser/"; |