FileManager: Rename FileOperation::Cut to FileOperation::Move
This commit is contained in:
parent
5090b1bdba
commit
dd833dc220
Notes:
sideshowbarker
2024-07-18 08:34:25 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/dd833dc220c Pull-request: https://github.com/SerenityOS/serenity/pull/8117 Reviewed-by: https://github.com/MaxWipfli ✅
4 changed files with 9 additions and 9 deletions
|
@ -49,7 +49,7 @@ FileOperationProgressWidget::FileOperationProgressWidget(FileOperation operation
|
|||
files_copied_label.set_text("Copying files...");
|
||||
current_file_action_label.set_text("Copying: ");
|
||||
break;
|
||||
case FileOperation::Cut:
|
||||
case FileOperation::Move:
|
||||
files_copied_label.set_text("Moving files...");
|
||||
current_file_action_label.set_text("Moving: ");
|
||||
break;
|
||||
|
@ -165,7 +165,7 @@ void FileOperationProgressWidget::did_progress(off_t bytes_done, off_t total_byt
|
|||
case FileOperation::Copy:
|
||||
files_copied_label.set_text(String::formatted("Copying file {} of {}", files_done, total_file_count));
|
||||
break;
|
||||
case FileOperation::Cut:
|
||||
case FileOperation::Move:
|
||||
files_copied_label.set_text(String::formatted("Moving file {} of {}", files_done, total_file_count));
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -102,7 +102,7 @@ void run_file_operation(FileOperation operation, Vector<String> const& sources,
|
|||
case FileOperation::Copy:
|
||||
file_operation_args.append("Copy");
|
||||
break;
|
||||
case FileOperation::Cut:
|
||||
case FileOperation::Move:
|
||||
file_operation_args.append("Move");
|
||||
break;
|
||||
default:
|
||||
|
@ -137,7 +137,7 @@ void run_file_operation(FileOperation operation, Vector<String> const& sources,
|
|||
case FileOperation::Copy:
|
||||
window->set_title("Copying Files...");
|
||||
break;
|
||||
case FileOperation::Cut:
|
||||
case FileOperation::Move:
|
||||
window->set_title("Moving Files...");
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace FileManager {
|
|||
|
||||
enum class FileOperation {
|
||||
Copy = 0,
|
||||
Cut
|
||||
Move
|
||||
};
|
||||
|
||||
void delete_path(String const&, GUI::Window*);
|
||||
|
|
|
@ -137,7 +137,7 @@ void do_copy(Vector<String> const& selected_file_paths, FileOperation file_opera
|
|||
VERIFY_NOT_REACHED();
|
||||
|
||||
StringBuilder copy_text;
|
||||
if (file_operation == FileOperation::Cut) {
|
||||
if (file_operation == FileOperation::Move) {
|
||||
copy_text.append("#cut\n"); // This exploits the comment lines in the text/uri-list specification, which might be a bit hackish
|
||||
}
|
||||
for (auto& path : selected_file_paths) {
|
||||
|
@ -162,7 +162,7 @@ void do_paste(String const& target_directory, GUI::Window* window)
|
|||
|
||||
FileOperation file_operation = FileOperation::Copy;
|
||||
if (copied_lines[0] == "#cut") { // cut operation encoded as a text/uri-list comment
|
||||
file_operation = FileOperation::Cut;
|
||||
file_operation = FileOperation::Move;
|
||||
copied_lines.remove(0);
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ int run_in_desktop_mode([[maybe_unused]] RefPtr<Core::ConfigFile> config)
|
|||
if (paths.is_empty())
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
do_copy(paths, FileOperation::Cut);
|
||||
do_copy(paths, FileOperation::Move);
|
||||
},
|
||||
window);
|
||||
cut_action->set_enabled(false);
|
||||
|
@ -662,7 +662,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
|||
if (paths.is_empty())
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
do_copy(paths, FileOperation::Cut);
|
||||
do_copy(paths, FileOperation::Move);
|
||||
refresh_tree_view();
|
||||
},
|
||||
window);
|
||||
|
|
Loading…
Add table
Reference in a new issue