Implement koto_utils_is_valid_string to replace repetitive NULL and g_strcmp0 code.

Reduce usage of g_return_if_fail since it results in unnecessary warnings.
This commit is contained in:
Joshua Strobl 2021-05-07 21:52:42 +03:00
parent 0aafa68a35
commit b4ffba62c7
17 changed files with 121 additions and 65 deletions

View file

@ -87,6 +87,10 @@ gchar* koto_utils_get_filename_without_extension(gchar *filename) {
return stripped_file_name;
}
gboolean koto_utils_is_string_valid(gchar *str) {
return ((str != NULL) && (g_strcmp0(str, "") != 0));
}
void koto_utils_push_queue_element_to_store(gpointer data, gpointer user_data) {
g_list_store_append(G_LIST_STORE(user_data), data);
}