summaryrefslogtreecommitdiff
path: root/src/lib/cross_linux.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-12-23 21:53:32 +0100
committerCarl Hetherington <cth@carlh.net>2024-12-26 00:27:08 +0100
commit8caf013a9b8d709ed7c3d5e9febee0067e6fcf1f (patch)
tree40da87cb357e8b1c54a1464bdbac2d014640e30c /src/lib/cross_linux.cc
parentcec6ff92aef45c687085ecfc1059004407c18c57 (diff)
Replace String::compose with fmt::format().
Diffstat (limited to 'src/lib/cross_linux.cc')
-rw-r--r--src/lib/cross_linux.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc
index be3233b32..b27d1a636 100644
--- a/src/lib/cross_linux.cc
+++ b/src/lib/cross_linux.cc
@@ -19,7 +19,6 @@
*/
-#include "compose.hpp"
#include "config.h"
#include "cross.h"
#include "dcpomatic_log.h"
@@ -30,6 +29,7 @@
#include <dcp/raw_convert.h>
#include <dcp/warnings.h>
#include <glib.h>
+#include <fmt/format.h>
#include <boost/algorithm/string.hpp>
#if BOOST_VERSION >= 106100
#include <boost/dll/runtime_symbol_info.hpp>
@@ -108,11 +108,11 @@ void
run_ffprobe(boost::filesystem::path content, boost::filesystem::path out, bool err, string args)
{
string const redirect = err ? "2>" : ">";
- auto const ffprobe = String::compose("ffprobe %1 \"%2\" %3 \"%4\"", args.empty() ? " " : args, content.string(), redirect, out.string());
- LOG_GENERAL (N_("Probing with %1"), ffprobe);
+ auto const ffprobe = fmt::format("ffprobe {} \"{}\" {} \"{}\"", args.empty() ? " " : args, content.string(), redirect, out.string());
+ LOG_GENERAL (N_("Probing with {}"), ffprobe);
int const r = system (ffprobe.c_str());
if (r == -1 || (WIFEXITED(r) && WEXITSTATUS(r) != 0)) {
- LOG_GENERAL (N_("Could not run ffprobe (system returned %1"), r);
+ LOG_GENERAL (N_("Could not run ffprobe (system returned {}"), r);
}
}
@@ -237,7 +237,7 @@ get_mounts (string prefix)
if (bits.size() > 1 && boost::algorithm::starts_with(bits[0], prefix)) {
boost::algorithm::replace_all (bits[1], "\\040", " ");
mounts.push_back(make_pair(bits[0], bits[1]));
- LOG_DISK("Found mounted device %1 from prefix %2", bits[0], prefix);
+ LOG_DISK("Found mounted device {} from prefix {}", bits[0], prefix);
}
}
@@ -297,7 +297,7 @@ Drive::unmount ()
{
for (auto i: _mount_points) {
int const r = umount(i.string().c_str());
- LOG_DISK("Tried to unmount %1 and got %2 and %3", i.string(), r, errno);
+ LOG_DISK("Tried to unmount {} and got {} and {}", i.string(), r, errno);
if (r == -1) {
return false;
}
@@ -330,12 +330,12 @@ 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());
+ r = system(fmt::format("nautilus \"{}\"", dir.string()).c_str());
return static_cast<bool>(WEXITSTATUS(r));
} else {
int r = system ("which konqueror");
if (WEXITSTATUS(r) == 0) {
- r = system (String::compose("konqueror \"%1\"", dir.string()).c_str());
+ r = system(fmt::format("konqueror \"{}\"", dir.string()).c_str());
return static_cast<bool>(WEXITSTATUS(r));
}
}