summaryrefslogtreecommitdiff
path: root/Applications/FileManager
diff options
context:
space:
mode:
authorTill Mayer <till.mayer@web.de>2020-07-31 22:12:57 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-01 07:57:15 +0200
commit040848a2afd75d5a8378ab9f88b3a7003be7ca88 (patch)
tree96cf37c82ca876312910812a56249f27932d180c /Applications/FileManager
parent0f7bba327fe84616a2037a2e44e6b4fc2b5ab43f (diff)
downloadserenity-040848a2afd75d5a8378ab9f88b3a7003be7ca88.zip
FileManager: Build new path of renamed files correctly
Fixes #2932.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r--Applications/FileManager/PropertiesDialog.cpp3
-rw-r--r--Applications/FileManager/PropertiesDialog.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/Applications/FileManager/PropertiesDialog.cpp b/Applications/FileManager/PropertiesDialog.cpp
index 3ff5a22e04..f4aa7f9f04 100644
--- a/Applications/FileManager/PropertiesDialog.cpp
+++ b/Applications/FileManager/PropertiesDialog.cpp
@@ -75,6 +75,7 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
m_name = lexical_path.basename();
m_path = lexical_path.string();
+ m_parent_path = lexical_path.dirname();
m_name_box = file_container.add<GUI::TextBox>();
m_name_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
@@ -188,7 +189,7 @@ void PropertiesDialog::permission_changed(mode_t mask, bool set)
String PropertiesDialog::make_full_path(String name)
{
- return String::format("%s/%s", m_model.root_path().characters(), name.characters());
+ return String::format("%s/%s", m_parent_path.characters(), name.characters());
}
bool PropertiesDialog::apply_changes()
diff --git a/Applications/FileManager/PropertiesDialog.h b/Applications/FileManager/PropertiesDialog.h
index 89e84196ef..424dba58a8 100644
--- a/Applications/FileManager/PropertiesDialog.h
+++ b/Applications/FileManager/PropertiesDialog.h
@@ -89,6 +89,7 @@ private:
RefPtr<GUI::TextBox> m_name_box;
RefPtr<GUI::ImageWidget> m_icon;
String m_name;
+ String m_parent_path;
String m_path;
mode_t m_mode;
mode_t m_old_mode;