Commit 8448ab08 authored by Darin Adler's avatar Darin Adler

A bit more renaming to be explicit about "display name".

	This is slightly gratuitious, because we don't really need to be
	explicit about which name in every case, but it does no harm and
	a tiny bit of good.

	* components/tree/nautilus-tree-view.c: (ctree_compare_rows):
	* libnautilus-private/nautilus-file.c: (compare_by_display_name),
	(compare_by_full_path), (nautilus_file_compare_for_sort_internal),
	(compare_by_display_name_cover),
	(nautilus_file_list_sort_by_display_name),
	(nautilus_self_check_file):
	* libnautilus-private/nautilus-file.h:
	* libnautilus-private/nautilus-global-preferences.c:
	(default_icon_view_sort_order_or_manual_layout_changed_callback):
	* src/file-manager/fm-desktop-icon-view.c:
	(desktop_icons_compare_callback):
	* src/file-manager/fm-directory-view.c:
	(update_directory_in_scripts_menu):
	* src/file-manager/fm-icon-view.c: (get_default_sort_order),
	(icon_container_compare_icons_by_name_callback):
	* src/file-manager/fm-list-view.c: (compare_rows_by_name),
	(get_attribute_from_sort_type), (real_get_column_specification):
	* src/file-manager/fm-search-list-view.c:
	(real_get_column_specification):
	Change NAUTILUS_FILE_SORT_BY_NAME to NAUTILUS_FILE_SORT_BY_DISPLAY_NAME
	and compare_by_name to compare_by_display_name and
	nautilus_file_list_sort_by_name to nautilus_file_list_sort_by_display_name.
parent dc9c636e
2001-10-04 Darin Adler <darin@bentspoon.com>
A bit more renaming to be explicit about "display name".
This is slightly gratuitious, because we don't really need to be
explicit about which name in every case, but it does no harm and
a tiny bit of good.
* components/tree/nautilus-tree-view.c: (ctree_compare_rows):
* libnautilus-private/nautilus-file.c: (compare_by_display_name),
(compare_by_full_path), (nautilus_file_compare_for_sort_internal),
(compare_by_display_name_cover),
(nautilus_file_list_sort_by_display_name),
(nautilus_self_check_file):
* libnautilus-private/nautilus-file.h:
* libnautilus-private/nautilus-global-preferences.c:
(default_icon_view_sort_order_or_manual_layout_changed_callback):
* src/file-manager/fm-desktop-icon-view.c:
(desktop_icons_compare_callback):
* src/file-manager/fm-directory-view.c:
(update_directory_in_scripts_menu):
* src/file-manager/fm-icon-view.c: (get_default_sort_order),
(icon_container_compare_icons_by_name_callback):
* src/file-manager/fm-list-view.c: (compare_rows_by_name),
(get_attribute_from_sort_type), (real_get_column_specification):
* src/file-manager/fm-search-list-view.c:
(real_get_column_specification):
Change NAUTILUS_FILE_SORT_BY_NAME to NAUTILUS_FILE_SORT_BY_DISPLAY_NAME
and compare_by_name to compare_by_display_name and
nautilus_file_list_sort_by_name to nautilus_file_list_sort_by_display_name.
2001-10-04 Maciej Stachowiak <mjs@noisehavoc.org>
* libnautilus-private/nautilus-file-attributes.h,
......
......@@ -900,7 +900,7 @@ ctree_compare_rows (EelCList *clist,
file2 = node2 ? nautilus_tree_node_get_file (node2) : NULL;
if (file1 != NULL && file2 != NULL) {
result = nautilus_file_compare_for_sort (file1, file2, NAUTILUS_FILE_SORT_BY_NAME, FALSE, FALSE);
result = nautilus_file_compare_for_sort (file1, file2, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, FALSE, FALSE);
}
}
......
......@@ -1512,7 +1512,7 @@ compare_by_size (NautilusFile *file_1, NautilusFile *file_2)
}
static int
compare_by_name (NautilusFile *file_1, NautilusFile *file_2)
compare_by_display_name (NautilusFile *file_1, NautilusFile *file_2)
{
char *name_1, *name_2;
gboolean sort_last_1, sort_last_2;
......@@ -1781,7 +1781,7 @@ compare_by_full_path (NautilusFile *file_1, NautilusFile *file_2)
if (compare != 0) {
return compare;
}
return compare_by_name (file_1, file_2);
return compare_by_display_name (file_1, file_2);
}
static int
......@@ -1795,8 +1795,8 @@ nautilus_file_compare_for_sort_internal (NautilusFile *file_1,
g_return_val_if_fail (NAUTILUS_IS_FILE (file_2), 0);
switch (sort_type) {
case NAUTILUS_FILE_SORT_BY_NAME:
compare = compare_by_name (file_1, file_2);
case NAUTILUS_FILE_SORT_BY_DISPLAY_NAME:
compare = compare_by_display_name (file_1, file_2);
if (compare != 0) {
return compare;
}
......@@ -5053,21 +5053,21 @@ nautilus_file_list_copy (GList *list)
}
static int
compare_by_name_cover (gconstpointer a, gconstpointer b)
compare_by_display_name_cover (gconstpointer a, gconstpointer b)
{
return compare_by_name (NAUTILUS_FILE (a), NAUTILUS_FILE (b));
return compare_by_display_name (NAUTILUS_FILE (a), NAUTILUS_FILE (b));
}
/**
* nautilus_file_list_sort_by_name
* nautilus_file_list_sort_by_display_name
*
* Sort the list of files by file name.
* @list: GList of files.
**/
GList *
nautilus_file_list_sort_by_name (GList *list)
nautilus_file_list_sort_by_display_name (GList *list)
{
return g_list_sort (list, compare_by_name_cover);
return g_list_sort (list, compare_by_display_name_cover);
}
/* Extract the top left part of the read-in text. */
......@@ -5215,12 +5215,12 @@ nautilus_self_check_file (void)
EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_1)->ref_count, 1);
EEL_CHECK_INTEGER_RESULT (GTK_OBJECT (file_2)->ref_count, 1);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_2, NAUTILUS_FILE_SORT_BY_NAME, FALSE, FALSE) < 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_2, NAUTILUS_FILE_SORT_BY_NAME, FALSE, TRUE) > 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_1, NAUTILUS_FILE_SORT_BY_NAME, FALSE, FALSE) == 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_1, NAUTILUS_FILE_SORT_BY_NAME, TRUE, FALSE) == 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_1, NAUTILUS_FILE_SORT_BY_NAME, FALSE, TRUE) == 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_1, NAUTILUS_FILE_SORT_BY_NAME, TRUE, TRUE) == 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_2, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, FALSE, FALSE) < 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_2, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, FALSE, TRUE) > 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_1, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, FALSE, FALSE) == 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_1, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, TRUE, FALSE) == 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_1, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, FALSE, TRUE) == 0, TRUE);
EEL_CHECK_BOOLEAN_RESULT (nautilus_file_compare_for_sort (file_1, file_1, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, TRUE, TRUE) == 0, TRUE);
nautilus_file_unref (file_1);
nautilus_file_unref (file_2);
......
......@@ -52,7 +52,7 @@ typedef struct NautilusFile NautilusFile;
typedef enum {
NAUTILUS_FILE_SORT_NONE,
NAUTILUS_FILE_SORT_BY_NAME,
NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
NAUTILUS_FILE_SORT_BY_DIRECTORY,
NAUTILUS_FILE_SORT_BY_SIZE,
NAUTILUS_FILE_SORT_BY_TYPE,
......@@ -301,7 +301,7 @@ GList * nautilus_file_list_ref (GList
void nautilus_file_list_unref (GList *file_list);
void nautilus_file_list_free (GList *file_list);
GList * nautilus_file_list_copy (GList *file_list);
GList * nautilus_file_list_sort_by_name (GList *file_list);
GList * nautilus_file_list_sort_by_display_name (GList *file_list);
/* Debugging */
void nautilus_file_dump (NautilusFile *file);
......
......@@ -156,7 +156,7 @@ static EelEnumerationEntry default_folder_viewer_enum_entries[] = {
static EelEnumerationEntry default_icon_view_sort_order_enum_entries[] = {
{ "manually", N_("Manually"), PREFERENCES_SORT_ORDER_MANUALLY },
{ "--------", "--------" },
{ "name", N_("By Name"), NAUTILUS_FILE_SORT_BY_NAME },
{ "name", N_("By Name"), NAUTILUS_FILE_SORT_BY_DISPLAY_NAME },
{ "size", N_("By Size"), NAUTILUS_FILE_SORT_BY_SIZE },
{ "type", N_("By Type"), NAUTILUS_FILE_SORT_BY_TYPE },
{ "modification_date", N_("By Modification Date"), NAUTILUS_FILE_SORT_BY_MTIME },
......@@ -165,7 +165,7 @@ static EelEnumerationEntry default_icon_view_sort_order_enum_entries[] = {
};
static EelEnumerationEntry default_list_view_sort_order_enum_entries[] = {
{ "name", N_("By Name"), NAUTILUS_FILE_SORT_BY_NAME },
{ "name", N_("By Name"), NAUTILUS_FILE_SORT_BY_DISPLAY_NAME },
{ "size", N_("By Size"), NAUTILUS_FILE_SORT_BY_SIZE },
{ "type", N_("By Type"), NAUTILUS_FILE_SORT_BY_TYPE },
{ "modification_date", N_("By Modification Date"), NAUTILUS_FILE_SORT_BY_MTIME },
......@@ -596,14 +596,14 @@ static const PreferenceDefault preference_defaults[] = {
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
PREFERENCE_INTEGER,
EEL_USER_LEVEL_NOVICE,
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_NAME) },
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_DISPLAY_NAME) },
{ USER_LEVEL_NONE },
"default_icon_view_sort_order"
},
{ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER_OR_MANUAL_LAYOUT,
PREFERENCE_INTEGER,
EEL_USER_LEVEL_NOVICE,
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_NAME) },
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_DISPLAY_NAME) },
{ USER_LEVEL_NONE },
"default_icon_view_sort_order"
},
......@@ -650,7 +650,7 @@ static const PreferenceDefault preference_defaults[] = {
{ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_SORT_ORDER,
PREFERENCE_INTEGER,
EEL_USER_LEVEL_NOVICE,
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_NAME) },
{ EEL_USER_LEVEL_NOVICE, GINT_TO_POINTER (NAUTILUS_FILE_SORT_BY_DISPLAY_NAME) },
{ USER_LEVEL_NONE },
"default_list_view_sort_order"
},
......@@ -1063,7 +1063,7 @@ default_icon_view_sort_order_or_manual_layout_changed_callback (gpointer callbac
if (default_sort_order_or_manual_layout != PREFERENCES_SORT_ORDER_MANUALLY) {
default_sort_order = default_sort_order_or_manual_layout;
g_return_if_fail (default_sort_order >= NAUTILUS_FILE_SORT_BY_NAME);
g_return_if_fail (default_sort_order >= NAUTILUS_FILE_SORT_BY_DISPLAY_NAME);
g_return_if_fail (default_sort_order <= NAUTILUS_FILE_SORT_BY_EMBLEMS);
eel_preferences_set_integer (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_SORT_ORDER,
......
......@@ -1038,7 +1038,7 @@ desktop_icons_compare_callback (NautilusIconContainer *container,
if (category_a == category_b) {
return nautilus_file_compare_for_sort
(file_a, file_b, NAUTILUS_FILE_SORT_BY_NAME,
(file_a, file_b, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
fm_directory_view_should_sort_directories_first (FM_DIRECTORY_VIEW (icon_view)),
FALSE);
}
......
......@@ -3680,7 +3680,7 @@ update_directory_in_scripts_menu (FMDirectoryView *view, NautilusDirectory *dire
NULL);
g_free (directory_uri);
file_list = nautilus_file_list_sort_by_name
file_list = nautilus_file_list_sort_by_display_name
(nautilus_directory_get_file_list (directory));
any_scripts = FALSE;
......
......@@ -181,7 +181,7 @@ EEL_DEFINE_CLASS_BOILERPLATE (FMIconView,
*/
static const SortCriterion sort_criteria[] = {
{
NAUTILUS_FILE_SORT_BY_NAME,
NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
"name",
"Sort by Name",
N_("by _Name"),
......@@ -603,7 +603,7 @@ fm_icon_view_get_directory_sort_by (FMIconView *icon_view,
get_directory_sort_by, (icon_view, file));
}
static NautilusFileSortType default_sort_order = NAUTILUS_FILE_SORT_BY_NAME;
static NautilusFileSortType default_sort_order = NAUTILUS_FILE_SORT_BY_DISPLAY_NAME;
static NautilusFileSortType
get_default_sort_order (void)
......@@ -616,7 +616,7 @@ get_default_sort_order (void)
(int *) &default_sort_order);
}
return CLAMP (default_sort_order, NAUTILUS_FILE_SORT_BY_NAME, NAUTILUS_FILE_SORT_BY_EMBLEMS);
return CLAMP (default_sort_order, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME, NAUTILUS_FILE_SORT_BY_EMBLEMS);
}
static char *
......@@ -1765,7 +1765,7 @@ icon_container_compare_icons_by_name_callback (NautilusIconContainer *container,
g_assert (NAUTILUS_IS_FILE (file_a));
g_assert (NAUTILUS_IS_FILE (file_b));
result = nautilus_file_compare_for_sort (file_a, file_b, NAUTILUS_FILE_SORT_BY_NAME,
result = nautilus_file_compare_for_sort (file_a, file_b, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
FALSE, FALSE);
return result;
......
......@@ -418,7 +418,7 @@ compare_rows_by_name (gconstpointer a, gconstpointer b, void *callback_data)
return nautilus_file_compare_for_sort
(NAUTILUS_FILE (row1->data),
NAUTILUS_FILE (row2->data),
NAUTILUS_FILE_SORT_BY_NAME,
NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
FALSE, FALSE);
}
......@@ -2222,7 +2222,7 @@ static char *
get_attribute_from_sort_type (NautilusFileSortType sort_type)
{
switch (sort_type) {
case NAUTILUS_FILE_SORT_BY_NAME:
case NAUTILUS_FILE_SORT_BY_DISPLAY_NAME:
return g_strdup ("name");
case NAUTILUS_FILE_SORT_BY_SIZE:
return g_strdup ("size");
......@@ -2277,7 +2277,7 @@ real_get_column_specification (FMListView *view,
case 1:
fm_list_view_column_set (specification,
"name", _("Name"),
NAUTILUS_FILE_SORT_BY_NAME,
NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
30, 170, 300, FALSE);
break;
case 2:
......
......@@ -491,7 +491,7 @@ real_get_column_specification (FMListView *view,
case 1:
fm_list_view_column_set (specification,
"name", _("Name"),
NAUTILUS_FILE_SORT_BY_NAME,
NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
30, 150, 300, FALSE);
break;
case 2:
......
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