Commit 2d9d9d12 authored by Mike Engber's avatar Mike Engber

Link names weren't properly escaped causing them not to get selected.


	* libnautilus-extensions/nautilus-file-operations.c:
	(get_link_name), (make_next_duplicate_name):
	Link names weren't properly escaped causing them not to
	get selected.

	* src/file-manager/fm-directory-view.c: (copy_move_done_callback),
	(new_folder_done),
	(fm_directory_view_trash_state_changed_callback):
	added asserts
parent 247559c2
2000-10-26 Michael Engber <engber@eazel.com>
* libnautilus-extensions/nautilus-file-operations.c:
(get_link_name), (make_next_duplicate_name):
Link names weren't properly escaped causing them not to
get selected.
* src/file-manager/fm-directory-view.c: (copy_move_done_callback),
(new_folder_done),
(fm_directory_view_trash_state_changed_callback):
added asserts
2000-10-26 Ramiro Estrugo <ramiro@eazel.com>
* components/services/nautilus-dependent-shared/eazel-services-footer.c:
......
......@@ -519,11 +519,17 @@ handle_xfer_overwrite (const GnomeVFSXferProgressInfo *progress_info,
static char *
get_link_name (char *name, int count)
{
const char *format;
char *result;
char *unescaped_name;
char *unescaped_result;
const char *format;
g_assert (name != NULL);
unescaped_name = gnome_vfs_unescape_string (name, "/");
g_free (name);
if (count < 1) {
g_warning ("bad count in get_link_name");
count = 1;
......@@ -544,7 +550,7 @@ get_link_name (char *name, int count)
format = _("another link to %s");
break;
}
result = g_strdup_printf (format, name);
unescaped_result = g_strdup_printf (format, unescaped_name);
} else {
/* Handle special cases for the first few numbers of each ten.
......@@ -569,10 +575,14 @@ get_link_name (char *name, int count)
format = _("%dth link to %s");
break;
}
result = g_strdup_printf (format, count, name);
unescaped_result = g_strdup_printf (format, count, unescaped_name);
}
g_free (name);
result = gnome_vfs_escape_path_string (unescaped_result);
g_free (unescaped_name);
g_free (unescaped_result);
return result;
}
......@@ -582,7 +592,7 @@ get_link_name (char *name, int count)
*/
#define COPY_DUPLICATE_TAG _(" (copy)")
#define FRIST_COPY_DUPLICATE_FORMAT _("%s (copy)%s")
#define FIRST_COPY_DUPLICATE_FORMAT _("%s (copy)%s")
#define ANOTHER_COPY_DUPLICATE_TAG _(" (another copy)")
#define SECOND_COPY_DUPLICATE_FORMAT _("%s (another copy)%s")
......@@ -721,7 +731,7 @@ make_next_duplicate_name (const char *base, const char *suffix, int count)
g_assert_not_reached ();
/* fall through */
case 1:
format = FRIST_COPY_DUPLICATE_FORMAT;
format = FIRST_COPY_DUPLICATE_FORMAT;
break;
case 2:
format = SECOND_COPY_DUPLICATE_FORMAT;
......
......@@ -519,11 +519,17 @@ handle_xfer_overwrite (const GnomeVFSXferProgressInfo *progress_info,
static char *
get_link_name (char *name, int count)
{
const char *format;
char *result;
char *unescaped_name;
char *unescaped_result;
const char *format;
g_assert (name != NULL);
unescaped_name = gnome_vfs_unescape_string (name, "/");
g_free (name);
if (count < 1) {
g_warning ("bad count in get_link_name");
count = 1;
......@@ -544,7 +550,7 @@ get_link_name (char *name, int count)
format = _("another link to %s");
break;
}
result = g_strdup_printf (format, name);
unescaped_result = g_strdup_printf (format, unescaped_name);
} else {
/* Handle special cases for the first few numbers of each ten.
......@@ -569,10 +575,14 @@ get_link_name (char *name, int count)
format = _("%dth link to %s");
break;
}
result = g_strdup_printf (format, count, name);
unescaped_result = g_strdup_printf (format, count, unescaped_name);
}
g_free (name);
result = gnome_vfs_escape_path_string (unescaped_result);
g_free (unescaped_name);
g_free (unescaped_result);
return result;
}
......@@ -582,7 +592,7 @@ get_link_name (char *name, int count)
*/
#define COPY_DUPLICATE_TAG _(" (copy)")
#define FRIST_COPY_DUPLICATE_FORMAT _("%s (copy)%s")
#define FIRST_COPY_DUPLICATE_FORMAT _("%s (copy)%s")
#define ANOTHER_COPY_DUPLICATE_TAG _(" (another copy)")
#define SECOND_COPY_DUPLICATE_FORMAT _("%s (another copy)%s")
......@@ -721,7 +731,7 @@ make_next_duplicate_name (const char *base, const char *suffix, int count)
g_assert_not_reached ();
/* fall through */
case 1:
format = FRIST_COPY_DUPLICATE_FORMAT;
format = FIRST_COPY_DUPLICATE_FORMAT;
break;
case 2:
format = SECOND_COPY_DUPLICATE_FORMAT;
......
......@@ -1601,9 +1601,9 @@ copy_move_done_callback (GHashTable *debuting_uris, gpointer data)
CopyMoveDoneData *copy_move_done_data;
DebutingUriData *debuting_uri_data;
copy_move_done_data = (CopyMoveDoneData *) data;
directory_view = copy_move_done_data->directory_view;
g_assert (FM_IS_DIRECTORY_VIEW (directory_view));
debuting_uri_data = g_new (DebutingUriData, 1);
debuting_uri_data->debuting_uris = debuting_uris;
......@@ -2613,7 +2613,8 @@ new_folder_done (const char *new_folder_uri, gpointer data)
FMDirectoryView *directory_view;
RenameLaterParameters *parameters;
directory_view = (FMDirectoryView *)data;
directory_view = (FMDirectoryView *) data;
g_assert (FM_IS_DIRECTORY_VIEW (directory_view));
/* We need to run after the default handler adds the folder we want to
* operate on. The ADD_FILE signal is registered as GTK_RUN_LAST, so we
......@@ -4434,7 +4435,7 @@ fm_directory_view_trash_state_changed_callback (NautilusTrashMonitor *trash_moni
{
FMDirectoryView *view;
view = (FMDirectoryView *)callback_data;
view = (FMDirectoryView *) callback_data;
g_assert (FM_IS_DIRECTORY_VIEW (view));
schedule_update_menus (view);
......
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