summaryrefslogtreecommitdiff
path: root/Userland/Applications/SpaceAnalyzer/main.cpp
AgeCommit message (Collapse)Author
2023-05-05LibGUI: Make `Application`'s construction fallibleLucas CHOLLET
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.
2023-04-19LibGUI+Userland: Make Window::*add_menu take name using new stringKarol Kosek
2023-03-24Applications: Convert `DeprecatedFile` usages to `LibFileSystem`Cameron Youell
2023-03-21Everywhere: Use `LibFileSystem` where trivialCameron Youell
2023-03-16SpaceAnalyzer: Make "Open in File Manager" shortcut behave correctlyTim Ledbetter
Previously, the incorrect action would be invoked when using the Open in File Manager keyboard shortcut, while a directory was selected.
2023-02-13LibCore: Rename `File` to `DeprecatedFile`Tim Schumacher
As usual, this removes many unused includes and moves used includes further down the chain.
2023-02-07SpaceAnalyzer: "Open Containing Folder" => "Reveal in File Manager"Andreas Kling
Also "Open Folder" => "Open in File Manager".
2023-02-04SpaceAnalyzer: Rename widget variables to match code styleSam Atkins
2023-02-04SpaceAnalyzer: Give the Analyze action an icon and F5 shortcutSam Atkins
This action is basically equivalent to "Refresh", so let's use the common shortcut for that.
2023-02-04SpaceAnalyzer: Make TreeMapWidget responsible for filesystem analysisSam Atkins
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.
2023-02-04SpaceAnalyzer: Propagate more errorsSam Atkins
2023-02-04SpaceAnalyzer: Extract ProgressWindow into its own classSam Atkins
2023-01-27AK: Remove StringBuilder::build() in favor of to_deprecated_string()Linus Groh
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.
2023-01-27SpaceAnalyzer: Replace uses of JsonObject::get_deprecated()/get_ptr()Sam Atkins
2023-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2023-01-24FileManager+HackStudio+SpaceAnalyzer: Use File::can_delete_or_moveKarol Kosek
2023-01-17AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()Sam Atkins
This is a preparatory step to making `get()` return `ErrorOr`.
2023-01-09SpaceAnalyzer: Do not reset the path to '/' after a refreshArda Cinar
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
2023-01-09SpaceAnalyzer: Make sure data fields of TreeNode are encapsulatedArda Cinar
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
2023-01-09SpaceAnalyzer: Remove an unnecessary level of inheritanceArda Cinar
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
2023-01-07LibGUI+Userland: Rename `try_load_from_gml()` -> `load_from_gml()` :^)Sam Atkins
It's the only one, so the `try` prefix is unnecessary now.
2023-01-07Userland: Replace all uses of `load_from_gml` with `try_load_from_gml`Sam Atkins
MOAR FIXMES! ;^)
2023-01-06LibGUI+Everywhere: Use fallible Window::set_main_widget() everywhere :^)Sam Atkins
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.
2022-12-23LibCore: Remove the `force` parameter from File::removeTim Schumacher
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.
2022-12-23LibCore: Let File::remove return a normal ErrorOrTim Schumacher
Having the file path in there is nice, but it makes us incompatible with comfortable error propagation in everything that isn't File::remove.
2022-12-12LibCore: Rename `Stream::read_all` to `read_until_eof`Tim Schumacher
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.
2022-12-10SpaceAnalyzer: Consolidate the node context menusAndreas Kling
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! :^)
2022-12-09SpaceAnalyzer: Display the current location in the window title :^)Sam Atkins
2022-12-09SpaceAnalyzer: Propagate possible errors upArda Cinar
These include a JSON parse error, file open errors, and vector appends. These fix a bunch of calls to functions with `fixme` in them.
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
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.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
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 :^)
2022-10-25Applications: Use new global variables at /sys/kernel/ directoryLiav A
2022-10-25Userland: Let applications make use of make_command_palette_action()demostanis
2022-09-29AK+Everywhere: Replace "protocol" with "scheme" url helpersnetworkException
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
2022-07-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
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.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
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.
2022-07-12Everywhere: Explicitly specify the size in StringView constructorssin-ack
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).
2022-05-13LibGUI+Userland: Make Dialog::ExecResult an enum classSam Atkins
2022-04-18Userland: Always construct Application with try_create()Sam Atkins
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-30SpaceAnalyzer: Fix the crash caused by using arrow keysArif Orhun Uzun
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.
2022-02-28Applications: Change static constexpr variables to constexprLenny Maiorani
Function-local `static constexpr` variables can be `constexpr`. This can reduce memory consumption, binary size, and offer additional compiler optimizations.
2022-02-10Applications: Port SpaceAnalyzer to LibMainLenny Maiorani
2021-12-11Everywhere: Fix -Winconsistent-missing-override warnings from ClangDaniel Bertalan
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.
2021-11-17AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional)Andreas Kling
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.
2021-11-08LibCore: Use ErrorOr<T> for Core::File::remove()Andreas Kling
This function returns a subclass of Error, which is now possible.
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()Andreas Kling
This was used in a lot of places, so this patch makes liberal use of ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-10-31SpaceAnalyzer: Display scan progress with popup window during analysisForLoveOfCats
2021-10-09SpaceAnalyzer: Make files removable depending on directory permissionsKarol Kosek
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.
2021-10-07SpaceAnalyzer: Fix rendering bug when dealing with large file systemsMart G