mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:07:46 +00:00
FileManager: Rename FileOperation::Cut to FileOperation::Move
This commit is contained in:
parent
5090b1bdba
commit
dd833dc220
4 changed files with 9 additions and 9 deletions
|
@ -49,7 +49,7 @@ FileOperationProgressWidget::FileOperationProgressWidget(FileOperation operation
|
||||||
files_copied_label.set_text("Copying files...");
|
files_copied_label.set_text("Copying files...");
|
||||||
current_file_action_label.set_text("Copying: ");
|
current_file_action_label.set_text("Copying: ");
|
||||||
break;
|
break;
|
||||||
case FileOperation::Cut:
|
case FileOperation::Move:
|
||||||
files_copied_label.set_text("Moving files...");
|
files_copied_label.set_text("Moving files...");
|
||||||
current_file_action_label.set_text("Moving: ");
|
current_file_action_label.set_text("Moving: ");
|
||||||
break;
|
break;
|
||||||
|
@ -165,7 +165,7 @@ void FileOperationProgressWidget::did_progress(off_t bytes_done, off_t total_byt
|
||||||
case FileOperation::Copy:
|
case FileOperation::Copy:
|
||||||
files_copied_label.set_text(String::formatted("Copying file {} of {}", files_done, total_file_count));
|
files_copied_label.set_text(String::formatted("Copying file {} of {}", files_done, total_file_count));
|
||||||
break;
|
break;
|
||||||
case FileOperation::Cut:
|
case FileOperation::Move:
|
||||||
files_copied_label.set_text(String::formatted("Moving file {} of {}", files_done, total_file_count));
|
files_copied_label.set_text(String::formatted("Moving file {} of {}", files_done, total_file_count));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -102,7 +102,7 @@ void run_file_operation(FileOperation operation, Vector<String> const& sources,
|
||||||
case FileOperation::Copy:
|
case FileOperation::Copy:
|
||||||
file_operation_args.append("Copy");
|
file_operation_args.append("Copy");
|
||||||
break;
|
break;
|
||||||
case FileOperation::Cut:
|
case FileOperation::Move:
|
||||||
file_operation_args.append("Move");
|
file_operation_args.append("Move");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -137,7 +137,7 @@ void run_file_operation(FileOperation operation, Vector<String> const& sources,
|
||||||
case FileOperation::Copy:
|
case FileOperation::Copy:
|
||||||
window->set_title("Copying Files...");
|
window->set_title("Copying Files...");
|
||||||
break;
|
break;
|
||||||
case FileOperation::Cut:
|
case FileOperation::Move:
|
||||||
window->set_title("Moving Files...");
|
window->set_title("Moving Files...");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace FileManager {
|
||||||
|
|
||||||
enum class FileOperation {
|
enum class FileOperation {
|
||||||
Copy = 0,
|
Copy = 0,
|
||||||
Cut
|
Move
|
||||||
};
|
};
|
||||||
|
|
||||||
void delete_path(String const&, GUI::Window*);
|
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();
|
VERIFY_NOT_REACHED();
|
||||||
|
|
||||||
StringBuilder copy_text;
|
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
|
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) {
|
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;
|
FileOperation file_operation = FileOperation::Copy;
|
||||||
if (copied_lines[0] == "#cut") { // cut operation encoded as a text/uri-list comment
|
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);
|
copied_lines.remove(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ int run_in_desktop_mode([[maybe_unused]] RefPtr<Core::ConfigFile> config)
|
||||||
if (paths.is_empty())
|
if (paths.is_empty())
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
|
|
||||||
do_copy(paths, FileOperation::Cut);
|
do_copy(paths, FileOperation::Move);
|
||||||
},
|
},
|
||||||
window);
|
window);
|
||||||
cut_action->set_enabled(false);
|
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())
|
if (paths.is_empty())
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
|
|
||||||
do_copy(paths, FileOperation::Cut);
|
do_copy(paths, FileOperation::Move);
|
||||||
refresh_tree_view();
|
refresh_tree_view();
|
||||||
},
|
},
|
||||||
window);
|
window);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue