From 8cb450e916b15f50599d14ee36b707a2703423f5 Mon Sep 17 00:00:00 2001 From: saturneric Date: Wed, 24 Jan 2024 17:52:51 +0800 Subject: fix: try to solve bugs at universal file operations --- src/ui/widgets/FileTreeView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/widgets/FileTreeView.cpp') diff --git a/src/ui/widgets/FileTreeView.cpp b/src/ui/widgets/FileTreeView.cpp index 91536cdf..b0241b63 100644 --- a/src/ui/widgets/FileTreeView.cpp +++ b/src/ui/widgets/FileTreeView.cpp @@ -271,7 +271,7 @@ void FileTreeView::SlotRenameSelectedItem() { auto file_info = QFileInfo(selected_path_); auto new_name_path = file_info.absolutePath() + "/" + text; GF_UI_LOG_DEBUG("new filename path: {}", new_name_path); - if (QDir().rename(file_info.absoluteFilePath(), new_name_path)) { + if (!QDir().rename(file_info.absoluteFilePath(), new_name_path)) { QMessageBox::critical(this, tr("Error"), tr("Unable to rename the file or folder.")); return; -- cgit v1.2.3