nautilus r14094 - in trunk: . libnautilus-private



Author: awalton
Date: Sun Apr 27 01:04:59 2008
New Revision: 14094
URL: http://svn.gnome.org/viewvc/nautilus?rev=14094&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-file-private.h
   trunk/libnautilus-private/nautilus-file-utilities.c
   trunk/libnautilus-private/nautilus-file.c
   trunk/libnautilus-private/nautilus-file.h

Modified: trunk/libnautilus-private/nautilus-file-private.h
==============================================================================
--- trunk/libnautilus-private/nautilus-file-private.h	(original)
+++ trunk/libnautilus-private/nautilus-file-private.h	Sun Apr 27 01:04:59 2008
@@ -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 @@
 	
 	eel_ref_str mime_type;
 	
-	char* selinux_context;
+	char *selinux_context;
+	char *description;
 	
 	GError *get_info_error;
 	

Modified: trunk/libnautilus-private/nautilus-file-utilities.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file-utilities.c	(original)
+++ trunk/libnautilus-private/nautilus-file-utilities.c	Sun Apr 27 01:04:59 2008
@@ -66,7 +66,10 @@
 	title = NULL;
 	if (location) {
 		file = nautilus_file_get (location);
-		title = nautilus_file_get_display_name (file);
+		title = nautilus_file_get_description (file);
+		if (title == NULL) {
+			title = nautilus_file_get_display_name (file);
+		}
 		nautilus_file_unref (file);
 	}
 

Modified: trunk/libnautilus-private/nautilus-file.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file.c	(original)
+++ trunk/libnautilus-private/nautilus-file.c	Sun Apr 27 01:04:59 2008
@@ -1552,6 +1552,7 @@
 	GIcon *icon;
 	GFile *old_activation_location;
 	const char *activation_uri;
+	const char *description;
 	
 	if (file->details->is_gone) {
 		return FALSE;
@@ -1806,6 +1807,13 @@
 		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 ||
@@ -3008,6 +3016,22 @@
 {
 	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,

Modified: trunk/libnautilus-private/nautilus-file.h
==============================================================================
--- trunk/libnautilus-private/nautilus-file.h	(original)
+++ trunk/libnautilus-private/nautilus-file.h	Sun Apr 27 01:04:59 2008
@@ -155,6 +155,7 @@
 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]