Commit Graph

65696 Commits

Author SHA1 Message Date
Andrew Lindesay
13bbb4d8f2 HaikuDepot : Break Out Pkg Model
The data model for packages contains a number
of components which all reside in a single
source header and implementation file making
maintenance and modifications difficult. This
change will break the sub-models out into
separate files without making any functional
changes.

Change-Id: I9c2557bc1e5a33661145c55290a0baad4084fd49
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7181
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-12-07 19:01:54 +00:00
John Scipione
89b4e5d23e BMenuItem: Add B_BACKSPACE and B_DELETE UTF-8 shortcut chars
U+232B Erase To The Left
U+2326 Erase To The Right

Special case B_DELETE so we don't have to fill out kUTF8ControlMap
with NULLs to get to the last char of the ASCII table at 0x7f.

Lowercase the A in the B_SPACE hex string matching other cases.

Change-Id: Ia5d793112ae8063dfe58366c9dd10d6e616af350
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7177
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-12-07 10:47:52 +00:00
PulkoMandy
841c1c0c10 acpica: fix tracing on 64bit systems
Change-Id: I75be1a37a17c171a45c4b5994c65117aed894b56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7141
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-07 06:48:59 +00:00
Jérôme Duval
9fb1ce2781 radeon: use the KernelStaticLibrary rule
to build with GCC 13 on x86

Change-Id: I1a79154e3c41a86e34542feff99f3b0a331ef8b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7188
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-06 19:16:19 +00:00
Jérôme Duval
7be86b18a3 libgraphicscommon.a: use the KernelStaticLibrary rule
to build with GCC 13 on x86

Change-Id: Ic775196ffff556dd12381c7b374100bb46838973
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7187
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-06 19:16:19 +00:00
Jérôme Duval
ff45b65f4d acpi: use the KernelStaticLibrary rule
to build with GCC 13 on x86

Change-Id: If4e37cf5e15038169a16eab048cad4cd6b905707
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7186
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-06 19:16:19 +00:00
Jérôme Duval
f2acc47f43 acpi: update AcpiOsAcquireGlobalLock and AcpiOsReleaseGlobalLock
implementations from FreeBSD. Because the argument wasn't volatile,
the compiler wasn't considerung reading the lock content.
* fix the acquire and release loops:
The loop could be exited when any new values were read.
Instead the return value should be checked against the old value.

Old x86 gcc2 asm loop in AcpiOsAcquireGlobalLock:
   11660:       89 c8                   mov    %ecx,%eax
   11662:       f0 0f b1 1a             lock cmpxchg %ebx,(%edx)
   11666:       39 0a                   cmp    %ecx,(%edx)
   11668:       74 f6                   je     11660 <AcpiOsAcquireGlobalLock+0x20>

New x86 gcc13 asm loop in AcpiOsAcquireGlobalLock:

    4d58:       8b 11                   mov    (%ecx),%edx
    4d5a:       89 d0                   mov    %edx,%eax
    4d5c:       89 d3                   mov    %edx,%ebx
    4d5e:       83 e0 fc                and    $0xfffffffc,%eax
    4d61:       83 cb 03                or     $0x3,%ebx
    4d64:       f6 c2 02                test   $0x2,%dl
    4d67:       75 05                   jne    4d6e <AcpiOsAcquireGlobalLock+0x1e>
    4d69:       83 c8 02                or     $0x2,%eax
    4d6c:       89 c3                   mov    %eax,%ebx
    4d6e:       89 d0                   mov    %edx,%eax
    4d70:       f0 0f b1 19             lock cmpxchg %ebx,(%ecx)
    4d74:       75 e2                   jne    4d58 <AcpiOsAcquireGlobalLock+0x8>

Old x86 gcc2 asm loop in AcpiOsReleaseGlobalLock:
   11690:       89 c8                   mov    %ecx,%eax
   11692:       f0 0f b1 1a             lock cmpxchg %ebx,(%edx)
   11696:       39 0a                   cmp    %ecx,(%edx)
   11698:       74 f6                   je     11690 <AcpiOsReleaseGlobalLock+0x10>

New x86 gcc13 asm loop in AcpiOsReleaseGlobalLock:
    4d88:       8b 11                   mov    (%ecx),%edx
    4d8a:       89 d3                   mov    %edx,%ebx
    4d8c:       89 d0                   mov    %edx,%eax
    4d8e:       83 e3 fc                and    $0xfffffffc,%ebx
    4d91:       f0 0f b1 19             lock cmpxchg %ebx,(%ecx)
    4d95:       75 f1                   jne    4d88 <AcpiOsReleaseGlobalLock+0x8>

Change-Id: Ia55ba8666efe8b5c198a01db100b4747b72df4a0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7185
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-06 19:16:19 +00:00
Jérôme Duval
153bb8ef67 Revert "ACPICA removed our cast we need for gcc 2.95.3"
This reverts commit fe0910891a.

Change-Id: I5887dcbfad83fb10978cd58bda5c2dc540226fe3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7184
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-06 19:16:19 +00:00
Jérôme Duval
a45709f630 Revert "ACPICA fixes for gcc2.95.3"
This reverts commit 3f6f7f7420.

Change-Id: If47a81ada6c7fe38c1e40bed4381a384ef25c050
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7183
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-06 19:16:19 +00:00
John Scipione
f66a7eb59e Tracker: Fix Default button in settings for thumbs default on
Change-Id: I3d7398cb19a34d78a12c4a1fc325f2d15d59e825
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7180
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-12-06 18:07:07 +00:00
John Scipione
d8f0eb354e DataTranslations: Call parent list view MouseMoved
... in this version's MouseMoved() to draw selection while dragging.

Related style update to MouseMoved in header (dragMessage, 80 char).

Change-Id: I7b6396ca9dd9b7868894a6424c02ba3ee4e6b20e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7175
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-12-05 22:10:10 +00:00
John Scipione
6761bf581f BListView: Update selection on mouse down and mouse up
A version of this feature was originally implemented in hrev50495
that allowed you to scroll through a list of list items while the
mouse was held down updating the selection as you went.

This feature was removed when we switched to selecting on mouse up
in hrev52062 and was never reimplimented when we switched back to
selecting on mouse down in hrev52121.

In BeOS R5 as you scrolled through a single-selection list with the
mouse button held down the selected item appeared to change, but
the selection didn't actually update until you released the mouse
button. The selection never changes on mouse down, only on mouse
up. You could click on one item then move your mouse off the first
item to a second item releasing your mouse button and it would
select the second item without ever selecting the first item.

In this commit we replicate this behavior with one exception, we
always select on mouse down, but still allow the selection to
change on mouse up.

The big difference between this and the BeOS behavior is that on
BeOS you could only select exactly one item on mouse up, while with
this you can select one item on mouse down and a second item on
mouse up.

ScrollToSelection() in MouseMoved() if mouse button is down and
we are not not dragging. This performs auto-scroll.

Create private _DoSelection() method copied from MouseDown().
Remove Thread.h include that is no longer used.

Fixes #15009 (and doesn't cause regression for #9190 #14264 #14289)

Change-Id: Icae02b8d37ed281390647504b4efa3d694ea522a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1956
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: John Scipione <jscipione@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-12-05 22:10:10 +00:00
John Scipione
c70de894ea Tracker: Another minor code simplification
Replace string literal with kMakeActivePrinter command, shorter.

Change-Id: I64b552fb49fd34f07d956ed6f8a740d7c84a3f7a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7173
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-12-05 20:33:01 +00:00
Alexander von Gluck IV
3634f14235 docs/develop/ide: A quick guide for haiku code completion
* Works under a Linux "cross-compile" environment
* We can't check in compile_commands.json unforunetly because it
  highly depends on your build environment
* An in-tree .clangd is a thing, but our includes are complex
  and directory-spefific.
* Thanks to Pulkomandy for adding the flag to jam to do this!

Change-Id: I3be4084c43f7b822bb04ea7ec527c5fbe03d7289
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7158
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-12-05 20:02:07 +00:00
John Scipione
9bc1ff61eb Tracker: Allow Get info without selection in File menu
If you don't have a selection, Get info on the window instead.

Change-Id: I83db030798788a487ce3123bb8b2c25056d4fbf2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7170
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-12-05 16:51:01 +00:00
John Scipione
0509d19b91 BTextView: Stylish fix, -x is clear we don't need -1 * x
Change-Id: I38a5e6c88e2ba3b2f82c49aa760942e1799a7595
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7171
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-12-05 16:50:27 +00:00
Oscar Lesta
2e1f37d6de AboutSystem: update RAM size on replicant instantiation.
Fixes #18696

Change-Id: If56670a756b4512732edd6846c8055a89d8e3a4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7174
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-04 02:38:44 +00:00
John Scipione
6a0798da0c Tracker: Show "-" for packagefs volume size
... instead of "4096 bytes" (i.e. 1 block).

Set total_blocks to 0 in packagefs_read_fs_info to indicate
that the capacity is 0, this avoids some potential issues
that using 1 or -1 might cause.

In WidgetAttributeText look for volumes with 0 blocks and
set fValueIsDefined to false which displays a "-".

Also replace capacity string with "-" in Get info.

Fixes #10291 the quick and dirty solution to #18567.

Change-Id: I7ff204c9ffd10cf9cc6343fcdd4422c034004004
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7164
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
2023-12-02 19:29:08 +00:00
Autocomitter
a07cdb3feb Update translations from Pootle 2023-12-02 08:19:09 +00:00
John Scipione
6f451a737b Tracker: Minor code simplifications
Call TargetModel() instead of PoseView()->TargetModel(), shorter

Eliminate duplicate method in FSUtils. Call FSIsRootDir() in a
couple of places instead of looking for "/".

Change-Id: I42b7f39e7708eda107ee479a6cd36cb58ac77ad9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7172
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-02 03:33:40 +00:00
John Scipione
41fcdb3c1c Tracker: Remove stray separator
... when context-click on a volume in Open/Save dialog.

Regresssion introduced in hrev56978. Separator goes with the
Paste item that is not currently added.

Change-Id: Ic9402cae27ed84f15479ee9b9cc1f48fea806efa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7169
Reviewed-by: John Scipione <jscipione@gmail.com>
2023-12-01 22:03:21 +00:00
Alexander von Gluck IV
6ce8dc888f remote_disk_server: Fix incorrect format size on 64-bit
* Of note, using the Linux version since this tool is
  generally compiled on the host system

Change-Id: I85907a09877a97ec6ec709add6f7985b551fcad3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7168
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-01 18:29:05 +00:00
Alexander von Gluck IV
c678ffc139 remote_disk_server: dos2unix line endings; no functional change
Change-Id: Ie325a24bb6a06907a8404c6c0f07addfcfa99e71
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7167
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-12-01 18:29:05 +00:00
Augustin Cavalier
f7fb846f5b Tracker: Store the correct time value in the thumbnail creation attribute.
We were storing real_time_clock_usecs() but comparing against
BStatable::GetModificationTime() which is just a time_t. The
values were thus displayed wrongly in the "Get Info" window,
but also thumbnails would not have been updated when the file was.

Should fix #18691 and possibly some other tickets.
2023-11-30 17:42:08 -05:00
Augustin Cavalier
b6c24e6b40 network: Overhaul TUN/TAP subsystem.
* Rename the "tun" network device to "tunnel". FreeBSD calls theirs
   "tuntap" but speaks of both TUN and TAP devices as interfaces for
   tunnels. The other BSDs seem to do likewise.

 * Fold the "tun" driver into the "tunnel" network device. The
   network device now publishes entries in devfs when interfaces
   are created, and unpublishes them when interfaces are destroyed.

   This removes the need for the driver and device to communicate
   through a file descriptor, and thus allows the receive queue
   to be totally eliminated, massively simplifying that logic.

 * Use standard net-stack FIFOs instead of TCP BufferQueue, which is
   specialized to TCP's needs in far too many ways. Thanks to the
   previous commit adding support for interrupting semaphore waits,
   we can use the FIFO wait mechanisms, too.

 * Restructure the TAP logic, and generate MAC addresses more like
   Linux does.

 * Actually set type = IFT_TUN, and use the "loopback" frame handler
   instead of the "ethernet" frame handler. This allows significant
   cleanup of the header handling logic.

 * In TUN mode, reject packets that don't look like IP packets.

 * Delete "tunconfig"; it was mostly stubs and is now unnecessary.

TUN mode tested and confirmed as working by kallisti5 with OpenVPN.
TAP mode partially tested, but not yet confirmed as working.

Fixes #18673.

Change-Id: Ibd803139474e8db556a4f567901da15ee4083621
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7143
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2023-11-30 20:44:44 +00:00
Augustin Cavalier
daf1dd9c40 kernel/sem: Use "count" as thread_unblock status in B_RELEASE_ALL.
Previously, "count" did nothing for B_RELEASE_ALL. Now, if it is
< 0, it will be the error code returned by acquire_sem() of any
waiting threads.

As B_RELEASE_ALL is a Haiku extension, this change should not
cause any compatibility problems that we cannot fix.

This will be useful in implementing some features of TUN/TAP
with network FIFOs.

Change-Id: I2dbccedefac2024fe740b87543ff3b80f5257e20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7163
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-30 20:44:44 +00:00
John Scipione
0d85e8fb10 AboutSystem: Consolidate info, remove inaccessible memory
Change-Id: I0a5c0cb61f8c2b01caf12a907ad1c7938c519cf9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7152
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-30 20:27:10 +00:00
Andrew Lindesay
ba1465cc86 HaikuDepot : Faster DTO Models
This change includes some changes to the
generated DTO models between HaikuDepotServer
and HaikuDepot which should improve
performance.

Change-Id: I74c6014f8115aa0a55907a24b6115dd48d341794
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7165
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-11-30 19:22:03 +00:00
Augustin Cavalier
255314f734 libroot: Make stpncpy compatible with GCC2. 2023-11-28 21:47:39 -05:00
Augustin Cavalier
611d3d7803 BSocket: Fix swapped parameters in Bind().
Spotted by X512.
2023-11-28 20:41:02 -05:00
Augustin Cavalier
15a3f4c540 libroot: Add stpncpy.
Imported from musl.

It is in POSIX.1-2017.
2023-11-28 20:37:15 -05:00
John Scipione
5a66a92969 BColorControl: right-align text box values
Change-Id: I2ead9d310d265c04b49ea3029694584e628d782f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7160
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-28 22:33:03 +00:00
Alexander von Gluck IV
53bc9ad035 bfs: Reduce potential for garbage value ingestion
* Pointed out by clang static analysis.  These are
  later read while not being completely validated.

Change-Id: I4546526535d6e011aee40c74136f992962ab8cff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7159
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-28 19:48:02 +00:00
Andrew Lindesay
2174e23fcb HaikuDepot : New Parser Generation Script
Without functionally changing the generated
code, create a new mechanic for generation
in order that improvements can be later made.

Change-Id: Ieb420f2eb0fee51c266ab2e0734ec5c298640cfa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7156
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-11-27 20:00:16 +00:00
John Scipione
ba4ed24acc Tracker: Replace Path with Location in Query
... matching what's in the Attributes menu and everywhere else.
Right align Size column. Replace attribute literals with constants.

Change-Id: I336ef03cd500bf0e079435e21e5b8bf704d29aac
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7157
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-11-27 17:18:38 +00:00
Augustin Cavalier
783aa308c3 network/stack: Clean up socket_receive.
* Reshuffle variable declarations, most are placed much
   closer to first usages now.

 * Turn a confusingly worded comment into an ASSERT(),
   and remove another one that was outdated.

 * Fix some minor code style problems.

 * Make the copying logic more consistent between first
   and then subsequent copies.

 * Make it possible for B_BAD_ADDRESS (EFAULT) to be
   returned. This is not listed in POSIX, but as per
   online sources, at least Linux does do this.

Change-Id: Idcfbed30531c1ab4796c4ee37f7f4ce8078e535b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7147
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-11-27 17:10:19 +00:00
PulkoMandy
111528d18d HaikuDepot TextView: fix merging of spans
When adding two successive spans with identical styles, they should be
merged into a single span. However, all prevous spans in the view were
accidentally removed.

Change-Id: I4b2d21331ba97cf54a0db83e7638e23bd2303a63
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7128
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-11-25 10:49:21 +00:00
Autocomitter
fd76762183 Update translations from Pootle 2023-11-25 08:21:04 +00:00
Augustin Cavalier
2926dfaa3f network/stack: Fix handling of MSG_TRUNC in socket_receive.
This is a Linux extension (which at least FreeBSD has also
adopted.) It's used in the Haiku port of libpcap (where it's
a necessity) and wpa_supplicant (where it wasn't, and I
removed it.) It seems that we've had it for quite some time.

Fixes tcpdump following addition of flag checks.
2023-11-24 23:07:18 -05:00
John Scipione
e91af56d9f BMenu: Turn on keyboard tracking on up arrow too
Set MENU_STATE_KEY_TO_SUBMENU on up arrow as well as down. This
causes the menu to check if there is a selected item even if you
aren't hovering over the menu. Previously we were doing this for
the down arrow but not the up arrow which caused a subtle bug that
humdinger stumbled upon in Deskbar where if you push the Menu key,
up, then Enter, the menu item is not activated, but if you push
Menu key, down, then Enter the menu item is activated.

Fixes #18686

Change-Id: I8dce6112603e12fb47afebb48a33b3ec6fa60230
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7140
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-24 23:04:09 +00:00
John Scipione
ac83e7f073 Tracker: Fix CanEditName() crash (from hrev57402)
Although I can't reproduce this crash, from the looks of the crash
report something in the CanEditName() method is throwing a
segmentation fault.

If selection count is not 1, don't even try to get the selection,
Edit name is not allowed unless you have a single item selected.
Double check that selected item is not NULL before using it.

I refuse to believe that fSelectionList being NULL is the problem
here, more likely fSelectionList->FirstItem() is NULL and is the
cause of the crash. Bailing out after checking that selection
count is 1 should ensure that FirstItem() is not NULL.

Hopefully fixes #18684

Change-Id: Ib99192178fa6f6d31b389afb47e72c5513e6e1c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7139
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-24 18:52:13 +00:00
John Scipione
f5029bd569 Tracker: Disallow Restore from Trash if no selection
TargetVolumeIsReadOnly() doesn't make sense here because we
know the trash's volume is not read-only, we need to check
that you have a selection to enable Restore. Currently
(since hrev56978) Restore option is always enabled but it
shouldn't be if you have nothing selected.

It would be nice to also check if the restored location is
not read-only because you put something in the Trash then
remounted the volume read-only, but that's too much work.

Fixes yet another regression from hrev56978.

Also missed a delete convenience method call in hrev57402.

Call CanMoveToTrashOrDuplicate() to check if delete is allowed.
This method does a bit more work, it checks if the selection
includes the Desktop, the root volume, or the trash itself
which you are not allowed to delete.

Otherwise the same, this shouldn't make a big difference.

Change-Id: Ie188f25bd969a5aaeec9ff397fa5750872ccf97f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7138
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-24 18:52:13 +00:00
Augustin Cavalier
ceeea27b72 freebsd_wlan: Fix compilation of ieee80211_ioctl.h under GCC2 in C mode.
GCC2 tolerates [] FLAs in C++ mode but not in C mode, as discovered
when trying to build wpa_supplicant against R1/beta4. A workaround
was added there for now, but this is the more general solution.
2023-11-24 12:57:07 -05:00
John Scipione
32d1cd8e82 Tracker: Fix regression Copy To writable volumes
Regression was introduced in hrev56978 (Tracker read-only patch)
after R1B4.

This check is bad on Copy To/Move To operations because destWindow
is same as source window in these cases. This check only worked on
right-click drag Copy here/Move here since there is a separate
destWindow in this case.

Checking destFolder's volume read-only fixes the regression
because destFolder, unlike destWindow, should always be valid.

Fixes #18657

Change-Id: I4721bae34840d916e47f2a395d553e7254acaec5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7137
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2023-11-24 16:34:37 +00:00
Andrew Lindesay
45f8be4190 HaikuDepot : New Model Generation Script
Without functionally changing the generated
code, create a new mechanic for generation
in order that improvements can be later made.

Change-Id: If5b755ebd257658ab0e0a0045dd21a464b429c09
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7135
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-11-24 16:34:08 +00:00
Augustin Cavalier
459fa41f17 network/stack: Get rid of socket_readv and socket_writev.
These have not been used in years (maybe since the redesign of the
network stack?). Only socket_writev had an implementation, which was
mostly just an incomplete version of socket_send.

Scatter/gather I/O is already supported via msghdr's msg_iov/len fields,
so this is redundant anyway.

Change-Id: If41c4f4ee021856f6db49c7cb95422a9c1aa7700
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7127
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-11-24 16:28:38 +00:00
Adrien Destugues
9d972e321d ext2: do not use "extfs" as a short name.
The original Linux extfs was short lived (less than a year) and is long
forgotten. Still, to avoid any confusion, it's better to refer to our
filesystem as ext4 (even if it is backwards compatible with versions 2
and 3).

Mention all 3 versions in the "pretty name" to be even clearer about
this.

Previously this was called "ext2" but people then assume that it does
not handle the later upgrades in versions 3 and 4 (which makes sense).
2023-11-24 13:41:31 +01:00
Augustin Cavalier
5188904bfa loopback: Actually update device statistics.
ifconfig shows numbers other than 0 for the loopback interface now.
2023-11-23 15:03:21 -05:00
Augustin Cavalier
75874bab1a ethernet: Device statistics must be updated using atomic operations.
Both send and receive can be called concurrently, and there aren't
any locks protecting these fields, so they must be updated with atomics.
2023-11-23 15:02:45 -05:00
Augustin Cavalier
6461885e2e TUN: Remove redundant comments.
They only described things that the function names and parameters
already indicated. As per the Coding Guidelines, such excessive
commenting is to be removed.

Also fix some other (minor) code style issues while at it.
2023-11-23 14:27:40 -05:00