diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-12-08 09:40:57 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-12-08 09:41:06 +0100 |
| commit | 4bc25f7f9df2872189d57c21f1fa937d83b71536 (patch) | |
| tree | 1e244c3edebfccf478ec8c01f65c2dcfcb4c533f /src | |
| parent | 630517049f21d83dd6a4d63a0f6bbff55a05ac70 (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')
| -rw-r--r-- | src/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/Fl_Native_File_Chooser_GTK.cxx | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 507b106ec..dceb15d0d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -213,9 +213,13 @@ if (USE_X11) fl_dnd_x.cxx Fl_Native_File_Chooser_FLTK.cxx Fl_Native_File_Chooser_GTK.cxx - Fl_Native_File_Chooser_Kdialog.cxx Fl_get_key.cxx ) + + if (OPTION_USE_KDIALOG) + set (DRIVER_FILES ${DRIVER_FILES} Fl_Native_File_Chooser_Kdialog.cxx) + endif (OPTION_USE_KDIALOG) + if (USE_XFT) set (DRIVER_FILES ${DRIVER_FILES} drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx 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) { |
