|
Lines 2771-2777
selection_check_foreach_cb (GtkTreeModel
Link Here
|
| 2771 |
case OPERATION_MODE_BROWSE: |
2771 |
case OPERATION_MODE_BROWSE: |
| 2772 |
gtk_tree_model_sort_convert_iter_to_child_iter (closure->impl->sort_model, &child_iter, iter); |
2772 |
gtk_tree_model_sort_convert_iter_to_child_iter (closure->impl->sort_model, &child_iter, iter); |
| 2773 |
info = _gtk_file_system_model_get_info (closure->impl->browse_files_model, &child_iter); |
2773 |
info = _gtk_file_system_model_get_info (closure->impl->browse_files_model, &child_iter); |
| 2774 |
is_folder = info ? (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) : FALSE; |
2774 |
is_folder = info ? (_gtk_file_system_consider_as_directory (info)) : FALSE; |
| 2775 |
break; |
2775 |
break; |
| 2776 |
|
2776 |
|
| 2777 |
case OPERATION_MODE_SEARCH: |
2777 |
case OPERATION_MODE_SEARCH: |
|
Lines 4165-4172
file_list_drag_data_received_get_info_cb
Link Here
|
| 4165 |
|
4165 |
|
| 4166 |
if ((data->impl->action == GTK_FILE_CHOOSER_ACTION_OPEN || |
4166 |
if ((data->impl->action == GTK_FILE_CHOOSER_ACTION_OPEN || |
| 4167 |
data->impl->action == GTK_FILE_CHOOSER_ACTION_SAVE) && |
4167 |
data->impl->action == GTK_FILE_CHOOSER_ACTION_SAVE) && |
| 4168 |
data->uris[1] == 0 && !error && |
4168 |
data->uris[1] == 0 && !error && _gtk_file_system_consider_as_directory (info)) |
| 4169 |
g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) |
|
|
| 4170 |
change_folder_and_display_error (data->impl, data->file, FALSE); |
4169 |
change_folder_and_display_error (data->impl, data->file, FALSE); |
| 4171 |
else |
4170 |
else |
| 4172 |
{ |
4171 |
{ |
|
Lines 6086-6092
list_model_filter_func (GtkFileSystemMod
Link Here
|
| 6086 |
if (!impl->current_filter) |
6085 |
if (!impl->current_filter) |
| 6087 |
return TRUE; |
6086 |
return TRUE; |
| 6088 |
|
6087 |
|
| 6089 |
if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY) |
6088 |
if (_gtk_file_system_consider_as_directory (file_info)) |
| 6090 |
return TRUE; |
6089 |
return TRUE; |
| 6091 |
|
6090 |
|
| 6092 |
return !get_is_file_filtered (impl, file, file_info); |
6091 |
return !get_is_file_filtered (impl, file, file_info); |
|
Lines 6123-6134
install_list_model_filter (GtkFileChoose
Link Here
|
| 6123 |
gboolean dir_a, dir_b; \ |
6122 |
gboolean dir_a, dir_b; \ |
| 6124 |
\ |
6123 |
\ |
| 6125 |
if (info_a) \ |
6124 |
if (info_a) \ |
| 6126 |
dir_a = (g_file_info_get_file_type (info_a) == G_FILE_TYPE_DIRECTORY); \ |
6125 |
dir_a = _gtk_file_system_consider_as_directory (info_a); \ |
| 6127 |
else \ |
6126 |
else \ |
| 6128 |
return impl->list_sort_ascending ? -1 : 1; \ |
6127 |
return impl->list_sort_ascending ? -1 : 1; \ |
| 6129 |
\ |
6128 |
\ |
| 6130 |
if (info_b) \ |
6129 |
if (info_b) \ |
| 6131 |
dir_b = (g_file_info_get_file_type (info_b) == G_FILE_TYPE_DIRECTORY); \ |
6130 |
dir_b = _gtk_file_system_consider_as_directory (info_b); \ |
| 6132 |
else \ |
6131 |
else \ |
| 6133 |
return impl->list_sort_ascending ? 1 : -1; \ |
6132 |
return impl->list_sort_ascending ? 1 : -1; \ |
| 6134 |
\ |
6133 |
\ |
|
Lines 6410-6418
show_and_select_files_finished_loading (
Link Here
|
| 6410 |
have_hidden = g_file_info_get_is_hidden (info); |
6409 |
have_hidden = g_file_info_get_is_hidden (info); |
| 6411 |
|
6410 |
|
| 6412 |
if (!have_filtered) |
6411 |
if (!have_filtered) |
| 6413 |
have_filtered = (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY) && |
6412 |
have_filtered = (! _gtk_file_system_consider_as_directory (info)) && |
| 6414 |
get_is_file_filtered (data->impl, file, info); |
6413 |
get_is_file_filtered (data->impl, file, info); |
| 6415 |
|
6414 |
|
| 6416 |
g_object_unref (info); |
6415 |
g_object_unref (info); |
| 6417 |
|
6416 |
|
| 6418 |
if (have_hidden && have_filtered) |
6417 |
if (have_hidden && have_filtered) |
|
Lines 6745-6751
update_chooser_entry (GtkFileChooserDefa
Link Here
|
| 6745 |
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) |
6744 |
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) |
| 6746 |
{ |
6745 |
{ |
| 6747 |
/* We don't want the name to change when clicking on a folder... */ |
6746 |
/* We don't want the name to change when clicking on a folder... */ |
| 6748 |
change_entry = (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY); |
6747 |
change_entry = (! _gtk_file_system_consider_as_directory (info)); |
| 6749 |
} |
6748 |
} |
| 6750 |
else |
6749 |
else |
| 6751 |
change_entry = TRUE; /* ... unless we are in SELECT_FOLDER mode */ |
6750 |
change_entry = TRUE; /* ... unless we are in SELECT_FOLDER mode */ |
|
Lines 6900-6906
update_current_folder_get_info_cb (GCanc
Link Here
|
| 6900 |
g_object_unref (data->original_file); |
6899 |
g_object_unref (data->original_file); |
| 6901 |
} |
6900 |
} |
| 6902 |
|
6901 |
|
| 6903 |
if (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY) |
6902 |
if (! _gtk_file_system_consider_as_directory (info)) |
| 6904 |
goto out; |
6903 |
goto out; |
| 6905 |
|
6904 |
|
| 6906 |
if (!_gtk_path_bar_set_file (GTK_PATH_BAR (impl->browse_path_bar), data->file, data->keep_trail, NULL)) |
6905 |
if (!_gtk_path_bar_set_file (GTK_PATH_BAR (impl->browse_path_bar), data->file, data->keep_trail, NULL)) |
|
Lines 7183-7189
maybe_select (GtkTreeModel *model,
Link Here
|
| 7183 |
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view)); |
7182 |
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view)); |
| 7184 |
|
7183 |
|
| 7185 |
info = get_list_file_info (impl, iter); |
7184 |
info = get_list_file_info (impl, iter); |
| 7186 |
is_folder = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY); |
7185 |
is_folder = _gtk_file_system_consider_as_directory (info); |
| 7187 |
|
7186 |
|
| 7188 |
if ((is_folder && impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) || |
7187 |
if ((is_folder && impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER) || |
| 7189 |
(!is_folder && impl->action == GTK_FILE_CHOOSER_ACTION_OPEN)) |
7188 |
(!is_folder && impl->action == GTK_FILE_CHOOSER_ACTION_OPEN)) |
|
Lines 7581-7587
add_shortcut_get_info_cb (GCancellable *
Link Here
|
| 7581 |
|
7580 |
|
| 7582 |
data->impl->loading_shortcuts = g_slist_remove (data->impl->loading_shortcuts, cancellable); |
7581 |
data->impl->loading_shortcuts = g_slist_remove (data->impl->loading_shortcuts, cancellable); |
| 7583 |
|
7582 |
|
| 7584 |
if (cancelled || error || g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY) |
7583 |
if (cancelled || error || (! _gtk_file_system_consider_as_directory (info))) |
| 7585 |
goto out; |
7584 |
goto out; |
| 7586 |
|
7585 |
|
| 7587 |
pos = shortcuts_get_pos_for_shortcut_folder (data->impl, data->impl->num_shortcuts); |
7586 |
pos = shortcuts_get_pos_for_shortcut_folder (data->impl, data->impl->num_shortcuts); |
|
Lines 8129-8135
save_entry_get_info_cb (GCancellable *ca
Link Here
|
| 8129 |
if (!info) |
8128 |
if (!info) |
| 8130 |
parent_is_folder = FALSE; |
8129 |
parent_is_folder = FALSE; |
| 8131 |
else |
8130 |
else |
| 8132 |
parent_is_folder = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY); |
8131 |
parent_is_folder = _gtk_file_system_consider_as_directory (info); |
| 8133 |
|
8132 |
|
| 8134 |
if (parent_is_folder) |
8133 |
if (parent_is_folder) |
| 8135 |
{ |
8134 |
{ |
|
Lines 8199-8205
file_exists_get_info_cb (GCancellable *c
Link Here
|
| 8199 |
if (cancelled) |
8198 |
if (cancelled) |
| 8200 |
goto out; |
8199 |
goto out; |
| 8201 |
|
8200 |
|
| 8202 |
file_exists_and_is_not_folder = info && (g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY); |
8201 |
file_exists_and_is_not_folder = info && (! _gtk_file_system_consider_as_directory (info)); |
| 8203 |
|
8202 |
|
| 8204 |
if (data->impl->action == GTK_FILE_CHOOSER_ACTION_OPEN) |
8203 |
if (data->impl->action == GTK_FILE_CHOOSER_ACTION_OPEN) |
| 8205 |
/* user typed a filename; we are done */ |
8204 |
/* user typed a filename; we are done */ |
|
Lines 8613-8619
search_hit_get_info_cb (GCancellable *ca
Link Here
|
| 8613 |
|
8612 |
|
| 8614 |
display_name = g_strdup (g_file_info_get_display_name (info)); |
8613 |
display_name = g_strdup (g_file_info_get_display_name (info)); |
| 8615 |
mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (info)); |
8614 |
mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (info)); |
| 8616 |
is_folder = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY); |
8615 |
is_folder = _gtk_file_system_consider_as_directory (info); |
| 8617 |
pixbuf = _gtk_file_info_render_icon (info, GTK_WIDGET (request->impl), |
8616 |
pixbuf = _gtk_file_info_render_icon (info, GTK_WIDGET (request->impl), |
| 8618 |
request->impl->icon_size); |
8617 |
request->impl->icon_size); |
| 8619 |
|
8618 |
|
|
Lines 9684-9690
recent_item_get_info_cb (GCancellable *c
Link Here
|
| 9684 |
goto out; |
9683 |
goto out; |
| 9685 |
} |
9684 |
} |
| 9686 |
|
9685 |
|
| 9687 |
is_folder = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY); |
9686 |
is_folder = _gtk_file_system_consider_as_directory (info); |
| 9688 |
|
9687 |
|
| 9689 |
gtk_list_store_set (request->impl->recent_model, &iter, |
9688 |
gtk_list_store_set (request->impl->recent_model, &iter, |
| 9690 |
RECENT_MODEL_COL_IS_FOLDER, is_folder, |
9689 |
RECENT_MODEL_COL_IS_FOLDER, is_folder, |
|
Lines 10248-10254
shortcuts_activate_get_info_cb (GCancell
Link Here
|
| 10248 |
if (cancelled) |
10247 |
if (cancelled) |
| 10249 |
goto out; |
10248 |
goto out; |
| 10250 |
|
10249 |
|
| 10251 |
if (!error && g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) |
10250 |
if (!error && _gtk_file_system_consider_as_directory (info)) |
| 10252 |
change_folder_and_display_error (data->impl, data->file, FALSE); |
10251 |
change_folder_and_display_error (data->impl, data->file, FALSE); |
| 10253 |
else |
10252 |
else |
| 10254 |
gtk_file_chooser_default_select_file (GTK_FILE_CHOOSER (data->impl), |
10253 |
gtk_file_chooser_default_select_file (GTK_FILE_CHOOSER (data->impl), |
|
Lines 10470-10476
list_select_func (GtkTreeSelection *se
Link Here
|
| 10470 |
|
10469 |
|
| 10471 |
gtk_tree_model_sort_convert_iter_to_child_iter (impl->sort_model, &child_iter, &iter); |
10470 |
gtk_tree_model_sort_convert_iter_to_child_iter (impl->sort_model, &child_iter, &iter); |
| 10472 |
info = _gtk_file_system_model_get_info (impl->browse_files_model, &child_iter); |
10471 |
info = _gtk_file_system_model_get_info (impl->browse_files_model, &child_iter); |
| 10473 |
if (info && g_file_info_get_file_type (info) != G_FILE_TYPE_DIRECTORY) |
10472 |
if (info && (! _gtk_file_system_consider_as_directory (info))) |
| 10474 |
return FALSE; |
10473 |
return FALSE; |
| 10475 |
} |
10474 |
} |
| 10476 |
break; |
10475 |
break; |
|
Lines 10582-10592
list_row_activated (GtkTreeView
Link Here
|
| 10582 |
info = _gtk_file_system_model_get_info (impl->browse_files_model, |
10581 |
info = _gtk_file_system_model_get_info (impl->browse_files_model, |
| 10583 |
&child_iter); |
10582 |
&child_iter); |
| 10584 |
|
10583 |
|
| 10585 |
if (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) |
10584 |
if (_gtk_file_system_consider_as_directory (info)) |
| 10586 |
{ |
10585 |
{ |
| 10587 |
GFile *file; |
10586 |
GFile *file, *target_file; |
|
|
10587 |
const gchar *target_uri; |
| 10588 |
|
10588 |
|
| 10589 |
file = _gtk_file_system_model_get_file (impl->browse_files_model, &child_iter); |
10589 |
file = _gtk_file_system_model_get_file (impl->browse_files_model, &child_iter); |
|
|
10590 |
if (g_file_info_get_file_type (info) == G_FILE_TYPE_SHORTCUT || |
| 10591 |
g_file_info_get_file_type (info) == G_FILE_TYPE_MOUNTABLE) |
| 10592 |
{ |
| 10593 |
target_uri = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_STANDARD_TARGET_URI); |
| 10594 |
if (target_uri) |
| 10595 |
{ |
| 10596 |
target_file = g_file_new_for_uri (target_uri); |
| 10597 |
if (target_file) |
| 10598 |
{ |
| 10599 |
g_object_unref (file); |
| 10600 |
file = target_file; |
| 10601 |
} |
| 10602 |
} |
| 10603 |
} |
| 10604 |
|
| 10605 |
|
| 10590 |
change_folder_and_display_error (impl, file, FALSE); |
10606 |
change_folder_and_display_error (impl, file, FALSE); |
| 10591 |
return; |
10607 |
return; |
| 10592 |
} |
10608 |
} |
|
Lines 10714-10720
list_icon_data_func (GtkTreeViewColumn *
Link Here
|
| 10714 |
if (info && |
10730 |
if (info && |
| 10715 |
(impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || |
10731 |
(impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || |
| 10716 |
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)) |
10732 |
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)) |
| 10717 |
sensitive = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY); |
10733 |
sensitive = _gtk_file_system_consider_as_directory (info); |
| 10718 |
} |
10734 |
} |
| 10719 |
break; |
10735 |
break; |
| 10720 |
} |
10736 |
} |
|
Lines 10818-10824
list_name_data_func (GtkTreeViewColumn *
Link Here
|
| 10818 |
if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || |
10834 |
if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || |
| 10819 |
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) |
10835 |
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) |
| 10820 |
{ |
10836 |
{ |
| 10821 |
sensitive = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY); |
10837 |
sensitive = _gtk_file_system_consider_as_directory (info); |
| 10822 |
} |
10838 |
} |
| 10823 |
|
10839 |
|
| 10824 |
g_object_set (cell, |
10840 |
g_object_set (cell, |
|
Lines 10842-10848
list_size_data_func (GtkTreeViewColumn *
Link Here
|
| 10842 |
gchar *str; |
10858 |
gchar *str; |
| 10843 |
gboolean sensitive = TRUE; |
10859 |
gboolean sensitive = TRUE; |
| 10844 |
|
10860 |
|
| 10845 |
if (!info || g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) |
10861 |
if (!info || _gtk_file_system_consider_as_directory (info)) |
| 10846 |
{ |
10862 |
{ |
| 10847 |
g_object_set (cell, |
10863 |
g_object_set (cell, |
| 10848 |
"text", NULL, |
10864 |
"text", NULL, |
|
Lines 10959-10965
list_mtime_data_func (GtkTreeViewColumn
Link Here
|
| 10959 |
|
10975 |
|
| 10960 |
if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || |
10976 |
if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER || |
| 10961 |
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) |
10977 |
impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER) |
| 10962 |
sensitive = (g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY); |
10978 |
sensitive = _gtk_file_system_consider_as_directory (info); |
| 10963 |
} |
10979 |
} |
| 10964 |
|
10980 |
|
| 10965 |
if (G_UNLIKELY (time_mtime == 0)) |
10981 |
if (G_UNLIKELY (time_mtime == 0)) |