History log of /haiku/src/apps/networkstatus/WirelessNetworkMenuItem.cpp
Revision Date Author Comments
# 67380402 28-Jan-2024 PulkoMandy <pulkomandy@pulkomandy.tk>

BMenu: use std::stable_sort to implement SortItems

This fixes two problems:

- Use of a stable sorting algorithm makes sure that the relative
position between items that compare equal are not modified
- More importantly, the compare function in BList passes a
pointer-to-pointer (in this case a BMenuItem**) and this was masked by
the casts due to BList lack of type safety. So, BMenu::SortItems was
not working at all when trying to use it as its prototype would imply.

NetworkStatus and Network preferences worked around this by doing the
extra dereferencing in their compare functions. I did not find any
other places in Haiku where this function is used (it was introduced
specifically for this in hrev55562). All 3rd party code that had a
similar workaround will have to be fixed to remove it (if there is
anything using that function).

Change-Id: Ia78fd1363f2c012f6eff6f9a47e8b3aac2752ebd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7356
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>


# 02ad9218 01-Aug-2021 John Scipione <jscipione@gmail.com>

Network: Sort network menu items w/o deleting

* Delete dropped out networks.
* Add in newly discovered networks.
* Add static (aka class) compare method to WirelessNetworkMenuItem
that is used to sort items by signal strength descending.

Add == operator to wireless_network struct to determine if
existing items have a known network attached.

Remove the non-network items from the menu, save them, sort
network menu items, then add non-network items back into the
menu.

Update NetworkStatus preflet to use same compare method as Network
preflet. signal_strength_compare function had a bool return value
instead of int which worked to sort items the first time, but does
not work on successive compares.

By not deleting and recreating the menu items each Pulse(),
the Network preflet no longer crashes on update. The menu flashes
on update still but doesn't crash.

Fixes #12024

Change-Id: Ie5b22cea4e66350b9c5df8e3b8de266ede50ad6d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4243
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>


# b1f0ca87 09-Nov-2013 Matt Madia <mattmadia@gmail.com>

Whitespace cleanup: two blank lines between functions.


# 5bb799c2 10-Nov-2013 Przemysław Buczkowski <przemub@przemub.pl>

NetworkStatus: show authentication mode in WiFi list. #9666

* now WirelessNetworkMenuItem appends authentication mode to its label

Signed-off-by: Matt Madia <mattmadia@gmail.com>


# 3ca00ffd 13-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Moved WirelessNetworkMenuItem into its own file.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39833 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b1f0ca873fa62cfd31124da2db1f2dbfbaab97ac 09-Nov-2013 Matt Madia <mattmadia@gmail.com>

Whitespace cleanup: two blank lines between functions.


# 5bb799c2d3b452fa8d18b5ba66301f10ffa59b1b 10-Nov-2013 Przemysław Buczkowski <przemub@przemub.pl>

NetworkStatus: show authentication mode in WiFi list. #9666

* now WirelessNetworkMenuItem appends authentication mode to its label

Signed-off-by: Matt Madia <mattmadia@gmail.com>


# 3ca00ffdbc314d156c08af0eda1a6b231a7be3ce 13-Dec-2010 Axel Dörfler <axeld@pinc-software.de>

* Moved WirelessNetworkMenuItem into its own file.
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39833 a95241bf-73f2-0310-859d-f6bbb57e9c96