[gimp] plug-ins: conditional gimp_install_procedure() should be in init().



commit 4ea88689436afd76a5fddfeb4431a3888763e619
Author: Jehan <jehan girinstud io>
Date:   Tue Jun 27 22:26:56 2017 +0200

    plug-ins: conditional gimp_install_procedure() should be in init().
    
    query() is run only the first time for efficiency. Yet this plugin is
    dependent on the presence of `rawtherapee` which may be installed or
    uninstalled between GIMP startups. Therefore we should move the usual
    gimp_install_procedure() to init() so that the check is done at every
    startup instead.

 plug-ins/file-rawtherapee/file-rawtherapee.c |   16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/file-rawtherapee/file-rawtherapee.c b/plug-ins/file-rawtherapee/file-rawtherapee.c
index 995dfe0..91ef844 100644
--- a/plug-ins/file-rawtherapee/file-rawtherapee.c
+++ b/plug-ins/file-rawtherapee/file-rawtherapee.c
@@ -38,6 +38,7 @@
 #define LOAD_THUMB_PROC "file-rawtherapee-load-thumb"
 
 
+static void     init                 (void);
 static void     query                (void);
 static void     run                  (const gchar      *name,
                                       gint              nparams,
@@ -54,7 +55,7 @@ static gint32   load_thumbnail_image (const gchar      *filename,
 
 const GimpPlugInInfo PLUG_IN_INFO =
 {
-  NULL,  /* init_proc */
+  init,  /* init_proc */
   NULL,  /* quit_proc */
   query, /* query proc */
   run,   /* run_proc */
@@ -64,7 +65,7 @@ MAIN ()
 
 
 static void
-query (void)
+init (void)
 {
   static const GimpParamDef load_args[] =
   {
@@ -168,6 +169,17 @@ query (void)
 }
 
 static void
+query (void)
+{
+  /* query() is run only the first time for efficiency. Yet this plugin
+   * is dependent on the presence of rawtherapee which may be installed
+   * or uninstalled between GIMP startups. Therefore we should move the
+   * usual gimp_install_procedure() to init() so that the check is done
+   * at every startup instead.
+   */
+}
+
+static void
 run (const gchar      *name,
      gint              nparams,
      const GimpParam  *param,


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