diff options
Diffstat (limited to 'src/Fl_Native_File_Chooser_GTK.cxx')
| -rw-r--r-- | src/Fl_Native_File_Chooser_GTK.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Fl_Native_File_Chooser_GTK.cxx b/src/Fl_Native_File_Chooser_GTK.cxx index 28363aeda..263acfad7 100644 --- a/src/Fl_Native_File_Chooser_GTK.cxx +++ b/src/Fl_Native_File_Chooser_GTK.cxx @@ -17,10 +17,8 @@ #include <config.h> #include <FL/Fl_Native_File_Chooser.H> -#if USE_KDIALOG -# include "Fl_Native_File_Chooser_Zenity.H" -# include "Fl_Native_File_Chooser_Kdialog.H" -#endif +#include "Fl_Native_File_Chooser_Zenity.H" +#include "Fl_Native_File_Chooser_Kdialog.H" #if HAVE_DLSYM && HAVE_DLFCN_H #include <FL/platform.H> @@ -931,8 +929,6 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { // otherwise, use FLTK file chooser. platform_fnfc = NULL; fl_open_display(); - if (Fl::option(Fl::OPTION_FNFC_USES_GTK)) { -#if USE_KDIALOG if (Fl::option(Fl::OPTION_FNFC_USES_ZENITY)&& val != BROWSE_MULTI_DIRECTORY) { if (!Fl_Zenity_Native_File_Chooser_Driver::have_looked_for_zenity) { // First Time here, try to find zenity @@ -949,7 +945,8 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { if (Fl_Zenity_Native_File_Chooser_Driver::did_find_zenity) platform_fnfc = new Fl_Zenity_Native_File_Chooser_Driver(val); } const char *desktop = getenv("XDG_CURRENT_DESKTOP"); - if (!platform_fnfc && desktop && strcmp(desktop, "KDE") == 0 && val != BROWSE_MULTI_DIRECTORY) { + if (!platform_fnfc && Fl::option(Fl::OPTION_FNFC_USES_KDIALOG) && desktop && + strcmp(desktop, "KDE") == 0 && val != BROWSE_MULTI_DIRECTORY) { if (!Fl_Kdialog_Native_File_Chooser_Driver::have_looked_for_kdialog) { // First Time here, try to find kdialog FILE *pipe = popen("kdialog -v 2> /dev/null", "r"); @@ -964,9 +961,9 @@ 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 (!platform_fnfc) { + if (Fl::option(Fl::OPTION_FNFC_USES_GTK)) { if ( Fl_GTK_Native_File_Chooser_Driver::have_looked_for_GTK_libs == 0) { // First Time here, try to find the GTK libs if they are installed Fl_GTK_Native_File_Chooser_Driver::probe_for_GTK_libs(); @@ -975,7 +972,8 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { // if we found all the GTK functions we need, we will use the GtkFileChooserDialog if (Fl_GTK_Native_File_Chooser_Driver::did_find_GTK_libs) platform_fnfc = new Fl_GTK_Native_File_Chooser_Driver(val); } -#endif // HAVE_DLSYM && HAVE_DLFCN_H } +#endif // HAVE_DLSYM && HAVE_DLFCN_H + if (!platform_fnfc) platform_fnfc = new Fl_Native_File_Chooser_FLTK_Driver(val); } |
