[gnome-software] trivial: Export a function to gs-utils.h
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] trivial: Export a function to gs-utils.h
- Date: Tue, 26 Apr 2016 18:11:16 +0000 (UTC)
commit 824d095886b6415598979f1ae670cc18391468a1
Author: Richard Hughes <richard hughsie com>
Date: Tue Apr 26 19:02:34 2016 +0100
trivial: Export a function to gs-utils.h
src/gs-utils.c | 21 +++++++++++++++++++++
src/gs-utils.h | 2 ++
src/plugins/gs-plugin-provenance.c | 23 +----------------------
3 files changed, 24 insertions(+), 22 deletions(-)
---
diff --git a/src/gs-utils.c b/src/gs-utils.c
index 730afab..685affa 100644
--- a/src/gs-utils.c
+++ b/src/gs-utils.c
@@ -24,6 +24,7 @@
#include <glib/gi18n.h>
#include <gio/gdesktopappinfo.h>
#include <errno.h>
+#include <fnmatch.h>
#ifdef HAVE_POLKIT
#include <polkit/polkit.h>
@@ -893,4 +894,24 @@ gs_utils_widget_set_custom_css (GsApp *app, GtkWidget *widget, const gchar *meta
g_object_unref);
}
+/**
+ * gs_utils_strv_fnmatch:
+ */
+gboolean
+gs_utils_strv_fnmatch (gchar **strv, const gchar *str)
+{
+ guint i;
+
+ /* empty */
+ if (strv == NULL)
+ return FALSE;
+
+ /* look at each one */
+ for (i = 0; strv[i] != NULL; i++) {
+ if (fnmatch (strv[i], str, 0) == 0)
+ return TRUE;
+ }
+ return FALSE;
+}
+
/* vim: set noexpandtab: */
diff --git a/src/gs-utils.h b/src/gs-utils.h
index e407bd0..27a4b3e 100644
--- a/src/gs-utils.h
+++ b/src/gs-utils.h
@@ -72,6 +72,8 @@ gboolean gs_utils_is_current_desktop (const gchar *name);
void gs_utils_widget_set_custom_css (GsApp *app,
GtkWidget *widget,
const gchar *metadata_css);
+gboolean gs_utils_strv_fnmatch (gchar **strv,
+ const gchar *str);
G_END_DECLS
diff --git a/src/plugins/gs-plugin-provenance.c b/src/plugins/gs-plugin-provenance.c
index e1013b3..6474822 100644
--- a/src/plugins/gs-plugin-provenance.c
+++ b/src/plugins/gs-plugin-provenance.c
@@ -21,9 +21,8 @@
#include <config.h>
-#include <fnmatch.h>
-
#include <gs-plugin.h>
+#include <gs-utils.h>
/*
* SECTION:
@@ -104,26 +103,6 @@ gs_plugin_destroy (GsPlugin *plugin)
}
/**
- * gs_utils_strv_fnmatch:
- */
-static gboolean
-gs_utils_strv_fnmatch (gchar **strv, const gchar *str)
-{
- guint i;
-
- /* empty */
- if (strv == NULL)
- return FALSE;
-
- /* look at each one */
- for (i = 0; strv[i] != NULL; i++) {
- if (fnmatch (strv[i], str, 0) == 0)
- return TRUE;
- }
- return FALSE;
-}
-
-/**
* gs_plugin_refine_app:
*/
gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]