From: Carl Hetherington Date: Fri, 23 Jun 2017 14:18:59 +0000 (+0100) Subject: Try to fix show DCP when project directory names contain spaces (#1091). X-Git-Tag: v2.11.12~30 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=f042aceec251608860118c97ee30c8ae3c54a70f Try to fix show DCP when project directory names contain spaces (#1091). --- diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 041644d91..80b25ba2e 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -747,14 +747,14 @@ private: #ifdef DCPOMATIC_LINUX int r = system ("which nautilus"); if (WEXITSTATUS (r) == 0) { - r = system (string ("nautilus " + _film->directory()->string()).c_str ()); + r = system (String::compose("nautilus \"%1\"", _film->directory()->string()).c_str()); if (WEXITSTATUS (r)) { error_dialog (this, _("Could not show DCP (could not run nautilus)")); } } else { int r = system ("which konqueror"); if (WEXITSTATUS (r) == 0) { - r = system (string ("konqueror " + _film->directory()->string()).c_str ()); + r = system (String::compose ("konqueror \"%1\"", _film->directory()->string()).c_str()); if (WEXITSTATUS (r)) { error_dialog (this, _("Could not show DCP (could not run konqueror)")); } @@ -763,7 +763,7 @@ private: #endif #ifdef DCPOMATIC_OSX - int r = system (string ("open -R " + _film->dir (_film->dcp_name (false)).string ()).c_str ()); + int r = system (String::compose ("open -R \"%1\"", _film->dir (_film->dcp_name(false)).string()).c_str()); if (WEXITSTATUS (r)) { error_dialog (this, _("Could not show DCP")); }