X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcross_linux.cc;h=ee49d50bc8ef8972da9f13d25b7f90680fc49396;hb=4bbcf55dc0e644c20b1eaabee2da3219c4e7635f;hp=65151791cc820dc4f83ab1317e9418a59ac39aa0;hpb=93048e5a6f33cc8e2fc547bf65c41551696e23c6;p=dcpomatic.git diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc index 65151791c..ee49d50bc 100644 --- a/src/lib/cross_linux.cc +++ b/src/lib/cross_linux.cc @@ -52,13 +52,10 @@ DCPOMATIC_ENABLE_WARNINGS using std::cerr; using std::cout; -using std::function; using std::ifstream; using std::list; using std::make_pair; using std::pair; -using std::runtime_error; -using std::shared_ptr; using std::string; using std::vector; using std::wstring; @@ -382,11 +379,14 @@ Drive::unmount () boost::filesystem::path -config_path () +config_path (optional version) { boost::filesystem::path p; p /= g_get_user_config_dir (); p /= "dcpomatic2"; + if (version) { + p /= *version; + } return p; } @@ -411,3 +411,22 @@ fix_long_path (boost::filesystem::path path) return path; } + +bool +show_in_file_manager (boost::filesystem::path dir, boost::filesystem::path) +{ + int r = system ("which nautilus"); + if (WEXITSTATUS(r) == 0) { + r = system (String::compose("nautilus \"%1\"", dir.string()).c_str()); + return static_cast(WEXITSTATUS(r)); + } else { + int r = system ("which konqueror"); + if (WEXITSTATUS(r) == 0) { + r = system (String::compose("konqueror \"%1\"", dir.string()).c_str()); + return static_cast(WEXITSTATUS(r)); + } + } + + return true; +} +