Skip to content

Commit 92bfb86

Browse files
Fix zenity invocation for KDE (AcademySoftwareFoundation#2517)
The KDE file open dialog hangs because of the trailing space.
1 parent f321c98 commit 92bfb86

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

source/MaterialXGraphEditor/FileDialog.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,12 @@ mx::StringVec launchFileDialog(const std::vector<std::pair<std::string, std::str
199199
if (save)
200200
cmd += "--save ";
201201
cmd += "--file-filter=\"";
202-
for (auto pair : filetypes)
203-
cmd += "\"*." + pair.first + "\" ";
202+
for (size_t i = 0, n = filetypes.size(); i < n; ++i)
203+
{
204+
cmd += "\"*." + filetypes[i].first + "\"";
205+
if (i+1 < n)
206+
cmd += " ";
207+
}
204208
cmd += "\"";
205209
FILE* output = popen(cmd.c_str(), "r");
206210
if (output == nullptr)

0 commit comments

Comments
 (0)