MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / ghb_file_chooser_set_initial_file

Function ghb_file_chooser_set_initial_file

gtk/src/util.c:131–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void
132ghb_file_chooser_set_initial_file (GtkFileChooser *chooser, const char *file)
133{
134 if (!file || !file[0])
135 {
136 return;
137 }
138 else if (g_file_test(file, G_FILE_TEST_IS_DIR))
139 {
140 GFile *gfile = g_file_new_for_path(file);
141 gtk_file_chooser_set_current_folder(chooser, gfile, NULL);
142 g_object_unref(gfile);
143 }
144 else
145 {
146 char *dir = g_path_get_dirname(file);
147 if (g_file_test(dir, G_FILE_TEST_IS_DIR))
148 {
149 GFile *gfile = g_file_new_for_path(dir);
150 gtk_file_chooser_set_current_folder(chooser, gfile, NULL);
151 g_object_unref(gfile);
152 }
153 g_free(dir);
154 if (gtk_file_chooser_get_action(chooser) == GTK_FILE_CHOOSER_ACTION_SAVE)
155 {
156 char *base = g_path_get_basename(file);
157 gtk_file_chooser_set_current_name(chooser, base);
158 g_free(base);
159 }
160 }
161}
162
163char *
164ghb_file_chooser_get_filename (GtkFileChooser *chooser)

Callers 9

preset_import_action_cbFunction · 0.85
preset_export_action_cbFunction · 0.85
ghb_file_button_clickedFunction · 0.85
do_source_dialogFunction · 0.85
destination_action_cbFunction · 0.85
save_queue_fileFunction · 0.85
open_queue_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected