Commit Graph

18 Commits

Author SHA1 Message Date
Sam Atkins
ad92b16887 SpaceAnalyzer: Rename TreeMapWidget::m_path -> m_path_segments
This is clearer to me at least.
2023-02-04 12:27:10 +01:00
Sam Atkins
1ec59cc52a SpaceAnalyzer: Make TreeMapWidget responsible for filesystem analysis
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-04 12:27:10 +01:00
Arda Cinar
33ea96912a SpaceAnalyzer: Do not reset the path to '/' after a refresh
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-09 17:08:17 +00:00
Arda Cinar
c045ae1a96 SpaceAnalyzer: Keep the current path via filenames, not indices
The tree map widget keeps the current path to allow the user to navigate
between directories. This path was being kept as indices into the
children array. The indices might change after the tree is regenerated
and this change is required to keep the user's current place after a
re-analysis
2023-01-09 17:08:17 +00:00
Arda Cinar
8ba37872e9 SpaceAnalyzer: Remove an unnecessary level of inheritance
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-09 17:08:17 +00:00
Sam Atkins
d8ceaf7870 SpaceAnalyzer: Add a tooltip for the hovered tree node
Many of the nodes are visually too small to show their full name and
file size, so this makes that information visible.
2022-12-09 23:23:00 +00:00
Sam Atkins
6d64e650f1 SpaceAnalyzer: Remove declaration for unimplemented method 2022-12-09 23:23:00 +00:00
MacDue
7be0b27dd3 Meta+Userland: Pass Gfx::IntPoint by value
This is just two ints or 8 bytes or the size of the reference on
x86_64 or AArch64.
2022-12-07 11:48:27 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
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-12-06 08:54:33 +01:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Arif Orhun Uzun
eb34015748 SpaceAnalyzer: Fix the crash caused by using arrow keys
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-03-30 23:04:15 +02:00
Lenny Maiorani
160bda7228 Applications: Use default constructors/destructors
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-02-14 22:06:55 +00:00
Mart G
5f53dc6a45 SpaceAnalyzer: Fix rendering bug when dealing with large file systems 2021-10-07 08:46:15 +03:30
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Nicholas-Baron
c4ede38542 Everything: Add -Wnon-virtual-dtor flag
This flag warns on classes which have `virtual` functions but do not
have a `virtual` destructor.

This patch adds both the flag and missing destructors. The access level
of the destructors was determined by a two rules of thumb:
1. A destructor should have a similar or lower access level to that of a
   constructor.
2. Having a `private` destructor implicitly deletes the default
   constructor, which is probably undesirable for "interface" types
   (classes with only virtual functions and no data).

In short, most of the added destructors are `protected`, unless the
compiler complained about access.
2021-04-15 20:57:13 +02:00
Mart G
de9f458ff5 SpaceAnalyzer: Reduce thickness of black borders between cells.
-Adds take_from_{left,right,top,bottom} to Rect.
2021-03-02 14:46:06 +01:00
Sviatoslav Peleshko
ff018607a1 SpaceAnalyzer: Added context menu for nodes
Currently supports 3 actions: Open, Copy Path, and Delete.
2021-02-21 23:47:49 +01:00
Andreas Kling
dc28c07fa5 Applications: Move to Userland/Applications/ 2021-01-12 12:05:23 +01:00