|
@@ -260,18 +260,10 @@ index 61683d0eddb04c494ca5e650e7d556b44968ec49..5492456a9138b250e97a5479838bb443
|
|
|
|
|
|
} // namespace ui
|
|
|
diff --git a/ui/shell_dialogs/select_file_dialog_linux_kde.cc b/ui/shell_dialogs/select_file_dialog_linux_kde.cc
|
|
|
-index 64a79ebe2e2d21d5a6b4a98042d1cdb7b6edad52..400cce91b020ecd5e48566f125515d2cfe3ea6af 100644
|
|
|
+index 9d45ec49a4fb5e12407b65b83c1ba0c13cd0dfd8..400cce91b020ecd5e48566f125515d2cfe3ea6af 100644
|
|
|
--- a/ui/shell_dialogs/select_file_dialog_linux_kde.cc
|
|
|
+++ b/ui/shell_dialogs/select_file_dialog_linux_kde.cc
|
|
|
-@@ -8,6 +8,7 @@
|
|
|
- #include <string_view>
|
|
|
-
|
|
|
- #include "base/command_line.h"
|
|
|
-+#include "base/files/file_util.h"
|
|
|
- #include "base/functional/bind.h"
|
|
|
- #include "base/functional/callback_helpers.h"
|
|
|
- #include "base/logging.h"
|
|
|
-@@ -154,9 +155,20 @@ class SelectFileDialogLinuxKde : public SelectFileDialogLinux {
|
|
|
+@@ -155,9 +155,20 @@ class SelectFileDialogLinuxKde : public SelectFileDialogLinux {
|
|
|
void OnSelectMultiFileDialogResponse(
|
|
|
gfx::AcceleratedWidget parent,
|
|
|
std::unique_ptr<KDialogOutputParams> results);
|
|
@@ -292,27 +284,7 @@ index 64a79ebe2e2d21d5a6b4a98042d1cdb7b6edad52..400cce91b020ecd5e48566f125515d2c
|
|
|
|
|
|
// Should be either DESKTOP_ENVIRONMENT_KDE3, KDE4, KDE5, or KDE6.
|
|
|
base::nix::DesktopEnvironment desktop_;
|
|
|
-@@ -413,10 +425,16 @@ void SelectFileDialogLinuxKde::GetKDialogCommandLine(
|
|
|
- }
|
|
|
- command_line->AppendSwitch(type);
|
|
|
- // The path should never be empty. If it is, set it to PWD.
|
|
|
-- if (path.empty())
|
|
|
-- command_line->AppendArgPath(base::FilePath("."));
|
|
|
-- else
|
|
|
-+ auto pwd = base::FilePath(".");
|
|
|
-+ if (path.empty()) {
|
|
|
-+ command_line->AppendArgPath(pwd);
|
|
|
-+ } else if (path.IsAbsolute()) {
|
|
|
- command_line->AppendArgPath(path);
|
|
|
-+ } else {
|
|
|
-+ // KDialog won't set the default name in the Name field for relative paths.
|
|
|
-+ auto abs_path = base::MakeAbsoluteFilePathNoResolveSymbolicLinks(path);
|
|
|
-+ command_line->AppendArgPath(abs_path.value_or(pwd));
|
|
|
-+ }
|
|
|
- // Depending on the type of the operation we need, get the path to the
|
|
|
- // file/folder and set up mime type filters.
|
|
|
- if (file_operation)
|
|
|
-@@ -461,6 +479,7 @@ void SelectFileDialogLinuxKde::CreateSelectFolderDialog(
|
|
|
+@@ -468,6 +479,7 @@ void SelectFileDialogLinuxKde::CreateSelectFolderDialog(
|
|
|
int title_message_id = (type == SELECT_UPLOAD_FOLDER)
|
|
|
? IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE
|
|
|
: IDS_SELECT_FOLDER_DIALOG_TITLE;
|
|
@@ -320,7 +292,7 @@ index 64a79ebe2e2d21d5a6b4a98042d1cdb7b6edad52..400cce91b020ecd5e48566f125515d2c
|
|
|
pipe_task_runner_->PostTaskAndReplyWithResult(
|
|
|
FROM_HERE,
|
|
|
base::BindOnce(
|
|
|
-@@ -468,10 +487,12 @@ void SelectFileDialogLinuxKde::CreateSelectFolderDialog(
|
|
|
+@@ -475,10 +487,12 @@ void SelectFileDialogLinuxKde::CreateSelectFolderDialog(
|
|
|
KDialogParams(
|
|
|
"--getexistingdirectory", GetTitle(title, title_message_id),
|
|
|
default_path.empty() ? *last_opened_path() : default_path, parent,
|
|
@@ -336,7 +308,7 @@ index 64a79ebe2e2d21d5a6b4a98042d1cdb7b6edad52..400cce91b020ecd5e48566f125515d2c
|
|
|
}
|
|
|
|
|
|
void SelectFileDialogLinuxKde::CreateFileOpenDialog(
|
|
|
-@@ -561,7 +582,8 @@ void SelectFileDialogLinuxKde::OnSelectSingleFolderDialogResponse(
|
|
|
+@@ -568,7 +582,8 @@ void SelectFileDialogLinuxKde::OnSelectSingleFolderDialogResponse(
|
|
|
SelectSingleFileHelper(true, std::move(results));
|
|
|
}
|
|
|
|
|
@@ -346,7 +318,7 @@ index 64a79ebe2e2d21d5a6b4a98042d1cdb7b6edad52..400cce91b020ecd5e48566f125515d2c
|
|
|
gfx::AcceleratedWidget parent,
|
|
|
std::unique_ptr<KDialogOutputParams> results) {
|
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
|
-@@ -579,7 +601,7 @@ void SelectFileDialogLinuxKde::OnSelectMultiFileDialogResponse(
|
|
|
+@@ -586,7 +601,7 @@ void SelectFileDialogLinuxKde::OnSelectMultiFileDialogResponse(
|
|
|
base::SplitStringPiece(results->output, "\n", base::KEEP_WHITESPACE,
|
|
|
base::SPLIT_WANT_NONEMPTY)) {
|
|
|
base::FilePath path(line);
|
|
@@ -355,7 +327,7 @@ index 64a79ebe2e2d21d5a6b4a98042d1cdb7b6edad52..400cce91b020ecd5e48566f125515d2c
|
|
|
continue;
|
|
|
filenames_fp.push_back(path);
|
|
|
}
|
|
|
-@@ -591,4 +613,16 @@ void SelectFileDialogLinuxKde::OnSelectMultiFileDialogResponse(
|
|
|
+@@ -598,4 +613,16 @@ void SelectFileDialogLinuxKde::OnSelectMultiFileDialogResponse(
|
|
|
MultiFilesSelected(filenames_fp);
|
|
|
}
|
|
|
|