summaryrefslogtreecommitdiff
path: root/src/Fl_Native_File_Chooser_GTK.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-08 09:40:57 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2021-12-08 09:41:06 +0100
commit4bc25f7f9df2872189d57c21f1fa937d83b71536 (patch)
tree1e244c3edebfccf478ec8c01f65c2dcfcb4c533f /src/Fl_Native_File_Chooser_GTK.cxx
parent630517049f21d83dd6a4d63a0f6bbff55a05ac70 (diff)
Fix for issue #278 - continued : add CMake OPTION_USE_KDIALOG
Use of the kdialog command by class Fl_Naive_File_Chooser can now be turned off at build-time through CMake OPTION_USE_KDIALOG. If building via configure + make, set #define USE_KDIALOG to 0 in config.h before make.
Diffstat (limited to 'src/Fl_Native_File_Chooser_GTK.cxx')
-rw-r--r--src/Fl_Native_File_Chooser_GTK.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Fl_Native_File_Chooser_GTK.cxx b/src/Fl_Native_File_Chooser_GTK.cxx
index fd9c5194f..a161da77d 100644
--- a/src/Fl_Native_File_Chooser_GTK.cxx
+++ b/src/Fl_Native_File_Chooser_GTK.cxx
@@ -17,7 +17,9 @@
#include <config.h>
#include <FL/Fl_Native_File_Chooser.H>
-#include "Fl_Native_File_Chooser_Kdialog.H"
+#if USE_KDIALOG
+# include "Fl_Native_File_Chooser_Kdialog.H"
+#endif
#if HAVE_DLSYM && HAVE_DLFCN_H
#include <FL/platform.H>
@@ -913,6 +915,7 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
// otherwise, use FLTK file chooser.
platform_fnfc = NULL;
if (Fl::option(Fl::OPTION_FNFC_USES_GTK)) {
+#if USE_KDIALOG
const char *desktop = getenv("XDG_CURRENT_DESKTOP");
if (desktop && strcmp(desktop, "KDE") == 0 && val != BROWSE_MULTI_DIRECTORY) {
if (!Fl_Kdialog_Native_File_Chooser_Driver::have_looked_for_kdialog) {
@@ -929,6 +932,7 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
// if we found kdialog, we will use the Fl_Kdialog_Native_File_Chooser_Driver
if (Fl_Kdialog_Native_File_Chooser_Driver::did_find_kdialog) platform_fnfc = new Fl_Kdialog_Native_File_Chooser_Driver(val);
}
+#endif // USE_KDIALOG
#if HAVE_DLSYM && HAVE_DLFCN_H
if (!platform_fnfc) {
if ( Fl_GTK_Native_File_Chooser_Driver::have_looked_for_GTK_libs == 0) {