Age | Commit message (Collapse) | Author |
|
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.
This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.
From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
|
|
|
|
|
|
|
|
Previously, the incorrect action would be invoked when using the Open
in File Manager keyboard shortcut, while a directory was selected.
|
|
As usual, this removes many unused includes and moves used includes
further down the chain.
|
|
Also "Open Folder" => "Open in File Manager".
|
|
|
|
This action is basically equivalent to "Refresh", so let's use the
common shortcut for that.
|
|
Also, the Tree object was only ever used by the TreeMapWidget, so its
creation can happen inside `analyze()`, fixing the memory leak issue.
Plus, it doesn't have to be RefCounted.
|
|
|
|
|
|
Having an alias function that only wraps another one is silly, and
keeping the more obvious name should flush out more uses of deprecated
strings.
No behavior change.
|
|
|
|
Those don't have any non-try counterpart, so we might as well just omit
it.
|
|
|
|
This is a preparatory step to making `get()` return `ErrorOr`.
|
|
Clicking analyze or deleting a file would always cause the tree view in
the widget to reset back to viewing the root. This was changed to stay
in the directory currently being viewed
|
|
Made the member fields of Tree and TreeNode structures private and moved
the functions in main.cpp that accessed the internals of these
structures inside the TreeNode class
|
|
The TreeMapNode and TreeMap structs inside TreeMapWidget.h both had
single implementers, TreeNode and Tree inside main.cpp. The indirection
was removed and the new structures were moved to their own file
|
|
It's the only one, so the `try` prefix is unnecessary now.
|
|
MOAR FIXMES! ;^)
|
|
Rip that bandaid off!
This does the following, in one big, awkward jump:
- Replace all uses of `set_main_widget<Foo>()` with the `try` version.
- Remove `set_main_widget<Foo>()`.
- Rename the `try` version to just be `set_main_widget` because it's now
the only one.
The majority of places that call `set_main_widget<Foo>()` are inside
constructors, so this unfortunately gives us a big batch of new
`release_value_but_fixme_should_propagate_errors()` calls.
|
|
About half of the usages were not using `force` anyways, and the other
half presumably just got confused about what "force" really means in
this context (which is "ignore nonexistent files").
The only 'legitimate' user, which is `rm`, instead now handles this
completely internally instead.
|
|
Having the file path in there is nice, but it makes us incompatible with
comfortable error propagation in everything that isn't File::remove.
|
|
This generally seems like a better name, especially if we somehow also
need a better name for "read the entire buffer, but not the entire file"
somewhere down the line.
|
|
Instead of having two separate context menus and popping up either the
"file" or "directory" one depending on the selected node, we now have a
single context menu and update it (before popping it up) to show the
context-appropriate actions.
This is achieved by simply updating the visibility of the actions.
This takes care of one TODO! :^)
|
|
|
|
These include a JSON parse error, file open errors, and vector appends.
These fix a bunch of calls to functions with `fixme` in them.
|
|
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.
One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
|
|
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
|
|
|
|
|
|
URL had properly named replacements for protocol(), set_protocol() and
create_with_file_protocol() already. This patch removes these function
and updates all call sites to use the functions named according to the
specification.
See https://url.spec.whatwg.org/#concept-url-scheme
|
|
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).
No functional changes.
|
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
This commit moves the length calculations out to be directly on the
StringView users. This is an important step towards the goal of removing
StringView(char const*), as it moves the responsibility of calculating
the size of the string to the user of the StringView (which will prevent
naive uses causing OOB access).
|
|
|
|
|
|
|
|
Previously, SpaceAnalyzer set focus on the selected BreadcrumbButton.
Using arrow keys triggered the keydown_event of the AbstractButton,
which later on caused a Function object to be deleted while it is still
being used.
This change sets the focus on TreeMapWidget and adds an event handler
to TreeMapWidget for keydown events.
Fixes #13254.
|
|
Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.
|
|
|
|
This option is already enabled when building Lagom, so let's enable it
for the main build too. We will no longer be surprised by Lagom Clang
CI builds failing while everything compiles locally.
Furthermore, the stronger `-Wsuggest-override` warning is enabled in
this commit, which enforces the use of the `override` keyword in all
classes, not just those which already have some methods marked as
`override`. This works with both GCC and Clang.
|
|
Also add slightly richer parse errors now that we can include a string
literal with returned errors.
This will allow us to use TRY() when working with JSON data.
|
|
This function returns a subclass of Error, which is now possible.
|
|
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
|
|
|
|
Prior this patch, you couldn't remove any files from the context menu
if you didn't have write access to them.
It was incorrect, as the write permission for files means that you can
modify the contents of the file, where for directories it means that
you can create, rename, and remove the files there.
|
|
|