Skip to content

Commit d41a334

Browse files
committed
Fixed FileDialog showed '.' on Linux
1 parent 56a9740 commit d41a334

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Sources/OvWindowing/src/OvWindowing/Dialogs/FileDialog.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ void OvWindowing::Dialogs::FileDialog::Show(EExplorerFlags p_flags)
8080
if (m_isSaveDialog)
8181
command += " --save";
8282

83-
if (!m_initialDirectory.empty() || !m_initialFilename.empty())
83+
if (!m_initialFilename.empty())
8484
{
85-
command += " --filename=\"" + (std::filesystem::path{ m_initialDirectory } / m_initialFilename).string();
86-
if (m_initialFilename.empty() && m_initialDirectory.back() != '/')
87-
command += "/";
88-
command += "\"";
85+
command += " --filename=\"" + (std::filesystem::path{ m_initialDirectory } / m_initialFilename).string() + "\"";
8986
}
90-
else
87+
else if (!m_initialDirectory.empty())
9188
{
92-
// Even without initial directory, --filename="" helps show the filename entry
93-
command += " --filename=\"\"";
89+
// Add trailing slash to indicate directory for zenity
90+
command += " --filename=\"" + m_initialDirectory;
91+
if (m_initialDirectory.back() != '/')
92+
command += "/";
93+
command += "\"";
9494
}
9595

9696
// Add file filters if present

0 commit comments

Comments
 (0)