|
@@ -10,8 +10,8 @@
|
|
|
|
|
|
#include "MainWidget.h"
|
|
#include "MainWidget.h"
|
|
#include <LibCore/ArgsParser.h>
|
|
#include <LibCore/ArgsParser.h>
|
|
-#include <LibCore/DeprecatedFile.h>
|
|
|
|
#include <LibCore/System.h>
|
|
#include <LibCore/System.h>
|
|
|
|
+#include <LibFileSystem/FileSystem.h>
|
|
#include <LibFileSystemAccessClient/Client.h>
|
|
#include <LibFileSystemAccessClient/Client.h>
|
|
#include <LibGUI/Application.h>
|
|
#include <LibGUI/Application.h>
|
|
#include <LibGUI/Icon.h>
|
|
#include <LibGUI/Icon.h>
|
|
@@ -33,10 +33,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|
parser.add_positional_argument(file_to_edit, "Theme file to edit", "file", Core::ArgsParser::Required::No);
|
|
parser.add_positional_argument(file_to_edit, "Theme file to edit", "file", Core::ArgsParser::Required::No);
|
|
parser.parse(arguments);
|
|
parser.parse(arguments);
|
|
|
|
|
|
- Optional<DeprecatedString> path = {};
|
|
|
|
|
|
+ Optional<String> path = {};
|
|
|
|
|
|
- if (!file_to_edit.is_empty())
|
|
|
|
- path = Core::DeprecatedFile::absolute_path(file_to_edit);
|
|
|
|
|
|
+ if (auto error_or_path = FileSystem::absolute_path(file_to_edit); !file_to_edit.is_empty() && !error_or_path.is_error())
|
|
|
|
+ path = error_or_path.release_value();
|
|
|
|
|
|
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix"));
|
|
TRY(Core::System::pledge("stdio recvfd sendfd thread rpath unix"));
|
|
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
|
|
TRY(Core::System::unveil("/tmp/session/%sid/portal/filesystemaccess", "rw"));
|
|
@@ -52,7 +52,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|
// Note: This is deferred to ensure that the window has already popped and thus proper window stealing can be performed.
|
|
// Note: This is deferred to ensure that the window has already popped and thus proper window stealing can be performed.
|
|
app->event_loop().deferred_invoke(
|
|
app->event_loop().deferred_invoke(
|
|
[&window, &path, &main_widget]() {
|
|
[&window, &path, &main_widget]() {
|
|
- auto response = FileSystemAccessClient::Client::the().request_file_read_only_approved(window, path.value());
|
|
|
|
|
|
+ auto response = FileSystemAccessClient::Client::the().request_file_read_only_approved(window, path.value().to_deprecated_string());
|
|
if (response.is_error())
|
|
if (response.is_error())
|
|
GUI::MessageBox::show_error(window, DeprecatedString::formatted("Opening \"{}\" failed: {}", path.value(), response.error()));
|
|
GUI::MessageBox::show_error(window, DeprecatedString::formatted("Opening \"{}\" failed: {}", path.value(), response.error()));
|
|
else {
|
|
else {
|