[gthumb] file tools: read the schema only when needed



commit 37be5f004846e0f7da2067fe73c939ad5b31bc8d
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Tue Oct 24 09:07:46 2017 +0200

    file tools: read the schema only when needed

 extensions/file_tools/gth-file-tool-crop.c   |    1 +
 extensions/file_tools/gth-file-tool-resize.c |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/extensions/file_tools/gth-file-tool-crop.c b/extensions/file_tools/gth-file-tool-crop.c
index 8649bbb..bafd287 100644
--- a/extensions/file_tools/gth-file-tool-crop.c
+++ b/extensions/file_tools/gth-file-tool-crop.c
@@ -680,6 +680,7 @@ static void
 gth_file_tool_crop_init (GthFileToolCrop *self)
 {
        self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_CROP, GthFileToolCropPrivate);
+       self->priv->settings = NULL;
        gth_file_tool_construct (GTH_FILE_TOOL (self), "image-crop-symbolic", _("Crop"), 
GTH_TOOLBOX_SECTION_FORMAT);
 }
 
diff --git a/extensions/file_tools/gth-file-tool-resize.c b/extensions/file_tools/gth-file-tool-resize.c
index 3208c8c..4a3a120 100644
--- a/extensions/file_tools/gth-file-tool-resize.c
+++ b/extensions/file_tools/gth-file-tool-resize.c
@@ -527,6 +527,9 @@ gth_file_tool_resize_get_options (GthFileTool *base)
        if (source == NULL)
                return NULL;
 
+       if (self->priv->settings == NULL)
+               self->priv->settings = g_settings_new (GTHUMB_RESIZE_SCHEMA);
+
        self->priv->original_width = cairo_image_surface_get_width (source);
        self->priv->original_height = cairo_image_surface_get_height (source);
 
@@ -827,7 +830,7 @@ static void
 gth_file_tool_resize_init (GthFileToolResize *self)
 {
        self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTH_TYPE_FILE_TOOL_RESIZE, GthFileToolResizePrivate);
-       self->priv->settings = g_settings_new (GTHUMB_RESIZE_SCHEMA);
+       self->priv->settings = NULL;
        self->priv->builder = NULL;
        self->priv->preview = NULL;
        self->priv->new_image = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]