Instead of passing the box in we can just use FindView to get it,
that's what other methods do. Also, check if removeButton exists
in AddAttrRow() first instead of doing it in this method.
The CIDs are about mkdir, we want to check that either the command
succeeded or failed because the directory already exists.
However, we also want to check the return value of find_directory()
and Append() to make sure they succeeded as well.
_TrackerLaunchDocuments() dereferences refs to copy it, so, we need
check that it isn't NULL first.
Also a few style fixes.
* Name params consistent with TTracker class methods
ref, message => appRef, refs
* Use NULL instead of 0 for NULL pointer.
instead or additionally to string.h, in preparation for functions move.
* moves str[n]casecmp() functions and others to strings.h.
* strings.h doesn't include string.h anymore.
* this solves #10949
* The thread could set fRunning to false before the caller had set it to
true, leading to a stalled request.
* Happened easily when testing "data" requests, which are fast since no
I/O is involved.
* Possibly also helps with stalled redirects on Google search I've been
seeing for some time.
There is some misunderstanding on what the "deflate" is, and we can't
reliably decode it in all cases. So, don't advertise support for it and
let servers use gzip (or no compression) instead.
Fixes#11093
The RFC for Data URLs specifies a nonstandard format, and because of
this it doesn't support queries and fragments. This allows the use of
the # and ? characters in the URL data. We didn't handle this properly,
which would lead to truncated data.
Some URLs may use the % character for other purposes than URL-encoding
(this is seen in some data URLs). Make sure we parse that properly, and
avoid a possible out of bounds access if the percent char is near the
end of the string.
* Remove unneeded field fOutputHeaders and convert it to a local for the
only method that uses it,
* Don't return EOVERFLOW when flushing data from ZLib (the ZLib
decompressor returns this, but zlib docs states that this is NOT an
error condition).
* Replace unneeded temporary BNetBuffer of fixed size with BStackOrHeapArray.
... while Shift is held down in a selection.
Before this commit, if you had some text selected and you pressed
Home or End with a Shift held down the selection would not change.
This was annoying and most likely unintentional. Thank you Axel for
informing me of this problem.
After this commit if you have some text selected and you press Home
with a Shift key held down it will move the end of the selection to the
first character of the same line that the end of selection is on and if you
press End with a Shift key held down it will move the end of the selection
to the last character of the same line that the end of the selection is on.
I looked at how a bunch of different OS's and applications handled this
and found that there are a bunch of different behaviors we could use here,
and there doesn't appear to be any consensus as to what the "right" or
"wrong" way to do this is so please forgive me if this doesn't work exactly
as you expect it to.
Note that the implementation used here is very different from how BeOS
R5 worked. In BeOS R5 pressing Home or End with Shift held down
always extended the selection, it never subtracted from it.
In BeOS pressing Home with Shift held down extended the selection from
the left-most part of the selection to the first charcter of the same line.
Pressing End with Shift held down extended the selection from the
right-most part of the selection to the end of the same line.
Private Method docs are/should be in doxygen format. Remove \brief as doxygen
doesn't need this if you document along side the method.
Remove brief description comments from public methods, you'll need to look in the
Haiku Book for this now.
style squash
BUrlContext now inherits BReferenceable to make it easier to handle the
context lifespan. Make the default context an always-retained reference
to match this.
No functional change in normal conditions, however this avoids an assert
when BReferenceable is built in debug mode.
We don't have support for TCP_CORK, which would let the kernel handle
this, so this resulted in lots of very small packets being sent over the
network. Besides the performance issues, this confused aliceadsl.fr HTTP
server and prevented logging in to their website.
Fixes#10556.
* receiveEnd is set in a different place in case of chunked transfers,
which would cause the decompressor to never be flushed.
* In the case of chunked transfers, we call Flush() without any input
data (to flush only whatever is remaining in the decompression buffer).
This causes ZLib to return Z_BUF_ERROR which is translated to
B_BUFFER_OVERFLOW. This is a non-fatal error and is expected behavior in
that case. Don't handle this as an error, and do use the extracted data.
Fixes various cases of missing the last chunk of a page (pastie.org,
Google search results, and more).
This bug was introduced in hrev47498
The reason Tracker crashed was because OpenWithContainerWindow
had a NULL TargetModel() which we were trying to dereference.
Fix this by creating an empty model in OpenWithContainerWindow. Add an
ASSERT to check that the TargetModel() is not NULL in the future.
Another way to fix this bug would have been to check that TargetModel() wasn't
NULL each time before we use it. I didn't go with that solution because we
assume TargetModel() is not NULL in a lot of places so it would be a lot of work
to check them all. I think it's better to give OpenWithContainerWindow a dummy
model even though it doesn't make sense for it to have one just so that we don't
crash when we try to dereference the pointer.
* icon_size size => icon_size which (I've settled on which)
* fOrigBitmap => fOriginalBitmap
* resizeMask/resizeFlags => resizingMode (header and cpp match)
* error => result
* explicit NULL checks for pointers
* multi-line conditional ifs get {}'s
* rename result to more descriptive name when not status_t
BRoster::Launch() sends B_REFS_RECEIVED before B_READY_TO_RUN
if the application is not running, so, when B_REFS_RECEIVED looked for
the Desktop window it wasn't created yet since that happen in ReadyToRun().
By creating the Desktop window in the constructor instead it is available
in RefsReceived() so an extra Desktop windows isn't opened.
* Update doxygen docs a bit, especially returns.
* Some variable renaming for consistency and clarity, err/error => result.
* Remove some dead code that isn't coming back. (code moved to IconUtils)
* OpenType() returns a status_t, put it in a status_t, not a ssize_t.
and then later create a new ssize_t to hold the read bytes read
and use that, saves a lot of casting and confusion.
* Remove public method docs, they are in Haiku Book only.
* Format private method docs as doxygen.
* Other style fixes like explicit NULL checks.
* Remove dead code in GetIcon() that isn't coming back.
* Pointer style.
Also create Trash if does not exist but check the if the icon
attrs are set separately.
Only set the vector trash icon #ifdef __HAIKU__ does this
even matter anymore?
Instead of relying on the global protocol loop to call _ParseHeaders
once for each header, extract as much as possible from the current
buffer.
This saves memory, avoids useless operations on the socket and various
processing steps, and fixes#10245.
Also improve the handling of 0-size requests to make sure they terminate
properly.
* Allow EXECUTE on the Folder property to open a window for the passed
ref and return a BMEssenger targetting that window.
* Allog GET on the Folder property to return a messenger to the matching
window, if one is already open.
* Make scripting support mandatory and remove the define allowing to
disable it.
* Avoids the ugly "button that opens another window" UI paradigm in
Tracker preferences.
* Makes it possible to revert changes to the automount settings as the
Tracker preferences window has a revert button.
When using the Show Disks icon option, single window navigaton mode,
and starting navigation by the Disks icon, these bugs would occurs
upon entering child poses :
*) The draggable icon at the top right wouldn't appear
*) The file menu wouldn't update properly (for example, the New folder
menu item won't show)
Based in part on dru_ed's patch.
Besides that this is a nicer interface, it allows us to get a the HPKG
header as a side effect of initializing the reader, thus preventing
seeking backward in the file. This makes "package recompress - <file>"
work.
Until now we always declared in the HPKG header that the package file is
zlib compressed. For uncompressed files we would just store all
individual chunks uncompressed. Now we handle completely uncompressed
files slightly differently: We don't write the redundant chunk size
table anymore. The size savings are minor, but it makes the uncompressed
format read-streamable which may be handy.
* PackageFileHeap{Reader,Writer} as well as Package{Reader,Writer} and
their implementation and super classes do now internally use a
BPositionIO instead of a FD to access the package file. This provides
more flexibility needed for features to come.
* BPackageReader has already grown a new Init() version with a
BPositionIO* parameter.
Simple BPositionIO implementation using the POSIX API on a FD. In effect
similar to BFile, but more easily ported to kernel and boot loader (and
the FD is reusable).
Make sure the compressed/uncompressed heap size and the chunk size
table look plausible, so we can rely on the values later. Fixes
potential crashes for corrupt packages.
* BCompressionAlgorithm is a base class for classes that provide
compression/decompression functionality. There are methods for
compressing/decompressing a single buffer and factory methods for
a compressing/decompressing input/output BDataIO.
* BZlibCompressionAlgorithm is a BCompressionAlgorithm implementation
using zlib.