gnucash maint: Win32 - drop conditional code never reached

Geert Janssens gjanssens at code.gnucash.org
Sun Sep 26 16:59:32 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/2a7566cc (commit)
	from  https://github.com/Gnucash/gnucash/commit/c17d43ba (commit)



commit 2a7566cc4002b5a0d1a894c5ebf9df1a8d5652ab
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 26 22:58:08 2021 +0200

    Win32 - drop conditional code never reached
    
    We had hardcoded HAVE_HTMLHELPW to always be true so the fallback
    code that's only reached when it is false was never reached.
    Time to drop this dead code.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index baa0f8df7..b377d97cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -668,12 +668,11 @@ install(FILES ${gnucash_DOCS} DESTINATION ${CMAKE_INSTALL_DOCDIR})
 # Create config.h
 
 if (WIN32)
-if (MINGW)
-set (HAVE_SCANF_LLD 1)
-else ()
-set (HAVE_SCANF_I64D 1)
-endif()
-set (HAVE_HTMLHELPW 1)
+  if (MINGW)
+    set (HAVE_SCANF_LLD 1)
+  else ()
+    set (HAVE_SCANF_I64D 1)
+  endif()
 endif()
 
 check_include_files (dirent.h HAVE_DIRENT_H)
diff --git a/common/config.h.cmake.in b/common/config.h.cmake.in
index feb0a98f9..979f03572 100644
--- a/common/config.h.cmake.in
+++ b/common/config.h.cmake.in
@@ -117,9 +117,6 @@
 /* System has gnome-keyring 0.6 or better */
 #cmakedefine HAVE_GNOME_KEYRING 1
 
-/* System has HtmlHelpW */
-#cmakedefine HAVE_HTMLHELPW 1
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #cmakedefine HAVE_INTTYPES_H 1
 
diff --git a/libgnucash/app-utils/gnc-help-utils.c b/libgnucash/app-utils/gnc-help-utils.c
index ad5530b37..53e696751 100644
--- a/libgnucash/app-utils/gnc-help-utils.c
+++ b/libgnucash/app-utils/gnc-help-utils.c
@@ -24,15 +24,11 @@
 #include <config.h>
 #include <glib.h>
 
-#ifdef HAVE_HTMLHELPW
-#    include <windows.h>
-#    include <htmlhelp.h>
-#endif
+#include <windows.h>
+#include <htmlhelp.h>
 
 #include "gnc-help-utils.h"
 
-#ifdef HAVE_HTMLHELPW
-
 static GHashTable *
 parse_hhmap_file(const gchar *chmfile)
 {
@@ -137,24 +133,3 @@ gnc_show_htmlhelp(const gchar *chmfile, const gchar *anchor)
     HtmlHelpW(GetDesktopWindow(), wpath, HH_HELP_CONTEXT, id);
     g_free(wpath);
 }
-
-#else /* !HAVE_HTMLHELPW */
-void
-gnc_show_htmlhelp(const gchar *chmfile, const gchar *anchor)
-{
-    gchar *argv[3];
-
-    g_return_if_fail(chmfile);
-
-    argv[0] = "hh";
-    argv[1] = g_strdup(chmfile);
-    argv[2] = NULL;
-
-    if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH,
-                       NULL, NULL, NULL, NULL))
-        if (g_file_test(chmfile, G_FILE_TEST_IS_REGULAR))
-            g_warning("Found CHM help file, but could not spawn hh to open it");
-
-    g_free(argv[1]);
-}
-#endif /* HAVE_HTMLHELPW */



Summary of changes:
 CMakeLists.txt                        | 11 +++++------
 common/config.h.cmake.in              |  3 ---
 libgnucash/app-utils/gnc-help-utils.c | 29 ++---------------------------
 3 files changed, 7 insertions(+), 36 deletions(-)



More information about the gnucash-changes mailing list