diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-12-07 12:57:39 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-12-07 12:57:49 +0100 |
| commit | 630517049f21d83dd6a4d63a0f6bbff55a05ac70 (patch) | |
| tree | 4cd7db99ebc173072911c18f999c04ea04bd180d /src/Fl_Native_File_Chooser_GTK.cxx | |
| parent | 663b93a8070db905e1e7741f9e6b1cea915f61c7 (diff) | |
Fix for issue #278 - continued
Because kdialog can't select multiple directories, run the GTK chooser
when BROWSE_MULTI_DIRECTORY is used.
Diffstat (limited to 'src/Fl_Native_File_Chooser_GTK.cxx')
| -rw-r--r-- | src/Fl_Native_File_Chooser_GTK.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_Native_File_Chooser_GTK.cxx b/src/Fl_Native_File_Chooser_GTK.cxx index 5c927d02e..fd9c5194f 100644 --- a/src/Fl_Native_File_Chooser_GTK.cxx +++ b/src/Fl_Native_File_Chooser_GTK.cxx @@ -914,14 +914,14 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) { platform_fnfc = NULL; if (Fl::option(Fl::OPTION_FNFC_USES_GTK)) { const char *desktop = getenv("XDG_CURRENT_DESKTOP"); - if (desktop && strcmp(desktop, "KDE") == 0) { + if (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"); if (pipe) { - char line[100] = ""; - fgets(line, sizeof(line), pipe); - if (strlen(line) > 0) Fl_Kdialog_Native_File_Chooser_Driver::did_find_kdialog = true; + char *p, line[100] = ""; + p = fgets(line, sizeof(line), pipe); + if (p && strlen(line) > 0) Fl_Kdialog_Native_File_Chooser_Driver::did_find_kdialog = true; pclose(pipe); } Fl_Kdialog_Native_File_Chooser_Driver::have_looked_for_kdialog = true; |
