[gimp] app: move gimp_file_compare() to gimp-utils.[ch]
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: move gimp_file_compare() to gimp-utils.[ch]
- Date: Sat, 2 Aug 2014 13:11:21 +0000 (UTC)
commit 2b1735f784f86bcef7e2c2db680dcd367c55ac67
Author: Michael Natterer <mitch gimp org>
Date: Sat Aug 2 15:07:26 2014 +0200
app: move gimp_file_compare() to gimp-utils.[ch]
It's a GCompareFunc to be used for finding GFiles in lists.
app/core/gimp-transform-resize.c | 1 +
app/core/gimp-utils.c | 21 +++++++++++++++++++++
app/core/gimp-utils.h | 3 +++
app/core/gimpdatafactory.c | 22 +---------------------
app/core/gimpidtable.c | 1 +
app/gegl/gimp-gegl-apply-operation.c | 1 +
app/plug-in/gimppluginshm.c | 1 +
7 files changed, 29 insertions(+), 21 deletions(-)
---
diff --git a/app/core/gimp-transform-resize.c b/app/core/gimp-transform-resize.c
index 3efe72f..85ef5b8 100644
--- a/app/core/gimp-transform-resize.c
+++ b/app/core/gimp-transform-resize.c
@@ -17,6 +17,7 @@
#include "config.h"
+#include <gio/gio.h>
#include <gegl.h>
#include "libgimpmath/gimpmath.h"
diff --git a/app/core/gimp-utils.c b/app/core/gimp-utils.c
index fee79ac..f6a931c 100644
--- a/app/core/gimp-utils.c
+++ b/app/core/gimp-utils.c
@@ -926,6 +926,27 @@ gimp_constrain_line (gdouble start_x,
}
}
+gint
+gimp_file_compare (GFile *file1,
+ GFile *file2)
+{
+ if (g_file_equal (file1, file2))
+ {
+ return 0;
+ }
+ else
+ {
+ gchar *uri1 = g_file_get_uri (file1);
+ gchar *uri2 = g_file_get_uri (file2);
+ gint result = strcmp (uri1, uri2);
+
+ g_free (uri1);
+ g_free (uri2);
+
+ return result;
+ }
+}
+
/* debug stuff */
diff --git a/app/core/gimp-utils.h b/app/core/gimp-utils.h
index 90404b5..197eeab 100644
--- a/app/core/gimp-utils.h
+++ b/app/core/gimp-utils.h
@@ -100,6 +100,9 @@ void gimp_constrain_line (gdouble start_x,
gdouble *end_y,
gint n_snap_lines);
+gint gimp_file_compare (GFile *file1,
+ GFile *file2);
+
void gimp_create_image_from_buffer (Gimp *gimp,
GeglBuffer *buffer);
diff --git a/app/core/gimpdatafactory.c b/app/core/gimpdatafactory.c
index a62da4d..a7537f0 100644
--- a/app/core/gimpdatafactory.c
+++ b/app/core/gimpdatafactory.c
@@ -33,6 +33,7 @@
#include "core-types.h"
#include "gimp.h"
+#include "gimp-utils.h"
#include "gimpcontext.h"
#include "gimpdata.h"
#include "gimpdatafactory.h"
@@ -670,27 +671,6 @@ gimp_data_factory_has_data_new_func (GimpDataFactory *factory)
/* private functions */
-static gint
-gimp_file_compare (GFile *file1,
- GFile *file2)
-{
- if (g_file_equal (file1, file2))
- {
- return 0;
- }
- else
- {
- gchar *uri1 = g_file_get_uri (file1);
- gchar *uri2 = g_file_get_uri (file2);
- gint result = strcmp (uri1, uri2);
-
- g_free (uri1);
- g_free (uri2);
-
- return result;
- }
-}
-
static GFile *
gimp_data_factory_get_save_dir (GimpDataFactory *factory,
GError **error)
diff --git a/app/core/gimpidtable.c b/app/core/gimpidtable.c
index 8565bba..5cbe150 100644
--- a/app/core/gimpidtable.c
+++ b/app/core/gimpidtable.c
@@ -20,6 +20,7 @@
#include "config.h"
+#include <gio/gio.h>
#include <gegl.h>
#include "core-types.h"
diff --git a/app/gegl/gimp-gegl-apply-operation.c b/app/gegl/gimp-gegl-apply-operation.c
index 3e0605c..2f9f75f 100644
--- a/app/gegl/gimp-gegl-apply-operation.c
+++ b/app/gegl/gimp-gegl-apply-operation.c
@@ -23,6 +23,7 @@
#include "config.h"
#include <cairo.h>
+#include <gio/gio.h>
#include <gegl.h>
#include "gimp-gegl-types.h"
diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c
index 11029c0..11a5045 100644
--- a/app/plug-in/gimppluginshm.c
+++ b/app/plug-in/gimppluginshm.c
@@ -44,6 +44,7 @@
#endif /* USE_POSIX_SHM */
+#include <gio/gio.h>
#include <gegl.h>
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]