Commit f78a9799 authored by Andrew Walton's avatar Andrew Walton Committed by Andrew Walton

reviewed by: Christian Neumair

2008-04-26  A. Walton  <awalton@gnome.org>

	reviewed by: Christian Neumair

	* libnautilus-private/nautilus-file-private.h:
	* libnautilus-private/nautilus-file-utilities.c
	(nautilus_compute_title_for_location):
	* libnautilus-private/nautilus-file.c (update_info_internal),
	(nautilus_file_get_description):
	* libnautilus-private/nautilus-file.h:
	Use standard::description in the window title when it's available.
	Closes bug #516007.


svn path=/trunk/; revision=14094
parent a6f7e3a2
2008-04-26 A. Walton <awalton@gnome.org>
reviewed by: Christian Neumair
* libnautilus-private/nautilus-file-private.h:
* libnautilus-private/nautilus-file-utilities.c
(nautilus_compute_title_for_location):
* libnautilus-private/nautilus-file.c (update_info_internal),
(nautilus_file_get_description):
* libnautilus-private/nautilus-file.h:
Use standard::description in the window title when it's available.
Closes bug #516007.
2008-04-27 Christian Neumair <cneumair@gnome.org>
* libnautilus-private/nautilus-icon-container.c
......
......@@ -46,7 +46,7 @@
GNOME_VFS_FILE_INFO_GET_ACCESS_RIGHTS)
#define NAUTILUS_FILE_DEFAULT_ATTRIBUTES \
"standard::*,access::*,mountable::*,time::*,unix::*,owner::*,selinux::*,thumbnail::*,mountable::*"
"standard::*,access::*,mountable::*,time::*,unix::*,owner::*,selinux::*,thumbnail::*"
/* These are in the typical sort order. Known things come first, then
* things where we can't know, finally things where we don't yet know.
......@@ -90,7 +90,8 @@ struct NautilusFileDetails
eel_ref_str mime_type;
char* selinux_context;
char *selinux_context;
char *description;
GError *get_info_error;
......
......@@ -66,7 +66,10 @@ nautilus_compute_title_for_location (GFile *location)
title = NULL;
if (location) {
file = nautilus_file_get (location);
title = nautilus_file_get_description (file);
if (title == NULL) {
title = nautilus_file_get_display_name (file);
}
nautilus_file_unref (file);
}
......
......@@ -1552,6 +1552,7 @@ update_info_internal (NautilusFile *file,
GIcon *icon;
GFile *old_activation_location;
const char *activation_uri;
const char *description;
if (file->details->is_gone) {
return FALSE;
......@@ -1806,6 +1807,13 @@ update_info_internal (NautilusFile *file,
file->details->selinux_context = g_strdup (selinux_context);
}
description = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION);
if (eel_strcmp (file->details->description, description) != 0) {
changed = TRUE;
g_free (file->details->description);
file->details->description = g_strdup (description);
}
if (update_name) {
name = g_file_info_get_name (info);
if (file->details->name == NULL ||
......@@ -3009,6 +3017,22 @@ nautilus_file_get_name (NautilusFile *file)
return g_strdup (eel_ref_str_peek (file->details->name));
}
/**
* nautilus_file_get_description:
* @file: a #NautilusFile.
*
* Gets the standard::description key from @file, if
* it has been cached.
*
* Returns: a string containing the value of the standard::description
* key, or %NULL.
*/
char *
nautilus_file_get_description (NautilusFile *file)
{
return g_strdup (file->details->description);
}
void
nautilus_file_monitor_add (NautilusFile *file,
gconstpointer client,
......
......@@ -155,6 +155,7 @@ char * nautilus_file_get_display_name (Nautilu
char * nautilus_file_get_edit_name (NautilusFile *file);
char * nautilus_file_get_name (NautilusFile *file);
GFile * nautilus_file_get_location (NautilusFile *file);
char * nautilus_file_get_description (NautilusFile *file);
char * nautilus_file_get_uri (NautilusFile *file);
char * nautilus_file_get_uri_scheme (NautilusFile *file);
NautilusFile * nautilus_file_get_parent (NautilusFile *file);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment