nautilus r15136 - in trunk: . libnautilus-private src/file-manager
- From: cosimoc svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r15136 - in trunk: . libnautilus-private src/file-manager
- Date: Wed, 18 Mar 2009 15:56:30 +0000 (UTC)
Author: cosimoc
Date: Wed Mar 18 15:56:30 2009
New Revision: 15136
URL: http://svn.gnome.org/viewvc/nautilus?rev=15136&view=rev
Log:
2009-03-18 Cosimo Cecchi <cosimoc gnome org>
* libnautilus-private/nautilus-icon-container.c:
(nautilus_icon_container_get_icon_text),
(nautilus_icon_container_search_iter),
(nautilus_icon_container_update_icon):
* libnautilus-private/nautilus-icon-container.h:
* src/file-manager/fm-icon-container.c:
(fm_icon_container_get_icon_text):
Unbreak typeahead find for 33% zoom level (#341708).
Modified:
trunk/ChangeLog
trunk/libnautilus-private/nautilus-icon-container.c
trunk/libnautilus-private/nautilus-icon-container.h
trunk/src/file-manager/fm-icon-container.c
Modified: trunk/libnautilus-private/nautilus-icon-container.c
==============================================================================
--- trunk/libnautilus-private/nautilus-icon-container.c (original)
+++ trunk/libnautilus-private/nautilus-icon-container.c Wed Mar 18 15:56:30 2009
@@ -4907,13 +4907,28 @@
return TRUE;
}
+static void
+nautilus_icon_container_get_icon_text (NautilusIconContainer *container,
+ NautilusIconData *data,
+ char **editable_text,
+ char **additional_text,
+ gboolean include_invisible)
+{
+ NautilusIconContainerClass *klass;
+
+ klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
+ g_assert (klass->get_icon_text != NULL);
+
+ klass->get_icon_text (container, data, editable_text, additional_text, include_invisible);
+}
+
static gboolean
nautilus_icon_container_search_iter (NautilusIconContainer *container,
const char *key, gint n)
{
GList *p;
NautilusIcon *icon;
- const char *name;
+ char *name;
int count;
char *normalized_key, *case_normalized_key;
char *normalized_name, *case_normalized_name;
@@ -4932,10 +4947,12 @@
}
icon = NULL;
+ name = NULL;
count = 0;
for (p = container->details->icons; p != NULL && count != n; p = p->next) {
icon = p->data;
- name = nautilus_icon_canvas_item_get_editable_text (icon->item);
+ nautilus_icon_container_get_icon_text (container, icon->data, &name,
+ NULL, TRUE);
/* This can happen if a key event is handled really early while
* loading the icon container, before the items have all been
@@ -4961,6 +4978,8 @@
}
g_free (case_normalized_name);
+ g_free (name);
+ name = NULL;
}
g_free (case_normalized_key);
@@ -6765,21 +6784,6 @@
return klass->get_icon_images (container, data, size, emblem_pixbufs, embedded_text, for_drag_accept, need_large_embeddded_text, embedded_text_needs_loading, has_open_window);
}
-
-static void
-nautilus_icon_container_get_icon_text (NautilusIconContainer *container,
- NautilusIconData *data,
- char **editable_text,
- char **additional_text)
-{
- NautilusIconContainerClass *klass;
-
- klass = NAUTILUS_ICON_CONTAINER_GET_CLASS (container);
- g_assert (klass->get_icon_text != NULL);
-
- klass->get_icon_text (container, data, editable_text, additional_text);
-}
-
static void
nautilus_icon_container_freeze_updates (NautilusIconContainer *container)
{
@@ -6991,7 +6995,8 @@
nautilus_icon_container_get_icon_text (container,
icon->data,
&editable_text,
- &additional_text);
+ &additional_text,
+ FALSE);
/* If name of icon being renamed was changed from elsewhere, end renaming mode.
* Alternatively, we could replace the characters in the editable text widget
Modified: trunk/libnautilus-private/nautilus-icon-container.h
==============================================================================
--- trunk/libnautilus-private/nautilus-icon-container.h (original)
+++ trunk/libnautilus-private/nautilus-icon-container.h Wed Mar 18 15:56:30 2009
@@ -142,7 +142,8 @@
void (* get_icon_text) (NautilusIconContainer *container,
NautilusIconData *data,
char **editable_text,
- char **additional_text);
+ char **additional_text,
+ gboolean include_invisible);
char * (* get_icon_description) (NautilusIconContainer *container,
NautilusIconData *data);
int (* compare_icons) (NautilusIconContainer *container,
Modified: trunk/src/file-manager/fm-icon-container.c
==============================================================================
--- trunk/src/file-manager/fm-icon-container.c (original)
+++ trunk/src/file-manager/fm-icon-container.c Wed Mar 18 15:56:30 2009
@@ -283,7 +283,8 @@
fm_icon_container_get_icon_text (NautilusIconContainer *container,
NautilusIconData *data,
char **editable_text,
- char **additional_text)
+ char **additional_text,
+ gboolean include_invisible)
{
char *actual_uri;
gchar *description;
@@ -292,23 +293,30 @@
int i, j, num_attributes;
FMIconView *icon_view;
NautilusFile *file;
+ gboolean use_additional;
file = NAUTILUS_FILE (data);
g_assert (NAUTILUS_IS_FILE (file));
g_assert (editable_text != NULL);
- g_assert (additional_text != NULL);
icon_view = get_icon_view (container);
g_return_if_fail (icon_view != NULL);
+ use_additional = (additional_text != NULL);
+
/* In the smallest zoom mode, no text is drawn. */
- if (nautilus_icon_container_get_zoom_level (container) == NAUTILUS_ZOOM_LEVEL_SMALLEST) {
+ if (nautilus_icon_container_get_zoom_level (container) == NAUTILUS_ZOOM_LEVEL_SMALLEST &&
+ !include_invisible) {
*editable_text = NULL;
} else {
/* Strip the suffix for nautilus object xml files. */
*editable_text = nautilus_file_get_display_name (file);
}
+ if (!use_additional) {
+ return;
+ }
+
if (fm_icon_view_is_compact (icon_view)) {
*additional_text = NULL;
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]