Example #1
0
void hash_file_start(const char *uri)
{
	size_t key_size = 0;
	const uint8_t *hmac_key = gui_get_hmac_key(&key_size);

	if (gui_get_view() == GUI_VIEW_FILE)
		gtkhash_hash_file_clear_digests(&hash_priv.file_data);

	gtkhash_hash_file(&hash_priv.file_data, uri, hmac_key, key_size);
}
Example #2
0
void hash_file_list_start(void)
{
	g_assert(!hash_priv.uris);

	gtkhash_hash_file_clear_digests(&hash_priv.file_data);

	hash_priv.uris = list_get_all_uris();
	g_assert(hash_priv.uris);

	hash_file_start(hash_priv.uris->data);
}
Example #3
0
void hash_file_start(const char *uri)
{
	if (gui_get_view() != GUI_VIEW_FILE_LIST)
		gtkhash_hash_file_clear_digests(&hash_priv.file_data);

	GFile *file = g_file_new_for_uri(uri);
	char *pname = g_file_get_parse_name(file);
	gtk_progress_bar_set_text(gui.progressbar, pname);
	g_free(pname);
	g_object_unref(file);

	gtkhash_hash_file_set_uri(&hash_priv.file_data, uri);
	gtkhash_hash_file_set_stop(&hash_priv.file_data, false);
	gtkhash_hash_file_set_state(&hash_priv.file_data, HASH_FILE_STATE_START);
	gtkhash_hash_file_add_source(&hash_priv.file_data);
}