View | Details | Raw Unified | Return to bug 10851
Collapse All | Expand All

(-)file-roller-2.16.3-orig/src/window.c (-4 / +21 lines)
Lines 1139-1144 Link Here
1139
_window_update_current_location (FRWindow *window)
1139
_window_update_current_location (FRWindow *window)
1140
{
1140
{
1141
	const char *current_dir = window_get_current_location (window);
1141
	const char *current_dir = window_get_current_location (window);
1142
	/* non-8bit path handling roughly borrowed from Dia;
1143
	 * thanks an example/docs by Vitaly Lipatov (etersoft.ru)
1144
	 */
1145
	char buffer[300];
1146
	char *utf8current_dir = NULL;
1147
1148
	if (!g_utf8_validate(current_dir, -1, NULL)) {
1149
		utf8current_dir = g_filename_to_utf8(current_dir, -1, NULL, NULL, NULL);
1150
		if (utf8current_dir == NULL) {
1151
			g_warning(_("Some characters in the current path are neither UTF-8 nor your local encoding"));
1152
		}
1153
	}
1154
	if (utf8current_dir == NULL)
1155
		utf8current_dir = g_strdup(current_dir);
1156
	g_snprintf(buffer, 300, "%s", utf8current_dir);
1142
1157
1143
	if (window->list_mode == WINDOW_LIST_MODE_FLAT) {
1158
	if (window->list_mode == WINDOW_LIST_MODE_FLAT) {
1144
		gtk_widget_hide (window->location_bar);
1159
		gtk_widget_hide (window->location_bar);
Lines 1147-1160 Link Here
1147
1162
1148
	gtk_widget_show (window->location_bar);
1163
	gtk_widget_show (window->location_bar);
1149
1164
1150
	gtk_entry_set_text (GTK_ENTRY (window->location_entry), window->archive_present? current_dir: "");
1165
	gtk_entry_set_text (GTK_ENTRY (window->location_entry), window->archive_present? utf8current_dir: "");
1151
	gtk_widget_set_sensitive (window->home_button, window->archive_present);
1166
	gtk_widget_set_sensitive (window->home_button, window->archive_present);
1152
	gtk_widget_set_sensitive (window->up_button, window->archive_present && (current_dir != NULL) && (strcmp (current_dir, "/") != 0));
1167
	gtk_widget_set_sensitive (window->up_button, window->archive_present && (utf8current_dir != NULL) && (strcmp (utf8current_dir, "/") != 0));
1153
	gtk_widget_set_sensitive (window->back_button, window->archive_present && (current_dir != NULL) && (window->history_current != NULL) && (window->history_current->next != NULL));
1168
	gtk_widget_set_sensitive (window->back_button, window->archive_present && (utf8current_dir != NULL) && (window->history_current != NULL) && (window->history_current->next != NULL));
1154
	gtk_widget_set_sensitive (window->fwd_button, window->archive_present && (current_dir != NULL) && (window->history_current != NULL) && (window->history_current->prev != NULL));
1169
	gtk_widget_set_sensitive (window->fwd_button, window->archive_present && (utf8current_dir != NULL) && (window->history_current != NULL) && (window->history_current->prev != NULL));
1155
	gtk_widget_set_sensitive (window->location_entry, window->archive_present);
1170
	gtk_widget_set_sensitive (window->location_entry, window->archive_present);
1156
	gtk_widget_set_sensitive (window->location_label, window->archive_present);
1171
	gtk_widget_set_sensitive (window->location_label, window->archive_present);
1157
1172
1173
	g_free(utf8current_dir);
1174
1158
#if 0
1175
#if 0
1159
	_window_history_print (window);
1176
	_window_history_print (window);
1160
#endif
1177
#endif

Return to bug 10851