summaryrefslogtreecommitdiff
path: root/libnautilus-private
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2000-04-19 06:39:19 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2000-04-19 06:39:19 +0000
commit638912544af85c80c64142581b9d44aac33cbe54 (patch)
treea4237c53d87ef3f799fa383e43a5982e64d2e438 /libnautilus-private
parent7a55d8d9024a88c348a6813b8b938484baebdb0b (diff)
downloadnautilus-638912544af85c80c64142581b9d44aac33cbe54.tar.gz
made nautilus link files control the additional text displayed under their
made nautilus link files control the additional text displayed under their name.
Diffstat (limited to 'libnautilus-private')
-rw-r--r--libnautilus-private/nautilus-link.c17
-rw-r--r--libnautilus-private/nautilus-link.h3
-rw-r--r--libnautilus-private/nautilus-metadata.h4
3 files changed, 24 insertions, 0 deletions
diff --git a/libnautilus-private/nautilus-link.c b/libnautilus-private/nautilus-link.c
index e844a7e01..eeffd754b 100644
--- a/libnautilus-private/nautilus-link.c
+++ b/libnautilus-private/nautilus-link.c
@@ -44,6 +44,23 @@ nautilus_link_is_link_file(const char *file_uri)
return nautilus_str_has_suffix(file_uri, LINK_SUFFIX);
}
+/* returns additional text to display under the name, NULL if none */
+char* nautilus_link_get_additional_text(const char *link_file_uri)
+{
+ xmlDoc *doc;
+ char *extra_text = NULL;
+
+ if (link_file_uri == NULL)
+ return NULL;
+
+ doc = xmlParseFile (link_file_uri + 7);
+ if (doc) {
+ extra_text = xmlGetProp (doc->root, NAUTILUS_METADATA_KEY_EXTRA_TEXT);
+ xmlFreeDoc (doc);
+ }
+ return extra_text;
+}
+
/* returns the image associated with a link file */
char*
diff --git a/libnautilus-private/nautilus-link.h b/libnautilus-private/nautilus-link.h
index d6ceb802a..1e03ecfda 100644
--- a/libnautilus-private/nautilus-link.h
+++ b/libnautilus-private/nautilus-link.h
@@ -33,6 +33,9 @@
/* given a uri, returns TRUE if it's a link file */
gboolean nautilus_link_is_link_file(const char *file_uri);
+/* returns additional text to display under the name, NULL if none */
+char* nautilus_link_get_additional_text(const char *link_file_uri);
+
/* returns the image associated with a link file */
char* nautilus_link_get_image_uri(const char *link_file_uri);
diff --git a/libnautilus-private/nautilus-metadata.h b/libnautilus-private/nautilus-metadata.h
index 4779798d0..5e6112a72 100644
--- a/libnautilus-private/nautilus-metadata.h
+++ b/libnautilus-private/nautilus-metadata.h
@@ -55,4 +55,8 @@
#define NAUTILUS_METADATA_KEY_ICON_SCALE "ICON_SCALE"
#define NAUTILUS_METADATA_KEY_CUSTOM_ICON "CUSTOM_ICON"
+/* per link file */
+
+#define NAUTILUS_METADATA_KEY_EXTRA_TEXT "EXTRA_TEXT"
+
#endif /* NAUTILUS_METADATA_H */