[balsa] Use a wrapper for checking an environment variable



commit 92f30b914532598abcaa2ffc6c92fdc9a08d8c77
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Jun 13 00:02:59 2017 -0400

    Use a wrapper for checking an environment variable
    
        * src/filter-run-dialog.c (balsa_filter_run_dialog_new): use
          libbalsa_dialog_flags() instead of directly checking the
          BALSA_DIALOG_HEADERBAR environment variable.

 ChangeLog               |    8 ++++++++
 src/filter-run-dialog.c |   13 +++----------
 2 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c22412f..7efa87a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-06-12  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Use a wrapper for an environment variable
+
+       * src/filter-run-dialog.c (balsa_filter_run_dialog_new): use
+         libbalsa_dialog_flags() instead of directly checking the
+         BALSA_DIALOG_HEADERBAR environment variable.
+
 2017-06-01  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Remove obsolete reference in configure summary
diff --git a/src/filter-run-dialog.c b/src/filter-run-dialog.c
index e9e7c99..4b17b0b 100644
--- a/src/filter-run-dialog.c
+++ b/src/filter-run-dialog.c
@@ -179,18 +179,11 @@ balsa_filter_run_dialog_new(LibBalsaMailbox * mbox, GtkWindow * parent)
 {
     BalsaFilterRunDialog *p;
     gchar * dialog_title;
-    gboolean use_headerbar = TRUE;
-#if GTK_CHECK_VERSION(3, 12, 0)
-       const gchar *dialog_env;
-
-    /* header bar configuration */
-       dialog_env = g_getenv("BALSA_DIALOG_HEADERBAR");
-       if ((dialog_env != NULL) && (atoi(dialog_env) == 0)) {
-               use_headerbar = FALSE;
-       }
-#endif
+    gboolean use_headerbar;
 
     g_return_val_if_fail(mbox, NULL);
+
+    use_headerbar = (libbalsa_dialog_flags() & GTK_DIALOG_USE_HEADER_BAR) != 0;
     p = g_object_new(BALSA_TYPE_FILTER_RUN_DIALOG,
                      "transient-for", parent,
                      "use-header-bar", use_headerbar,


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