[gimp] app: implement get_memsize() and get_checksum() in GimpMybrush
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: implement get_memsize() and get_checksum() in GimpMybrush
- Date: Sun, 20 Mar 2016 20:16:47 +0000 (UTC)
commit f7962c27e1dfc90426d37044427c4ebc0de432b9
Author: Michael Natterer <mitch gimp org>
Date: Sun Mar 20 21:16:04 2016 +0100
app: implement get_memsize() and get_checksum() in GimpMybrush
app/core/gimpmybrush.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpmybrush.c b/app/core/gimpmybrush.c
index c2a96f2..888a4ce 100644
--- a/app/core/gimpmybrush.c
+++ b/app/core/gimpmybrush.c
@@ -25,6 +25,7 @@
#include "core-types.h"
+#include "gimp-memsize.h"
#include "gimpmybrush.h"
#include "gimpmybrush-load.h"
#include "gimpmybrush-private.h"
@@ -155,6 +156,8 @@ gimp_mybrush_get_memsize (GimpObject *object,
GimpMybrush *brush = GIMP_MYBRUSH (object);
gint64 memsize = 0;
+ memsize += gimp_string_get_memsize (brush->priv->brush_json);
+
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
gui_size);
}
@@ -187,6 +190,19 @@ gimp_mybrush_get_checksum (GimpTagged *tagged)
GimpMybrush *brush = GIMP_MYBRUSH (tagged);
gchar *checksum_string = NULL;
+ if (brush->priv->brush_json)
+ {
+ GChecksum *checksum = g_checksum_new (G_CHECKSUM_MD5);
+
+ g_checksum_update (checksum,
+ (const guchar *) brush->priv->brush_json,
+ strlen (brush->priv->brush_json));
+
+ checksum_string = g_strdup (g_checksum_get_string (checksum));
+
+ g_checksum_free (checksum);
+ }
+
return checksum_string;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]