Commit Graph

24387 Commits

Author SHA1 Message Date
Andreas Kling
d79d768010 LaunchServer: Remove debug spam about incoming connections 2021-07-22 14:20:05 +02:00
Sam Atkins
9122967d5f FileOperation: Use LexicalPath::join() for all path joining 2021-07-22 12:48:44 +02:00
Sam Atkins
9ac757647f FileManager: Switch FileOperationProgressWidget::did_error() to SV& 2021-07-22 12:48:44 +02:00
Sam Atkins
469bca9d3a FileManager: Show progress dialog for file deletions
Progress dialogs are nice! :^)

Showing a proper file-deletion animation would be nice, but that is
outside the scope of my abilities.
2021-07-22 12:48:44 +02:00
Sam Atkins
967314023c FileOperation: Implement 'Delete' operation 2021-07-22 12:48:44 +02:00
Sam Atkins
e99200cc23 FileOperation: Combine 'sources' and 'destination' CL arguments
The upcoming 'Delete' operation has no destination, so this was the
best solution we could come up with for now. Perhaps ArgsParser
could support sub-commands, so we would define 'Copy', 'Move' and
'Delete' each as sub-commands with their own argument definitions.
That would make things like git's variety of commands possible.
2021-07-22 12:48:44 +02:00
Sam Atkins
dd833dc220 FileManager: Rename FileOperation::Cut to FileOperation::Move 2021-07-22 12:48:44 +02:00
Sam Atkins
5090b1bdba FileManager: Set file op progress window's text based on the operation 2021-07-22 12:48:44 +02:00
Sam Atkins
0a62d517fd FileManager+FileOperation: Implement (and use) 'Move' command
`FileOperation Move ...` is now used for cut-and-paste in the
FileManager.
2021-07-22 12:48:44 +02:00
Sam Atkins
a1b4ec1507 FileOperation: Extract execute_work_items() from perform_copy()
This is in preparation for a perform_move() function.
2021-07-22 12:48:44 +02:00
Sam Atkins
516764ef17 FileManager: Show progress dialog for pasted files
For now, this is a slight step backwards, as Cut does not remove the
source files. This will be rectified next.
2021-07-22 12:48:44 +02:00
Sam Atkins
d8fb8b9583 FileManager: Move mass-copy code from DirectoryView to FileUtils
This is preparation for calling it from FileManager/main.cpp

Also made file_operation_windows take NonnullRefPtrs.
2021-07-22 12:48:44 +02:00
Sam Atkins
9060310840 FileManager: Combine drag&drop file copies into one progress window
This fixes #6902.

Previously, dragging and dropping multiple files would create a window
for each file or directory that was selected. Now, we combine them and
show one progress window for the whole batch. :^)
2021-07-22 12:48:44 +02:00
Sam Atkins
3267556ce4 FileOperation: Accept multiple source arguments
You can now list multiple files or directories and they will all be
copied to the destination. :^)

Note that this means you can pass the same file or directory multiple
times. It runs fine, just means that it does unnecessary work. But
figuring out if a file is already queued is probably more hassle than
it's worth, if it's even possible at all due to symlinks.
2021-07-22 12:48:44 +02:00
Sam Atkins
ca039e6ba1 FileManager+FileOperation: Switch to east const
(And some adjustments based on MaxWipfli's feedback)
2021-07-22 12:48:44 +02:00
Andreas Kling
5217875f6a Kernel: Consolidate API for creating AnonymousVMObject with given pages
We don't need to have a dedicated API for creating a VMObject with a
single page, the multi-page API option works in all cases.

Also make the API take a Span<NonnullRefPtr<PhysicalPage>> instead of
a NonnullRefPtrVector<PhysicalPage>.
2021-07-22 09:17:02 +02:00
Andreas Kling
9e15708aa0 Kernel: Convert VMObject & subclasses to east-const style 2021-07-22 09:17:02 +02:00
Andreas Kling
1610669519 LibC: Make calloc() actually fail on multiplication overflow 2021-07-22 09:17:02 +02:00
Andreas Kling
e4c1514033 LibGfx: Use calloc() instead of malloc()+memset() Gfx::BitmapFont 2021-07-22 09:17:01 +02:00
Andreas Kling
027bfc4eff DesktopPicker: Make sure the applet always ends up in the same place 2021-07-22 09:17:01 +02:00
Timothy Flynn
d3c25593b9 LibJS: Implement String.prototype.split with UTF-16 code units
Also required implementing the SplitMatch abstract operation with UTF-16
code units.
2021-07-22 09:10:44 +02:00
Timothy Flynn
733a92820b LibJS: Implement String.prototype.replaceAll with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
06208aaa15 LibJS: Implement String.prototype.replace with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
bdbe716547 LibJS: Implement String.prototype.endsWith with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
d2e63a641f LibJS: Implement String.prototype.startsWith with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
f920e121b3 LibJS: Implement String.prototype.lastIndexOf with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
5ac964d841 LibJS: Implement String.prototype.slice with UTF-16 code units
This also implements String.prototype.slice more closely to the spec
(such as handling indices equivalent to Infinity).
2021-07-22 09:10:44 +02:00
Timothy Flynn
eaa1360eee LibJS: Implement StringPad abstract operation with UTF-16 code units
Affects String.prototype.padStart and String.prototype.padEnd.
2021-07-22 09:10:44 +02:00
Timothy Flynn
ef2ff5f88b LibJS: Implement String.prototype.at with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
892bfdbbcf LibJS: Implement String.prototype.substr with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
60d8852fc2 LibJS: Implement String.prototype.substring with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
767700d8a1 LibJS: Implement String.prototype.indexOf with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
70f9c7e1c7 LibJS: Implement String.prototype.includes with UTF-16 code units
This also implements String.prototype.includes more closely to the spec
(such as returning false when the search string is a RegExp object).
2021-07-22 09:10:44 +02:00
Timothy Flynn
a05ce330b8 LibJS: Implement String.prototype.codePointAt with UTF-16 code units
This also implements the CodePointAt abstract operation. This is needed
to handle invalid code units specific to the JavaScript spec, rather
than e.g. inserting replacement code units. This abstraction is public
because RegExp.prototype will also need it.
2021-07-22 09:10:44 +02:00
Timothy Flynn
48a28a9a73 LibJS: Implement String.prototype.charCodeAt with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
5d11614bc7 LibJS: Implement String.prototype.charAt with UTF-16 code units 2021-07-22 09:10:44 +02:00
Timothy Flynn
2bba20d123 LibJS: Report string properties using UTF-16 code units
String length is reported as the number of UTF-16 code units, and string
indices are reported as the UTF-16 code units themselves.
2021-07-22 09:10:44 +02:00
Timothy Flynn
0c42aece36 LibJS: Transcode UTF-8 strings to UTF-16 and add UTF-16 accessors
LibJS parses JavaScript as UTF-8, so when creating a string, we must
transcode it to UTF-16 to handle encoded surrogate pairs.

For example, consider the following string:
    "\ud83d\ude00"

The UTF-8 encoding of this surrogate pair is:
    0xf0 0x9f 0x98 0x80

However, LibJS will currently store the two surrogates individually as
UTF-8 encoded bytes, rather than combining the pair:
    0xed 0xa0 0xb8, 0xed 0xb8 0x80

These are not equivalent. So, as String.prototype becomes UTF-16 aware,
this encoding will no longer work for abstractions like strict equality.
2021-07-22 09:10:44 +02:00
Timothy Flynn
0e25d2393f LibJS: Add UTF-16 tests to String.prototype methods that already work
These methods did not require UTF-16 views, so just add test cases to
ensure they remain correct.

This also adds a couple of FIXME comments on tests that will fail even
with UTF-16 String.prototype support (for reasons such as lack of UTF-16
support in RegExp.prototype and Unicode case folding).
2021-07-22 09:10:44 +02:00
Timothy Flynn
9b83cd1abf AK: Add Utf16View for decoding UTF-16 strings
Also includes a way to transcode from and to UTF-8 strings.
2021-07-22 09:10:44 +02:00
Gunnar Beutner
bcf5e5ee5a AK: Disable clang-format for AK/Time.h
clang-format >=12 format this file incorrectly/differently.
2021-07-22 08:57:01 +02:00
Gunnar Beutner
eaad94751c Kernel: Fix incorrect format template 2021-07-22 08:57:01 +02:00
Gunnar Beutner
b4272d731f Kernel: Make sure crash dumps are properly aligned on x86_64 2021-07-22 08:57:01 +02:00
Gunnar Beutner
0e0985f15c Utilities: Make the columns for readelf fit all reloc types on x86_64 2021-07-22 08:57:01 +02:00
Gunnar Beutner
db1c5c4830 LibELF+Utilities: Avoid truncating 64-bit values
This fixes displaying 64-bit addresses in readelf and also fixes
showing backtraces from core dumps on x86_64.
2021-07-22 08:57:01 +02:00
Gunnar Beutner
36c3927169 Utilities: Make sure columns are properly aligned for readelf on x86_64 2021-07-22 08:57:01 +02:00
Gunnar Beutner
29c5dcd2fa Utilities: Make sure columns are properly aligned for pmap on x86_64 2021-07-22 08:57:01 +02:00
Gunnar Beutner
11e02f222d AK: Add a getter to JsonValue to get machine-native addresses 2021-07-22 08:57:01 +02:00
Gunnar Beutner
36e36507d5 Everywhere: Prefer using {:#x} over 0x{:x}
We have a dedicated format specifier which adds the "0x" prefix, so
let's use that instead of adding it manually.
2021-07-22 08:57:01 +02:00
Gunnar Beutner
31f30e732a Everywhere: Prefix hexadecimal numbers with 0x
Depending on the values it might be difficult to figure out whether a
value is decimal or hexadecimal. So let's make this more obvious. Also
this allows copying and pasting those numbers into GNOME calculator and
probably also other apps which auto-detect the base.
2021-07-22 08:57:01 +02:00