summaryrefslogtreecommitdiff
path: root/src/lib/content.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-23 12:22:34 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-23 12:22:34 +0000
commita0c0e609f7fbff8513135428378cc16684bae937 (patch)
tree25e800debbb1ec6ab60fd0a4fc8e593c81addaea /src/lib/content.cc
parent90b84151b9817b33381187f678cb2fdd062ed785 (diff)
Remove Content::path(), add Content::path_summary().
Diffstat (limited to 'src/lib/content.cc')
-rw-r--r--src/lib/content.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc
index a565edb52..16069b7a7 100644
--- a/src/lib/content.cc
+++ b/src/lib/content.cc
@@ -169,7 +169,7 @@ Content::clone () const
string
Content::technical_summary () const
{
- return String::compose ("%1 %2 %3", path(), digest(), position());
+ return String::compose ("%1 %2 %3", path_summary(), digest(), position());
}
Time
@@ -217,4 +217,15 @@ Content::set_path (boost::filesystem::path path)
signal_changed (ContentProperty::PATH);
}
-
+string
+Content::path_summary () const
+{
+ /* XXX: should handle multiple paths more gracefully */
+
+ string s = path(0).filename().string ();
+ if (number_of_paths() > 1) {
+ s += " ...";
+ }
+
+ return s;
+}