[tepl] MetadataStore: call g_file_info_dup() in get_metadata_for_location()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tepl] MetadataStore: call g_file_info_dup() in get_metadata_for_location()
- Date: Sat, 18 Apr 2020 17:18:46 +0000 (UTC)
commit f383c8a5fe142704ae9892c3750ff0f13fa883cb
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Apr 15 21:00:06 2020 +0200
MetadataStore: call g_file_info_dup() in get_metadata_for_location()
No changes are required in the unit tests.
tepl/tepl-metadata-store.c | 2 +-
tepl/tepl-metadata.c | 9 +--------
2 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/tepl/tepl-metadata-store.c b/tepl/tepl-metadata-store.c
index a897b3e..d9b87f0 100644
--- a/tepl/tepl-metadata-store.c
+++ b/tepl/tepl-metadata-store.c
@@ -1034,7 +1034,7 @@ _tepl_metadata_store_get_metadata_for_location (TeplMetadataStore *store,
document_metadata_set_current_atime (document_metadata);
store->priv->modified = TRUE;
- return g_object_ref (document_metadata->entries);
+ return g_file_info_dup (document_metadata->entries);
}
/*
diff --git a/tepl/tepl-metadata.c b/tepl/tepl-metadata.c
index 7cced7b..df2b5fb 100644
--- a/tepl/tepl-metadata.c
+++ b/tepl/tepl-metadata.c
@@ -82,17 +82,10 @@ _tepl_metadata_query_info_async (GFile *location,
if (_tepl_metadata_store_is_loaded (store))
{
GFileInfo *file_info;
- GFileInfo *file_info_dup = NULL;
- /* TODO: call g_file_info_dup() in _tepl_metadata_store_get_metadata_for_location()? */
file_info = _tepl_metadata_store_get_metadata_for_location (store, location);
- if (file_info != NULL)
- {
- file_info_dup = g_file_info_dup (file_info);
- g_object_unref (file_info);
- }
- g_task_return_pointer (task, file_info_dup, g_object_unref);
+ g_task_return_pointer (task, file_info, g_object_unref);
g_object_unref (task);
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]