Selaa lähdekoodia

FileSystemAccessServer: Prefer LibFileSystem over DeprecatedFile

Ben Wiederhake 2 vuotta sitten
vanhempi
commit
fecaf27b3a

+ 1 - 1
Userland/Services/FileSystemAccessServer/CMakeLists.txt

@@ -18,5 +18,5 @@ set(GENERATED_SOURCES
 )
 
 serenity_bin(FileSystemAccessServer)
-target_link_libraries(FileSystemAccessServer PRIVATE LibCore LibIPC LibGfx LibGUI LibMain)
+target_link_libraries(FileSystemAccessServer PRIVATE LibCore LibFileSystem LibGfx LibGUI LibIPC LibMain)
 add_dependencies(FileSystemAccessServer WindowServer)

+ 3 - 3
Userland/Services/FileSystemAccessServer/ConnectionFromClient.cpp

@@ -5,7 +5,7 @@
  */
 
 #include <FileSystemAccessServer/ConnectionFromClient.h>
-#include <LibCore/DeprecatedFile.h>
+#include <LibFileSystem/FileSystem.h>
 #include <LibGUI/Application.h>
 #include <LibGUI/ConnectionToWindowServer.h>
 #include <LibGUI/FilePicker.h>
@@ -52,10 +52,10 @@ void ConnectionFromClient::request_file_handler(i32 request_id, i32 window_serve
 
         auto pid = this->socket().peer_pid().release_value_but_fixme_should_propagate_errors();
         auto exe_link = LexicalPath("/proc").append(DeprecatedString::number(pid)).append("exe"sv).string();
-        auto exe_path = Core::DeprecatedFile::real_path_for(exe_link);
+        auto exe_path = FileSystem::real_path(exe_link).release_value_but_fixme_should_propagate_errors();
 
         if (prompt == ShouldPrompt::Yes) {
-            auto exe_name = LexicalPath::basename(exe_path);
+            auto exe_name = LexicalPath::basename(exe_path.to_deprecated_string());
             auto text = String::formatted("Allow {} ({}) to {} \"{}\"?", exe_name, pid, access_string, path).release_value_but_fixme_should_propagate_errors();
             auto result = GUI::MessageBox::try_show({}, window_server_client_id, parent_window_id, text, "File Permissions Requested"sv).release_value_but_fixme_should_propagate_errors();
             approved = result == GUI::MessageBox::ExecResult::Yes;