summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-10-01 00:29:49 +0200
committerCarl Hetherington <cth@carlh.net>2025-10-10 21:15:37 +0200
commit710603ccccd86b2db33f76bb0b9c863df7d6a02b (patch)
tree2b8d10f7f2847e65fe1bb02a1bc4738afbf87f24 /src
parent711cd65063f6f0b2bc4ba22c194f725d56a7c3fa (diff)
Add Content::path_for_display().
Diffstat (limited to 'src')
-rw-r--r--src/lib/content.cc7
-rw-r--r--src/lib/content.h3
-rw-r--r--src/lib/dcp_content.cc7
-rw-r--r--src/lib/dcp_content.h2
4 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc
index 6bb7c02c9..ac87c6e79 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -592,3 +592,10 @@ Content::replace_font_path(boost::filesystem::path old_path, boost::filesystem::
}
}
+
+boost::filesystem::path
+Content::path_for_display() const
+{
+ return path(0);
+}
+
diff --git a/src/lib/content.h b/src/lib/content.h
index d922da558..d84505b72 100644
--- a/src/lib/content.h
+++ b/src/lib/content.h
@@ -142,6 +142,9 @@ public:
std::vector<boost::filesystem::path> font_paths() const;
void replace_font_path(boost::filesystem::path old_path, boost::filesystem::path new_path);
+ /** @return A path which summarises this content for the user */
+ virtual boost::filesystem::path path_for_display() const;
+
std::time_t last_write_time(size_t i) const {
boost::mutex::scoped_lock lm(_mutex);
return _last_write_times[i];
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index 5a4593ec2..513ebef54 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -894,3 +894,10 @@ DCPContent::reference_anything() const
return find(_reference_text.begin(), _reference_text.end(), true) != _reference_text.end();
}
+
+boost::filesystem::path
+DCPContent::path_for_display() const
+{
+ return path(0).parent_path();
+}
+
diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h
index 3b843f22e..d50986357 100644
--- a/src/lib/dcp_content.h
+++ b/src/lib/dcp_content.h
@@ -93,6 +93,8 @@ public:
std::vector<boost::filesystem::path> directories () const;
+ boost::filesystem::path path_for_display() const override;
+
bool encrypted () const {
boost::mutex::scoped_lock lm (_mutex);
return _encrypted;