summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Tolly <miketolly@gmail.com>2022-05-04 21:48:12 -0500
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-06-29 18:49:51 +0200
commit65e5cd27cc80e63252cf78fefddb5b37c5c7619c (patch)
tree337256b41740f9fff56338a5396cc93863b4db3b /src
parent47f0d63f194d6fe3a164061e2fe70b1057575168 (diff)
kdialog native picker: properly handle spaces in filenames
Asks kdialog to use newlines for multiple files instead
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Native_File_Chooser_Kdialog.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_Native_File_Chooser_Kdialog.cxx b/src/Fl_Native_File_Chooser_Kdialog.cxx
index 5955659d6..820a6cbd8 100644
--- a/src/Fl_Native_File_Chooser_Kdialog.cxx
+++ b/src/Fl_Native_File_Chooser_Kdialog.cxx
@@ -102,7 +102,7 @@ int Fl_Kdialog_Native_File_Chooser_Driver::show() {
break;
case Fl_Native_File_Chooser::BROWSE_MULTI_FILE:
- option = "--multiple --getopenfilename";
+ option = "--multiple --getopenfilename --separate-output";
break;
default:
@@ -145,15 +145,15 @@ int Fl_Kdialog_Native_File_Chooser_Driver::show() {
delete[] _pathnames;
char *p = data.all_files;
int count = 1;
- while ((p = strchr(p+1, ' '))) count++;
+ while ((p = strchr(p+1, '\n'))) count++;
_pathnames = new char*[count];
_tpathnames = 0;
- char *q = strtok(data.all_files, " ");
+ char *q = strtok(data.all_files, "\n");
while (q) {
_pathnames[_tpathnames] = new char[strlen(q)+1];
strcpy(_pathnames[_tpathnames], q);
_tpathnames++;
- q = strtok(NULL, " ");
+ q = strtok(NULL, "\n");
}
}
}