[gimp] Issue #2179: Get rid of the win32_use_hkcu flag.



commit 6a5023a38a89f3b8e05ff19140fb4fb78b0fc7bf
Author: Simon Mueller <s mueller hn web de>
Date:   Mon Sep 10 23:56:01 2018 +0200

    Issue #2179: Get rid of the win32_use_hkcu flag.
    
    Simply always check HKCU first. If that lookup did not yield any result,
    fall back to HKLM.

 plug-ins/file-raw/file-darktable.c   |  3 ---
 plug-ins/file-raw/file-raw-utils.c   | 10 +++++-----
 plug-ins/file-raw/file-raw-utils.h   |  1 -
 plug-ins/file-raw/file-rawtherapee.c |  3 ---
 4 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/plug-ins/file-raw/file-darktable.c b/plug-ins/file-raw/file-darktable.c
index 20c2b67345..ac8b16db77 100644
--- a/plug-ins/file-raw/file-darktable.c
+++ b/plug-ins/file-raw/file-darktable.c
@@ -98,7 +98,6 @@ init (void)
                                                              "DARKTABLE_EXECUTABLE",
                                                              "org.darktable",
                                                              REGISTRY_KEY_BASE,
-                                                             FALSE,
                                                              &search_path);
   gchar    *argv[]           = { exec_path, "--version", NULL };
   gchar    *darktable_stdout = NULL;
@@ -380,7 +379,6 @@ load_image (const gchar  *filename,
                                                              "DARKTABLE_EXECUTABLE",
                                                              "org.darktable",
                                                              REGISTRY_KEY_BASE,
-                                                             FALSE,
                                                              &search_path);
   gchar    *argv[] =
     {
@@ -474,7 +472,6 @@ load_thumbnail_image (const gchar   *filename,
                                                              "DARKTABLE_EXECUTABLE",
                                                              "org.darktable",
                                                              REGISTRY_KEY_BASE,
-                                                             FALSE,
                                                              &search_path);
   gchar    *argv[] =
     {
diff --git a/plug-ins/file-raw/file-raw-utils.c b/plug-ins/file-raw/file-raw-utils.c
index 9c33b417d3..8847cd0f8b 100644
--- a/plug-ins/file-raw/file-raw-utils.c
+++ b/plug-ins/file-raw/file-raw-utils.c
@@ -41,7 +41,6 @@ file_raw_get_executable_path (const gchar *main_executable,
                               const gchar *env_variable,
                               const gchar *mac_bundle_id,
                               const gchar *win32_registry_key_base,
-                              gboolean     win32_use_hkcu,
                               gboolean    *search_path)
 {
   /*
@@ -129,10 +128,11 @@ file_raw_get_executable_path (const gchar *main_executable,
       else
         registry_key = g_strconcat (win32_registry_key_base, ".exe", NULL);
 
-      if (win32_use_hkcu)
-        status = RegGetValue (HKEY_CURRENT_USER, registry_key, "", RRF_RT_ANY,
-                              NULL, (PVOID)&path, &buffer_size);
-      else
+      /* Check HKCU first in case there is a user specific installation. */
+      status = RegGetValue (HKEY_CURRENT_USER, registry_key, "", RRF_RT_ANY,
+                            NULL, (PVOID)&path, &buffer_size);
+
+      if (status != ERROR_SUCCESS)
         status = RegGetValue (HKEY_LOCAL_MACHINE, registry_key, "", RRF_RT_ANY,
                               NULL, (PVOID)&path, &buffer_size);
 
diff --git a/plug-ins/file-raw/file-raw-utils.h b/plug-ins/file-raw/file-raw-utils.h
index 6cdf862cdc..0199f1f654 100644
--- a/plug-ins/file-raw/file-raw-utils.h
+++ b/plug-ins/file-raw/file-raw-utils.h
@@ -27,7 +27,6 @@ gchar * file_raw_get_executable_path (const gchar *main_executable,
                                       const gchar *env_variable,
                                       const gchar *mac_bundle_id,
                                       const gchar *win32_registry_key_base,
-                                      gboolean     win32_use_hkcu,
                                       gboolean    *search_path);
 
 
diff --git a/plug-ins/file-raw/file-rawtherapee.c b/plug-ins/file-raw/file-rawtherapee.c
index c3fb11a653..1199f82673 100644
--- a/plug-ins/file-raw/file-rawtherapee.c
+++ b/plug-ins/file-raw/file-rawtherapee.c
@@ -96,7 +96,6 @@ init (void)
                                                              "RAWTHERAPEE_EXECUTABLE",
                                                              "com.rawtherapee.rawtherapee",
                                                              REGISTRY_KEY_BASE,
-                                                             TRUE,
                                                              &search_path);
   gchar    *argv[]             = { exec_path, "-v", NULL };
   gchar    *rawtherapee_stdout = NULL;
@@ -300,7 +299,6 @@ load_image (const gchar  *filename,
                                                                "RAWTHERAPEE_EXECUTABLE",
                                                                "com.rawtherapee.rawtherapee",
                                                                REGISTRY_KEY_BASE,
-                                                               TRUE,
                                                                &search_path);
 
   /* linear sRGB for now as GIMP uses that internally in many places anyway */
@@ -407,7 +405,6 @@ load_thumbnail_image (const gchar   *filename,
                                                         "RAWTHERAPEE_EXECUTABLE",
                                                         "com.rawtherapee.rawtherapee",
                                                         REGISTRY_KEY_BASE,
-                                                        TRUE,
                                                         &search_path);
   gchar *argv[] =
     {


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