Skip to content
Snippets Groups Projects
Verified Commit 690852b5 authored by MagicD3VIL's avatar MagicD3VIL
Browse files

Fix FCHost compile error on Linux

The Linux version of FCHost was unable to compile after CEF commit https://bitbucket.org/chromiumembedded/cef/commits/2ea7459a89fbdce77ffa319cf9986a84fd041709 changed the RunFileDialog behaviour, which made FCHost incompatible on Linux with CEF >100.0.23.
parent 85a02e41
No related branches found
No related tags found
1 merge request!11661Fix FCHost compile error on Linux
......@@ -64,10 +64,6 @@ namespace {
}
#endif
// kdialog does not support these
mode = static_cast<CefDialogHandler::FileDialogMode>(mode & ~(CefDialogHandler::FileDialogMode::FILE_DIALOG_OVERWRITEPROMPT_FLAG));
mode = static_cast<CefDialogHandler::FileDialogMode>(mode & ~(CefDialogHandler::FileDialogMode::FILE_DIALOG_HIDEREADONLY_FLAG));
switch (mode) {
case CefDialogHandler::FileDialogMode::FILE_DIALOG_OPEN_MULTIPLE:
cmdLine << " --multiple"; [[fallthrough]];
......@@ -108,15 +104,7 @@ namespace {
const std::vector<CefString>& accept_filters)
{
std::ostringstream cmdLine;
cmdLine << "zenity --file-selection";
// zenity does not support these
mode = static_cast<CefDialogHandler::FileDialogMode>(mode & ~(CefDialogHandler::FileDialogMode::FILE_DIALOG_HIDEREADONLY_FLAG));
if (mode & CefDialogHandler::FileDialogMode::FILE_DIALOG_OVERWRITEPROMPT_FLAG) {
cmdLine << " --confirm-overwrite";
}
mode = static_cast<CefDialogHandler::FileDialogMode>(mode & ~(CefDialogHandler::FileDialogMode::FILE_DIALOG_OVERWRITEPROMPT_FLAG));
cmdLine << "zenity --file-selection --confirm-overwrite";
switch (mode) {
case CefDialogHandler::FileDialogMode::FILE_DIALOG_OPEN_MULTIPLE:
......@@ -247,7 +235,7 @@ void FCHostHandler::PlatformTitleChange(CefRefPtr<CefBrowser> browser, const Cef
bool FCHostHandler::OnFileDialog(CefRefPtr<CefBrowser> /* browser */, CefDialogHandler::FileDialogMode mode,
const CefString& title, const CefString& default_file_path, const std::vector<CefString>& accept_filters,
int /* selected_accept_filter */, CefRefPtr<CefFileDialogCallback> callback)
CefRefPtr<CefFileDialogCallback> callback)
{
static DialogHelper helper;
......@@ -262,6 +250,6 @@ bool FCHostHandler::OnFileDialog(CefRefPtr<CefBrowser> /* browser */, CefDialogH
std::vector<CefString> selected;
selected.push_back(fn);
callback->Continue(0, selected);
callback->Continue(selected);
return true;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment