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

Function ghb_file_button_set_file

gtk/src/ghb-file-button.c:269–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269void
270ghb_file_button_set_file (GhbFileButton *self, GFile *file)
271{
272 g_return_if_fail(GHB_IS_FILE_BUTTON(self));
273
274 if (file == NULL) return;
275
276 if (self->selected_file)
277 {
278 g_object_unref(self->selected_file);
279 }
280
281 self->selected_file = g_object_ref(file);
282
283 if (g_file_test(g_file_peek_path(file), G_FILE_TEST_EXISTS))
284 {
285 g_autofree char *file_base = g_file_get_basename(file);
286 gtk_label_set_label(self->label, file_base);
287 g_file_query_info_async(file, G_FILE_ATTRIBUTE_STANDARD_ICON,
288 G_FILE_QUERY_INFO_NONE, G_PRIORITY_LOW, NULL,
289 (GAsyncReadyCallback) file_icon_query_cb, self);
290 }
291 else
292 {
293 gtk_label_set_label(self->label, _("(None)"));
294 gtk_image_clear(self->icon);
295 }
296
297 g_object_notify_by_pspec(G_OBJECT(self), props[PROP_FILE]);
298}
299
300void
301ghb_file_button_set_filename (GhbFileButton *self, const char *filename)

Callers 2

chooser_response_cbFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected