Commit Graph

9459 Commits

Author SHA1 Message Date
Jérôme Duval
518f9c4e68 BCountry: check ICU version for addLikelySubtags
should help arm, riscv builds.

Change-Id: I2d626dfd28c9c4abaac15c010dd41afac410d564
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4246
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-07-26 09:30:59 +00:00
Adrien Destugues
a94ee3f35a BUrlRequest: fix issues found while documenting
- Remove Pause/Resume functions. They are not possible to implement (the
  server would time out)
- Fix SetContext(NULL) to do the right thing.

Change-Id: I25ba09bb01ea0fe8a85d774611b33be7dc192028
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4245
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2021-07-26 06:28:08 +00:00
Adrien Destugues
8df6e5c2a6 BWindow: fix copypasta in ResizeToPreferred
If you had problems with a window picking an incorrect height when using
the layout system, this could very well be why.
2021-07-25 17:47:36 +02:00
Adrien Destugues
a43cf8d4a3 LayoutUtils: fix typo
This is in the code to print a text dump of the layout constraints, so
it does not fix any layout problems, but it makes debugging things a bit
easier.
2021-07-25 15:55:46 +02:00
Coldfirex
cf4ce7e38b Debugger: va_list 'args' opened but not closed by va_end()
pointed out by cppcheck

Change-Id: Idf81666674c881ca9e00bf3985ed0dcf928c19d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4220
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-07-21 08:27:20 +00:00
Adrien Destugues
e5fb17f0ca BCountry: add a GetPreferredLanguage method.
The APIs for this were introduced in ICU 63, so we'll need an update.
ICU 63 does not build with gcc2, so this method is disabled there.

Change-Id: Iabe49509ed6d4e578560d497d3ca336a97db4625
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1874
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-07-21 07:20:39 +00:00
Adrien Destugues
fa1e07fa7a Package kit: fix error handling in case of HTTP errors
HTTP errors can have some content sent with them (a message to display
to the user, usually). The package kit would not ignore this and append
the content to the end of the downloaded file. This could result in a
file larger than the expected size, and in that case, it would keep
growing infinitely by adding more error messages to it.

Also add some more specific error messages for some HTTP codes, in
particular, "invalid range" which is likely to happen if something goes
wrong with range requests. Now this case will be detected and the
download will stop.

Change-Id: I18927f361235e9f72a5701c1bd7977abda9e21ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4210
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-07-16 18:33:35 +00:00
Máximo Castañeda
ae56997857 BCountry: return country name
ICU's Locale::getDisplayName fills in the locale's name in the form
"language (country, variation)". We are interested in the country here.

Fixes #17081

Change-Id: Icb810dbe2c486d95251d4d06a48dfe3a000fa968
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4206
Reviewed-by: humdinger <humdingerb@gmail.com>
2021-07-13 15:03:47 +00:00
John Scipione
50107f9f2b Tracker: fix last minute mini icon mode bugs
Pose::CalcRect() assumed top is at icon top in mini-icon mode. This
is not true for larger font sizes where the top of the text is above
the top of the icon. Calculate top and bottom based on font and icon
size matching the calculation in TextWidget::CalcRectCommon(). This
fixes a highlight redraw bug in mini icon mode at larger font sizes.

Push Edit name right 2px to match label position (in mini-icon mode.)

Round to integer to help with 1px off bug. Edit name box is still off
by 1px from the label for some font families and sizes.

Change-Id: Ibba897d6f3c7a879631adedada5cd59d2071191a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4204
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-07-12 00:33:38 +00:00
Adrien Destugues
3ca5eec002 libnetservices: fix handling of HEAD requests and 204 responses
We were incorrectly reporting a B_IO_ERROR for these requests because we
could not read the content after the headers. There is no content in
these cases.

Add an unit test for both HEAD and 204 status, checking that there is no
content and the headers are correct.

Fixes #16885.

Change-Id: I98fefc5c604253bb2545b50395b7af9f8834def0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4142
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2021-07-04 08:07:59 +00:00
Alexander von Gluck IV
ce5993fdb7 version: add BETA_3 and PRE_BETA_4 constraints.
Change-Id: I65b4889042c4c92086fade535622ef12b368a968
2021-06-21 11:38:54 -05:00
Adrien Destugues
303187e29b Revert "Media Kit: use the B_WRITABLE flag in plugins"
This reverts hrev54422.

I'm not sure what I was trying to fix with this change. The way the
media kit is currently designed, the list of supported formats
(including for reading) comes only from writer plugins. This means it is
impossible to have a decode-only plugin currently. And the list is
called "fWriterFileFormats" but in fact is the only list used to
implement get_next_file_formats, so it should contain all formats.

This current setup works for the ffmpeg plugin, but it should be
cleaned.

This fixes Youtube playback. The problem was simply that we were not
reporting support for any of the Youtube video formats anymore.
Unfortunately, the app_server crashes when playing Youtube videos are
still there.

Change-Id: Ie5025cd48e2ab23b616bad49eec1401331ffb0ed
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4103
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Panagiotis Vasilopoulos <hello@alwayslivid.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-06-21 12:33:28 +00:00
Pascal Abresch
325ab89b90 ControlLook: fix minor code style violation
Change-Id: I0b3e80e7ba4418f06c20fd02f96cb2932623fd71
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4102
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-06-20 19:55:44 +00:00
John Scipione
7912dad947 BTextView: Fix Tracker edit name
Don't resize text view in FrameResized() if resizable, this is done
in _AutoResize() instead. Set text rect width to width of max line when
word-wrap is off. Text rect width shrinks to the width of the text
matching behavior of BeOS R5 and previous Haiku. This fixes Tracker
Edit name.

Limit max width to column width in list mode or 30em in icon mode.
Filter paste messages limiting to max width in Tracker Edit name.

General BTextView fixes:

As a consequence of the text rect shrinking to fit the text, adjust
highlighting to go at least to edge of the view even if text rect width
is narrower. Extend the invalidation area beyond text rect when
redrawing to include highlighted areas.

Text views behave properly when overflow occurs i.e. when you type
text off the end of the text view. The text is nudged over as you
type/scroll so that the previous text is visible. This sorta worked
before but now works better.

Fix text rect centering by replacing switch with
BLayoutUtils::AlignOnRect().

Coalesce consecutive draw calls when inserting and deleting text to
prevent flashing for example when resizing the window. Redraw text
when the text view scrolls fixing a bug I noticed in StyledEdit.

Workaround negative height Beezer bug.

Fixes #16642, #16476

Change-Id: I2d32d6039944d2dc3218ce4de71f2966cc98c866
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3642
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-06-20 14:46:53 +00:00
Máximo Castañeda
1aca853fc9 BMenu: fix menu items width in column layout
Change-Id: Ia16d51ff31760fef28bcceeab7b5c26a05cfbdad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4092
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-06-19 09:28:06 +00:00
Murai Takashi
324b426da9 libnetservices: Fix DEBUG build
Add iostream header since BUrlProtocolListener::DebugMessage() need it.

Change-Id: I4665d5675b33b1cb5beba123d07a38c3edbbeb6f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4095
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2021-06-16 07:25:36 +00:00
Murai Takashi
0594775c0f storage kit: fix Wrong type of arguments to formatting function
Pointed out by LGTM.

Change-Id: I802814ef53dd3f46a355db0a57926676037984a7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4080
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-06-11 10:59:02 +00:00
Máximo Castañeda
e41899a6fe BMenu: fix scroll activation
Fixes #14932

Change-Id: I72b16a26ea4d3cef0e9518381c583b23bdcadc22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4078
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: humdinger <humdingerb@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-06-09 10:58:02 +00:00
Máximo Castañeda
46c95b5d09 BMenu: move menu over the menu bar only if there's more space there
Fixes #16773

Change-Id: I465c2f4366c11b7b0bacaed57c3d8fd33defe8a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4077
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-06-09 10:58:02 +00:00
Fredrik Modéen
329ae20bac Make Bluetooth Pref use BMessage to save data.
* This will break previus ways to store settings (as it only stored a struct)
* Now we use BMessage to save data.
* Added some stuff to SettingsMessage.
* Fix a bug in BluetoothSettingsView::_GetClassForMenu() and SettingsMessage::SetValue

Change-Id: I6a0fa1564e78460258f480947592eb4007985007
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3887
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-06-02 13:44:13 +00:00
X512
d00fc0e3e6 BTextView: fix Text field scripting
Change-Id: I2048d7f01fa3694d5687447cf7058fecf03ae15d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4007
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-05-29 12:17:24 +00:00
X512
5fcf71f504 Remove unneeded iostream includes
It cause adding new entry to executable init array for each translation unit.

Change-Id: I1e2d7946da03c001de7721948bc9af8188e8b317
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3981
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-05-25 11:50:45 +00:00
Pascal Abresch
409d65c0d6 Decorator: Introduce Scroll bar size call
Change-Id: I07f08c2893d832e431c29ae753e0a93d6e619701
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3892
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: X512 <danger_mail@list.ru>
2021-05-03 16:42:32 +00:00
Fredrik Modéen
6cd4da00c0 SettingsMessage: Add uint16 and uint64 support
* Thanks to kottan I notices something was of..
* Added uInt16 and uInt64, I was missing UInt16.

Change-Id: Id136dbb5a81392a7a694ac1fbbd9aefbd7f77af3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3888
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-05-01 12:58:34 +00:00
Murai Takashi
2bde55cb6c tracker: Fix wrong type of arguments to formatting function
Use B_PRId32 for int32 type fValue.
Pointed out by lgtm.

Change-Id: I751451281ace627e2f3be67d1b860b8ebe675ba5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3886
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-04-25 09:00:53 +00:00
François Revol
df026fdf16 BMessage: fix typos 2021-04-24 12:55:17 +02:00
François Revol
c7ac2d5042 SettingsMessage: Remove existing int32 when saving an uint32
Fixes #16922 for good.

Previous attempt did read the saved value but didn't save it back properly.
2021-04-24 12:48:20 +02:00
Adrien Destugues
51b5bca96e SettingsMessage: style fix. 2021-04-23 18:13:14 +02:00
Máximo Castañeda
8f16317a5b Fix build
Change-Id: I0d3e3afc7262688e3bc90672766e6e7d263f06b8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3884
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-23 11:33:23 +00:00
Adrien Destugues
63046071f9 SettingsMessage: search for int32 version when searching an uint32 setting.
There was a bug in the version of this class previously used by MediaPlayer,
and as a result we have settings where uint32 fields are stored as int32.
If the uint32 version is not found, try the int32 version.

Fixes #16922.
2021-04-23 08:53:28 +02:00
Adrien Destugues
3d768367d4 DefaultMediaTheme: fix build with tracing enabled. 2021-04-15 22:51:10 +02:00
Fredrik Modéen
6375ef053d Move SettingsMessage to a central location
* Move SettingsMessage
* Remove SettingsMessage from MediaPlayer and WebPositive
* Use the central SettingsMessage in MediaPlayer and WebPositive (Later Bluetooth)
* Fix a Jam file.

Change-Id: I3bb82a40082c5ece5c2aea2468a77bcd9f15ce77
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3856
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-11 08:53:18 +00:00
Fredrik Modéen
91cbfa855e Bluetooth Pref: Inactiveate button and things that don't do anything.
* Inactiveate button and things that don't do anything.
* Those button and controlles that hade any actions in the Bluetooth Pref now saves in settings.
* Fix some windows/views.
* Fix Copyright in last Bluetooth commit.
* Last commit before we move saving settings with BMessage.
* Changed PoupMenu to BOptionPopUp

Change-Id: I32b85f1985b558d24b294a184665e08e6ce18a7d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3829
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-10 20:28:43 +00:00
Gerasim Troeglazov
1ab6200126 DefaultMediaTheme: implement BTextParameter handling for BParameterWeb
These changes add text parameters support to DefaultMediaTheme
for the BParameterWeb class.

Change-Id: I6ec04109af73011f84bb7c1fd5210c5c8842c2cb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3828
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-06 20:17:52 +00:00
Fredrik Modéen
16196fd3b7 Bluetooth Pref: Updating view of incomming connection when Paring
This is not my code but from ticket #9265
* Made a picture of how it looks, old left andnew right. https://imagebin.ca/v/5wIe6TIMzw4C
* Think we have a bug somewhere and don't store the name of the Bluetooth device (shown i the image).
* I have made som small changes but other than that it's the same code as in the ticket
* Ran the src/tools/checkstyle/checkstyle.py to get som style stuff, probably missed some anyway.

Change-Id: Ifeb75c8ad890f541e100cdcf78b394675a48ada9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3825
Reviewed-by: Fredrik Modéen <fredrik@modeen.se>
2021-03-30 17:25:13 +00:00
Kacper Kasper
a78899d40a Debugger: fix infinite recursion when resolving lambdas
* Should fix #14346. Uploaded executable there doesn't work anymore,
  but this patch is prepared for case in #16040, and fixes
  #16680 too.
* The issue is that if lambda parameters use an alias, this alias
  has that lambda as a parent. Specifically the compiler generates
  operator() subprogram, Debugger tries to resolve types for its
  parameters, but at the same time it is a parent namespace for
  those types.
* Call chain: operator()( -> type 1 -> namespace: operator()( ->
  type 1 -> namespace: operator()( -> ...

Change-Id: I7aad150a8d9de4f0c01ae0c1db5e486416b72112
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3824
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-27 10:23:33 +00:00
Adrien Destugues
f4abe40626 DriveSetup: fix creating partitions
The code paths for creating a new partition and editing an existing one
are more mixed together than I thought:

- CreateParametersPanel reuses a method from ChangeParametersPanel which
  I had modified.
- In the storage kit, the code to create the parameter editor is also
  shared between the two.

The problem is that when creating a partition, we have only the parent
BPartition. When modifying parameters, we have the child, and we need
to get some things from the child (the current parameters), and some
from the parent (the parameter editor).

Fixes #16859.

Change-Id: I5978386978c79a351e94c098c065fd43c422eb51
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3822
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-26 19:59:19 +00:00
Jérôme Duval
267c6a9b0d Locale: correct fix binary compatibility for BNumberFormat
fix HaikuDepot build after hrev55006

Change-Id: I3c275e1b0f23f936db448ad82639458535617d6a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3809
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-03-20 09:30:14 +00:00
Jérôme Duval
e3c3983827 Locale: fix binary compatibility for BNumberFormat
Issue: https://github.com/HaikuArchives/Album/issues/15
Change-Id: I1f8d5055f929957adb0cca20a8f6b13bcccabfab
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3807
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-19 10:53:15 +00:00
jiceland
7e094dc359 FindPanel - Corrected operators less / greater than + rebuild of attributes for MIME change
* Operators for Less than/before and Greater than/After were incorrectly set to <= and =>,
  now corrected to < and >
* When query type is set to By attribute and user changes Filetype, corrected the update of attributes
  Before this change, attributes were updated according to previous filetype

Change-Id: I7e02af9cb667c4db2c0efd8fa0da8b2b0c4b9ddf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2990
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-19 10:17:40 +00:00
Emir SARI
87f4776937 Add mobile phone field
Change-Id: I655c06ce050f4d1a1b09a4065514c695ec7b6452
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2876
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-19 10:17:25 +00:00
Kacper Kasper
8534484314 Fix MutableLocaleRoster::LoadCatalog logic
* It should always try loading parent language.

Change-Id: I3af14beef70a41242d09b11f09abf749ac92e588
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3802
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-17 07:25:00 +00:00
Jaidyn Ann
a29f0661ce Tracker: Don't use hardcoded colors for the Open With window
Change-Id: Idb7b336006391da3d64b7f395e87ff30c07d3100
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3797
Reviewed-by: humdinger <humdingerb@gmail.com>
2021-03-16 16:12:38 +00:00
Adrien Destugues
9274ca847b intel partition map: implement changing the active partition
Implement the needed parts in both the userland add-on (loaded in
DriveSetup) and the kernel side one (used by disk system manager in the
kernel).

This allows changing the active partition in DriveSetup.

Change-Id: Ia65768b5f8f11d626ef24621ae7735723dcbc39d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3771
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-15 10:18:43 +00:00
Adrien Destugues
8f5c5225da partitioning_system: get the correct parameter editor
When editing a partition parameters, we want to get the editor from the
parent partition. This will be the editor used to set the active
partition on Intel partition map, for example. The code testing if this
is supported and the code to apply the parameters did this, but the code
to get the parameter editor didn't.

Fixes the remaining part of #11641.

Change-Id: I25a6cf11fe315b8f6e118529f2395816101b7fe1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3766
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-15 10:18:43 +00:00
Alexander G. M. Smith
3376ed1a72 Package Kit: Proper Installation for First Boot Packages
Do the final installation operations for all the packages in the
/system/packages directory when the OS is booted for the first time.

This will run their post-install scripts, create users, groups and generate
settings files (marked with a package version attribute).  Previously we just
ran all the shell scripts found in the /system/boot/post-install directory
(don't do that as much now).

Fixes bug #14382

This patch has simpler code flow in CommitTransactionHandler::_ApplyChanges
Tested on 32 and 64 bit systems.  Once it's official, need to remove the
open_ssh redundant post-install script that creates users etc. from HaikuPorts.
Now we can notice bugs like package version attributes on settings files aren't
fully working. :-)

Didn't remove special case for add_catalog_entry_attributes.sh since it
still does stuff that the build system doesn't do.  Might be able to add
that script as part of the Haiku.hpkg.  See change 3751 for removing it,
https://review.haiku-os.org/c/haiku/+/3751

Change-Id: I3807b78042fdb70e5a79eca2e2a45816ece0236f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2342
Reviewed-by: Alexander G. M. Smith <agmsmith@ncf.ca>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-14 09:10:18 +00:00
Murai Takashi
e459857d1c BMessage: Fix declared variable-length array has negative size
Add checks for value of 'size', since FlattenedSize() may return
negative value (B_NO_INIT).
Pointed out by Clang Static Analyzer.

Change-Id: I68176ee47076512a0b96539f9986ac5edbb587af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3772
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-13 09:16:47 +00:00
Andrew Lindesay
564de1924a Locale: Support for Percent Formatting
Updates BNumberFormat to be able to format
percentages.  Also re-introduces some unit
tests and updates the BNumberFormat ones.

This doesn't actually fix #16312 as the
defaults for percentage formatting don't seem
to track the selected language, but goes part
way there.

Related to #16312

Change-Id: Id6ddf426ce5571f4e8513c0eb1663cf42ac53cb1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3767
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-13 00:29:32 +00:00
Niels Sascha Reedijk
ec8bba1587 PackageKit: fix download logic for remote files
This was broken in hrev54968, as some code was lost while switching to the new
way the network services kits writes files to disk.

This should fix #16822

Change-Id: I104d82e268ded287fd64db1cb902f94b71bad53b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3760
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-02 15:17:58 +00:00
Leorize
78b1442051 libbnetapi: BUrlRequest now outputs to BDataIO
Previously, BUrlRequest returns data received via a callback that can't
return any value. This approach have several issues:

- It's not possible to signify failures to the request.
- Users have to implement custom listeners just to handle the common
  case of outputting to a buffer/file/etc.
- The received data has to be serialized into BMessage when
  BUrlProtocolDispatchingListener is employed. This can cause a
  noticible slowdown in real-world scenarios as evident by #10748.

With this change, BUrlRequest will output directly into a BDataIO, which
exposes a richer API for request handlers to work with (for example a
BitTorrent client can request a BPositionIO for non-linear data
delivery), as well as simplifying common cases for users.

The adaptation only requires one additional API:
BHttpRequest::SetStopOnError(). This API simply instructs the HTTP
request handler to cancel the request if an HTTP error is occurred.

Change-Id: I4160884d77bff0e7678e0a623e2587987704443a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3084
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-02-28 20:39:31 +00:00