There were two problems with the last commit:
* the list needed to be outside of the top-level loop.
* BList was just broken for sorting translation_format pointers.
I fixed this by moving the loop outside and converting the translation_formats
to translator_info, which has the translator_id, since that is needed to create
the menu item, and would otherwise be unavailable outside the loop.
I tried to get this working with BList, but the sorting was completely broken,
and converting to BObjectList made the code much, much better and worked great.
Screw BList and casting, hurray templated BObjectList.
Really fixes#6782.
This is used by ShowImage and CodyCam to create a list of image formats which a
file can be saved as. Tracker sorts the image MIME types used in the Find
window by name, so this makes these Save As menus match that (minus the icons
which I think are superfluous.)
Fixes#6782.
If the use of BList is no longer recommended, I welcome better suggestions
for sorting which will work in both GCC2 and GCC4. But this works ;)
Should not be a functional change. It is not in the Haiku Coding Guidelines but
I feel like 'if (object != NULL)' is generally preferred to 'if (object)', plus
in this case of be_control_look that is the more common style.
Added SetFlags(B_CLOSE_ON_ESCAPE) or SetShortcut(index, B_ESCAPE) to BAlerts
depending if the result gets used later in the code, or if it's a one-button
BAlert.
With this commit, app_server now compiles and runs at boot! Nothing
particularly interesting happens, just the blue background and a mouse
pointer. Remote backends are broken and not compiled in, see #8834.
Note that it won't be possible to build this quite yet, need to get
the FreeType package uploaded.
An off-by-one error (> instead of >= really) was causing truncation when it
wasn't needed. But for some reason this only showed up when the main font size
was increased. I may or may not look into that, but this fixes the issue.
Maybe one of the faster bug logged to bug fixed times in Haiku history? ;)
No functional change.
* Surround email addresses in angle brackets.
* Add myself to ExpressionParser.cpp and .h
* Remove myself from ExpressionTextView.cpp and .h
* Alphatetize authors by last name.
Thanks Ingo and Axel.
Figured out by Stephan originally and only hacked in WebPositive, I knew
something about WebPositive was different because it did not flicker when
everything else did.
Since we fully draw the menus there is no need to have app_server fill in the
background with the view color. That is what was causing the flickering.
Should fix#484, #532 and #4335. Thanks diver for confirming the patch against
those tickets.
The ellipsis character (...) after a menu item means that
the command needs more information from the user before
the operation executes.
The ellipsis character doesn’t simply mean that a dialog
box or window will appear.
The window appearing completes the command and doesn’t
require additional input from the user before it executes.
The current behaviour of aligning to the maximum value of p_align seen
is problematic for x86_64, as the default segment alignment is 2MB.
This causes all x86_64 binaries to be padded to at least 2MB when
resources are added to them. There is no need to align to p_align in
the file itself (it's only an in-memory requirement), therefore
instead just align up to an 8-byte boundary. The current behaviour is
retained for ELF32, so this won't cause any compatibility problems
(there are no existing ELF64 BeOS/Haiku binaries to worry about).
Default is radian mode, You set the option in the right click menu
like the other options.
Note: degree mode does not affect hyperbolic trigonometric functions.
This is how Mac Calculator, Windows Calculator, and Google Calculator
work.
Fixed the usual issues - printf format strings, uint32 instead of
addr_t, etc. One thing that isn't so nice is several places where
BList is used to store (u)int32, these require a double cast to addr_t
then void* to silence a warning on x86_64.
The cookie is used to store the base address of the area that was just
visited. On 64-bit systems, int32 is not sufficient. Therefore, changed
to ssize_t which retains compatibility on x86 while expanding to a
sufficient size on x86_64.
Right clicking on a Pose to get the contextual menu would quite often
trigger a rename action of that pose. Don't allow to rename a pose
by releasing the secondary mouse button.
When restored, an overlap was wrongly detected in offsets for
failure to take into account the width of the border line.
This was causing the horizontal scrollbar to show unnecessarily.
A crash of Tracker was triggered when accessing AddOn menu (by
shortcut or context-menu) for Pose on Desktop, because of it's
incapacity to read the mime type list (that wasn't built in
those cases).
1. Build the list of mimetypes of files in selection only once and
reuse it for all further tests.
2. Fix a regression introduced in hrev44384 where the MimeType()
wouldn't get recognized when just changed by tracker (by that same
right click). It would be on subsequent clicks.
3. Rename the static map variable to better fit our coding style
and be more understandable.
When sorting files by Modified dates, right clicking on a file was leading
to a sorting issue where files were changing positions (without reason).
1. Any changes to stats (size, modification, creation, mode) was triggering
the sorting. Now only stats fields currently used as a Sort criteria will
trigger such event.
2. The Mimeset of file was set (in case of unknown file format) once per checked
add-on when building AddOn Menu. Now it's checked once per file in selection.
(so, once per file, rather then once per file, per add-on).
3. Now rely on registrar to force the mimeset (to trigger the sniffer in case
the attribute already exist) rather than trying to duplicate the feature in Tracker.
4. When Sorting, if there is a old position known, check if it's working by looking
if you should come after the previous item, and before the following item. Previously,
the item would be pushed at the top if the group of item all fitting the criteria
(same file size, same file kind, etc.. depending on the sorting criteria).
Fixes#8478.
Fixing #1592.
A feedback FSNotification()->EntryMoved->PendingNodeMonitorCache->FSNotification
was seemingly introducing some race condition, as it was working 1 time
on several tries.
- Store whether or not the use of the horizontal scrollbar is desired
on the class itself. If the CLV was set to use the horizontal scrollbar,
and then asked to lay itself out while hidden, it would incorrectly assume
the horizontal scrollbar wasn't in use, and consequently repositioned its
views such that the horizontal scrollbar and outline view overlapped.
- If a string column was exactly the correct pixel width for the strings
contained within it, they would skip attempting to truncate the string.
However, the truncated string was always used for final drawing, with
the end result that the fields would be drawn blank. This would sometimes
manifest itself in Debugger where things like ID columns wound wind up
showing no data until one resized the column.
* Patch from #6885: This filters out any disallowed characters from text
being pasted or dropped in. If the resulting filtered text is zero
characters long, it beeps. Works with styled text too.
* Coding style: variables renaming by korli.
- The version of instantiate_object() that returns the image id from which
the object was reinstantiated was not correctly returning it in all
circumstances, only if it had to find/load the add-on itself. This caused
problems for BShelf since the latter relies on that image id in order to
determine what image to unload when replicants are removed. To remedy this,
introduce an additional version of find_instantiation_func() that returns
the image id in which the instantiation function was found, and make use
of it in instantiate_object() in order to also be able to return the image
id in that case.
Since the button was renamed from "Do it!" to the specific action,
an additional explanation in case of special user folders isn't
needed any more.
Split text into paragraphs for better readability.
Introduce a function to generate the string representation of a bitrate
(kbps, mbps, gbps, etc..)
* Factor out the code from MediaPlayer InfoWindow
* Allow different bases (/1000 or /1024)
* Extract the scrollbar change based on the mouse wheel delta into a protected
method of BView.
* Call that method from BScrollBar's MessageReceived.
With this change it is now a bit easier to scroll horizontally around the
system by putting the mouse cursor over a horizontal scrollbar and using the
wheel.
Fixes#8631.
* Adjusted initial tracker windows width to fit modified column.
* Resolved a TODO: Added get info shortcut to Open with window.
Author: Sergei Reznikov <diver@gelios.net>
Signed-off-by: Alexandre Deckner <alexandre.deckner@uzzl.com>
fBackgroundImage wasn't being cleared when removing the desktop
background image because the loading process wasn't ignoring
loading failures (as is the "no background for this workspace" setting).
fBackgroundImage not being NULL was causing crashes mainly in
ScreenChanged(), where it was trying to re-center a non-existant
background. Was causing #7376 and maybe others.
In List Mode, consider the extra margin added to the right of
the last column when computing the Extent of the PoseView. This
was causing the ResizeToFit to resize a bit too small.
Fixes#4318
Passing NULL or a blank string to SetToolTip(const char*) sets the
tooltip to NULL by calling SetToolTip(BToolTip*) with a NULL argument.
Calling SetToolTip(BToolTip*) with a NULL argument calls HideToolTip()
because sometimes the tool tip can change without the mouse moving,
for example because the user clicked.
Thanks Axeld and Stippi.
The bug is that in horizontal mode the tooltip will remain set to
the last moused over team menu item even if the mouse is no longer
over a menu item. The bug can be seen in the following screenshot:
http://26.media.tumblr.com/tumblr_m3gze8s1xi1r0f0hfo1_400.png
To fix this bug, allow you to set the tooltip text to blank or NULL
in SetToolTip(const char* text). In ShowToolTip() check to see if
the tooltip text is blank or NULL and if so, don't show the tip.
Setting the tooltip to blank or NULL effectively unsets the tooltip
on a view.
This fixes a bug introduced in hrev44075 (I think) where the internal
tooltip window wouldn't resize itself after setting new tooltip text.
So if you set the tooltip to a short string then set it to a long
string the tooltip would get cut-off or if you set it to a long string
and then set it to a short string the tooltip window would be too wide.
The result can be seen in Deskbar in the following screenshot:
http://30.media.tumblr.com/tumblr_m3fg327NsV1r0f0hfo1_400.png
After invalidating the layout the internal tooltip window gets resized
correctly.
* Change ShowTip() point parameter name to where.
* Add a parameterless ResetWindowFrame() overload that get's the current
where and calls ResetWindowFrame(BPoint where) which does the actual
work. FrameResized() calls this parameterless ResetWindowFrame()
method instead of doing the work in that method. This is functionaly
the same but allows me to call the parameterless ResetWindowFrame()
elsewhere.
* The areas allocated for BBitmaps were never deleted, even though the
app_server deleted its part when the memory got freed.
* This resulted in a constant memory increase if the application in question
would operate on many changing large bitmaps, like photos.
* Since the bitmaps are reference counted, we don't actually know when to delete
the areas, so that the app_server now notifies the client whenever that is
possible.
* This might fix#6824.
* This removes the fVisibleToolTip member from BView, and fixes bug #5669;
BToolTipManager::ShowTip() now gets the owner of the tool tip as an extra
parameter.
* Removed the work-around to hide that bug.
* Improved ToolTipTest application to include more test cases like a view that
periodically update its tool tip via SetToolTip(const char*), and one that
sets a new tool tip every second.
* Furthermore, added a test that shows that inner views inherit the tool tip
of their parents.
* Fixed another bug in BToolTipManager::ShowTip() that would release an
extra reference to the tool tip currently shown.
* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h
The renamed macros require adjustments to all external applications
using catalogs.
* Not turned on for default buttons and menuframes right now.
* Updated Deskcalc and Keymap to use buttons with rounded corners.
* Overloaded methods with radium parameters are not virtual right
now so as to not break vtables. Added /*virtual*/ before each
method that should be made virtual in ControlLook.h
* Added a light line to the left border of the down arrow frame
on menu frames as a small visual tweak.
* Replace StrokeRect() with StrokeRoundRect() when drawing the
default button indicator. This gives them a rounded
appearance if the button is also rounded.
* Added protected methods _DrawMenuFieldBackgroundOutside and
_DrawMenuFieldBackgroundInside.
* Created some protected methods to get the edge, frame, and bevel
colors from a passed in base color because it was a mess and I
needed to calculate the colors from mutiple methods. It is much
cleaner now.
* Added myself to ControlLook.cpp authors list. Assigned copyright
to Haiku, Inc. Stippi also retains his copyright.
* Tons of style fixes.
- Change all instances of `if (flags & B_FLAG)` to
`if ((flags & B_FLAG) != 0)`
- Reorder some methods.
- Reorder includes.
- Spacing.
- Updated comments.
* move versions of the B_TRANSLATE_...-macros used during collecting
of catalog keys to a specific header file, which will only be picked
up when running collectcatkeys
* fix a couple of build problems during the preprocessing of the libbe-
sources when extracting catalog keys, all due to private headers not
being found
* move ZombieReplicantView.h from kits/interface to
headers/private/interface, as this way it can be picked up when
building the libbe catalog
* rename BCatalogAddOn to BCatalogData, since it doesn't represent an
add-on, but rather the catalog data provided by an add-on
* move BCatalogData out of Catalog.{h,cpp} into its own header and
implementation file
* drop BCatalogData::MarkForTranslation() methods, they're not needed
* drop BCatalog::GetNoAutoCollectString() methods, they're not being
used anywhere
* cleanup the B_TRANSLATE_... macros somewhat
* add versions of the B_TRANSLATE_MARK_... macros that are meant to be
used in void context (when the string isn't being used by the program,
just meant to be picked up by collectcatkeys).
* adjust several apps to use B_TRANSLATE_MARK_..._VOID where needed
* adjust users of BCatalogAddOn accordingly
* it's bad practice to do a 'using <namespace>' in a header, as that
is very likely to have unintended effects, so drop those from a couple
of private Locale headers
* adjust files all over the locale kit in order to fix the problems
(by explicitly importing the required classes in the implementation
files)
* move EditableCatalog to its own header and implementation file
* move problematic BCatalog::CatalogAddOn() to EditableCatalog
* adjust Locale tools accordingly
Added two new methods to the Locale Kit in order to create a custom time
formats from a format string. One method is outputs into a char* array,
the other into a BString() and you can set the timezone.
These methods should be cleaned up, we only need 2, one to get
the time in a predefined style, the other to get a custom time format.
Also should probably do the same for dates and datetimes. But I'll let
this go for now.
I added myself to the Locale.cpp file. I retained the copyright instead
of assigning it to Haiku, Inc. because the file is under the OpenBeOS
license and I don't know what the concequences of copyright sharing are
for that license, unlike MIT.
These new methods are used to generate custom time formats in Deskbar.
Instead of using a set of Radio Buttons to choose between the predefined
time options I build my own by creating a format string and passing it
to the Locale Kit. The format string is generated from 3 checkboxes,
show seconds, show day of week, and show time zone. You can mix and match
between them choose any that you like. By default they are all off.
There are 3 new deskbar settings associated with these new options:
showSeconds, showDayOfWeek, and showTimeZone. timeFormat has gone away.
The time format string gets cached and updated only when Update() gets called
on the TimeView class.
In order to fit all the options in (there is 1 more than before) I had to
reduce the font size of the clock to 11pt when all options are turned on in
12 hour mode. For those with no imagination it looks like this:
http://imagebin.org/208162
Renamed "Open time preferences..." menuitem to "Time preferences...".
Renamed "Show Time" and "Hide Time" to "Show time" and "Hide time".
Other changes include refactoring the header files a bit. There were a lot
of headers included by header files uneccessarily. For instance BarWindow.h
now only includes <Window.h> and <Deskbar.h>. This change is mainly to
to speed up the compile time since it takes a while right now.
I copy the fBarView pointer from BarWindow in the BarApp constructor and then
use that throughout the file rather than getting the pointer from the window
each time by calling BarView(). BarView() is still available in the header
for other classes though.
I moved some message constants around since it was getting a bit jumbled.
Most of the messages related to settings are in PreferenceWindow.h.
fChangeState is moved to BarView.h since that is where the ChangeState()
function is and BarView.cpp uses that constant.
The time interval and format constants are in TimeView.h.
Make some methods public in their respective classes where it made sense.
The preference window methods to update dependent items are public, that
might get called from BarWindow when a message gets received at some point.
Also made ShowHideTime() and Time() public in StatusView.h. These methods
activate showing and hiding the clock and return the fTime clock object.
No reason they should be private.
I reindented the StatusView.h and PreferenceWindow.h headers to the standard
style. Question here, are the public: protected: and private: lines inside
of classes suppose to get indented 1 tab or not? I've seen both, the style
guide says no indent but 1 indent seems reasonable and looks pretty good.
Style fixes here and there. That's enough for one commit I think.
* make the system catalog a BCatalog instead of a BCatalogAddOn*,
such that using a non-existing system catalog won't crash but
simply return the untranslated string instead
* rename MutableLocaleRoster::GetSystemCatalog() to LoadSystemCatalog()
and adjust it to use BCatalog::SetTo() in order to replace the
data used by the given catalog
* adjust all users of gSystemCatalog accordingly
* use a locker to protect the CatalogAddOn-chain against parallel
access
* rename BCatalog::SetCatalog() to SetTo() and make it a proper
initializing function
* adjust implementation of BLocaleRoster accordingly
* unify pointer style (to type* )
* always use boolean expressions in if
* introduce some spacing for better readability
* make a couple inline methods non-inline
- Add accessor to PoseView that reports whether the view is currently
typeahead filtering.
- Use said accessor in the file panel's filter in order to detect whether
to tell the latter to cancel filtering vs closing the panel.
Fixes#8140.
* fix regression introduced in hrev43950:
HashMapCatalog::GetString() didn't return the non-translated
string in case there was no translation found, which e.g.
caused AboutWindows to trigger a debugger message about the
alert not having any buttons.
Thanks to diver for the hint.
Below is a mostly complete summary of the changes in this commit.
* Set the DeadKeys for the US-International Keymap to use the Option map.
* Rename American keymap to US
* Update the US, US-International, and United-Kingdom keymaps to take
out unneeded spaces in the option layer. Also updated the dead keys
and some other keys on the US-International keyboard to use UTF-8
characters rather than there ASCII equivalents when different.
* Make the Option key fall-through when there is no mapping in the Option
table. Option is for special characters, if none, print the regular one.
This is mostly meant for the US keymap which has an empty option map. But
also so that you don't have to repeat the normal, shift, and caps maps in
the option map needlessly. Although the keymaps are still not empty in
some cases that it could be like numpad keys and space.
* Update the /bin/keymap app to use fputs() instead of printf() when there
is no actual formatting taking place. I've gotten into trouble for doing
this before and it is faster to not process the string unnecessarily.
* Also several 80-char limit style fixes and updated comments.
* In Keymap class Reorder the modifier keys to match the keymap files.
Put B_CONTROL_KEY check above B_OPTION_KEY. Neither change has any effect,
they are purely aesthetic.
* Update DumpKeymap() method to use the abbreviated modifier letters so it
will fit in your 80-char wide terminal.
* Tiny style fix in InputServer
* 80-char limit style fix in BWindow and add a comment that the shortcut
gets eaten in the case of Cmd+Q
* Implement IndexForModifier() in KeyboardLayout, although I am not using it.
* Take Caps Lock out of the Modifier keys window because I couldn't get
it to work the way I wanted it to.
* Move key roles to the left column, and the key label on the left. Add column
header labels. Thanks Rimas!
* Add validation and improve marking menu options. Add a 'Disabled' option
to control, option, and command menus to disable the key. Make the key
role text grey if the key roles is disabled. Validation ensures that you
cannot repeat the same key twice in the Modifier keys window since that
won't work. You can't define 2 sets of option keys even if you really want
to. You can disable your control, option, and command keys if you
want, but that is not recommended.
* Rename kUpdateModifiers to kUpdateModifierKeys message to differetiate
it from kUpdateModifier.
* Add shift key to Modifier keys window, use the stop icon instead of the
warning icon to indicate conflicts.
* Allow the Layout system to control the size of the Modifier keys window
again, set the width's of the key role lables to the widest, set the width
of the menu fields to take up the rest of the space minus room for the
conflict views. I didn't like it that the Modifier keys window would change
size based on what options you had selected in the menu fields. Now it
doesn't, but, the layout system still makes it all fit.
* adjust corresponding query predicate to use BUnicodeChar instead
of ctype-functions
Alas, this does not help as of now, since BUnicodeChar is missing
support for any codepoints above 0x9f ...
* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
other places, too) in order to access system catalog strings.
This is now done via gSystemCatalog, which is provided and initialized
by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
that rely on it in a working state.
TODO: the documentation hasn't been updated.
* Two uninitialized BMimeType objects are considered to be equal,
this is a purposeful break from BeOS R5.
* An uninitialized BMimeType object is considered to be equal to a
BMimeType object initialized to NULL. This is a purposeful break from
BeOS R5.
* Update the doxygen documentation comments to reflect this change which
will hopefully make there way into the Haiku Book at some point.
* In BMimeType::SetTo() replace an instance of strcpy() with strlcpy()
CID #something probably.
* Store the result of a few more strlen() function in size_t instead of
int to prevent overflow bugs.
* Make sure BMimeType::GetSupertype() returns either B_OK or B_BAD_VALUE.
* Undo my previous "optimization" in IsValid() to declare ch outside the
for loop.
* The static toLower() method had the same overflow bug that isValid()
had. However, since it is a private static method, rather than fix the
method I replaced with a call to strcasecmp() in the operator== overload.
When this method was written strcasecmp() must not have been available.
* Declare ch outside of the the loop in IsValid() so that it only gets
initialized once.
Previously, there were two instances of the actual variables, named in
ControlLook.cpp and Utilities.cpp. This caused clashes on gcc4 builds, leading
to various crashes during initialization. Instead we now declare them as
static constants in the header itself as is done for various other interface
color constants elsewhere. Fixes ticket #8358.
* instead of re-applying the fixed offset that had been set when the
Time preflet was used last, use the stored timezone name in
clockconfig in order to determine the current GMT-offset for that
timezone
* clockconfig now requires liblocale.so
* drop the offset field from the settings as it is no longer used,
clockconfig was the only client
* automatic whitespace cleanup
* This makes future changes less troublesome, although we should also add
some virtual slots there (probably just dozens of it, though, that's why
I was being lazy).
* Don't pass messages by value; they are copied twice this way.
* Minor coding style corrections, automatic whitespace cleanup.
* Rather than duplicating the decision taking logic involving wheter or not to draw
the outline or glow in every replicant, update be_control_look to make it more
generic.
* The Monitoring of the background preferences is now only done in Tracker (where it
was already being done).
* Add a BControlLook::B_IGNORE_OUTLINE flag to avoid this new behaviour.
* Remove that said logic from ActivityMonitor and use be_control_look.
* Use the ignore flag in DeskCalc to avoid the outline in its case.
Should fix#7716, #7291.
* Space after a number was not correctly handled (must be ignored).
* Better conceal the fact that I'm not always the brightest - the number
comparison was pretty questionable :-)
* If reading BeBook the class should be B_NO_INIT until we have called SetTo
* When I at it, any suggestion on how a test tool for BMediaEncoder should look like?
* Philippe voiced that he was the original author in the ML,
adding Philippe to the headers to ensure credit is given.
* Adding Precision Insight copyright back *just incase*
It's unclear if Precision Insight code was used given
Philippe's comments in the ML, lets be safe and add it back.
As we have Brian's permission for these changes I feel
comfortable with it.
* I received the ok via email from Brain Paul at mesa to
relicense the GLDispatcher sources to MIT + him as the
author.
* Update include ordering
* Remove HAIKU_TARGET_PLATFORM_HAIKU ifdefs for boot options
* Return the correct error code if there is a connection error
* Be more verbose if there is a problem
network connection problem instead of showing "Login error: "
* IMAP inbound: Show a valid error message if there is a
* Show server name resolution, fishes out IPv6 bug #8293
* maintain a list of all BPictures to do so
* BView downloads the BPicture data after recording the picture. This could probably done more efficiently using shared memory in the first place.
* Move compiled binaries into lib.haiku within Mesa optional
pacakge, this enables us to use Make or scons to build Mesa
* Untangle libGL linking and order library inclusion
* Remove zmuldef hacks
* Compile libgallium into the libGL on Mesa 8.0 / gcc4 images
* Don't Mesa calculate cpu optimizations due to visibility
issues, use Mesa cpu functions for this.
* Don't allow undefined symbols in libGL.so to ensure sanity.
* Move Mesa optional packages to haiku-files
* Call different functions depending on Mesa version
* The --no-warnings is for the GL headers which produce
large numbers of attribute directive ignored warnings
that cannot be disabled on gcc2
1. When in /boot, you couldn't go to the parent (which is fine by itself),
but the menu item wasn't disabled.
2. In Single Window Browsing, doing "Open parent" wasn't respecting that
setting and was opening new windows.
3. In filepanel, when navigating to Desktop folder, the "Go to parent" was
still proposed even though it would do nothing choosing it.
4. Opening a Pose in Single Window Browsing was repopulating the menus and
putting the shortcuts again. That was an issue if Navigator bar was used
since it conflicts with its shortcuts.
Fixing ticket #6851.
In an earlier commit, I removed a memleak, but it was covering more cases
than intended. Thanks to Alex Wilson's insight, it seems that simply removing
the check is better (since that check is essentially redone in FSMoveToTrash()).
BVolume::BlockSize() might return a negative value (error code) and it
was passed as parameter of CalcItemsAndSize() as a size_t (unsigned).
Thus the check for an error code failed.
CID 4171.
The dynamic_cast was called twice, and the assert was
done on the first attempt. Now it just cast once, assert on this
and pass it further as before.
CID 3122.
Fix typo-induced bug causing (in many cases) the wrong item to be removed from the layout!
Also, improve performance from O(n * m) to O(n), although n and m will always be quite small in practice, we might as well.
* Use TimeZone::SHORT specifier instead of SHORT_COMMONLY_USED, since
the former yields more appropriate (textual) values. Strangely enough,
it used to be the other way around, which is why we didn't used SHORT
in the past.
* Textencoding Kit now uses localized names of available encodings;
* Default encoding for composing new messages in Mail application is now
configurable through localization feature. Fixes#8147.
* This contribution was made as part of GCI 2011 task.
Signed-off-by: Siarzhuk Zharski <zharik@gmx.li>
Since clamping the index for these methods could lead to confusing side effects, we'll just avoid the clamping, and let things segfault when the programmer goes out of bounds.
Closes#7902
It turns out,this is an old method added by Be, and is not really related to BView::InvalidateLayout(bool). In fact BMenu::InvalidateLayout() does something separate, but related to the BView method. I was wrong to delete this method, since it needs to have action taken each time it is called, so moving these actions into LayoutInvalidated() only worked sometimes (when the BView was considered to have a valid layout).
I have added a comment for future hackers so that they don't delete this method.
* We may get non-terminated strings so we need to use the
UTF8NextCharLen() version that works with a length. Previously we may
have read beyond buffers, possibly leading to crashes.
* Also the length parameter is used as an actual length and not as
buffer size. The length check was wrong before, which resulted in the
function returning too early if an offset was supplied.
* Added a comment about the guaranteed 0 termination in one case.
* Minor cleanup.
The string that is built for hashing the escapements for missing
chars was not 0 terminated, leading to accesses past the string.
Depending on what followed an allocation that could lead to too long
strings being sent to the app_server for evaluation (where, due to
defensive, programming nothing bad would actually happen). In the
unfortunate case that nothing followed the allocation (i.e. end of
heap area), it could also lead to an application crash.
Therefore ensure 0 termination of the string, check for allocation
failure and use memcpy() instead of a for loop to copy the bytes from
one string to the other.
Once again, the BObjectList removal behaviour leads to a null dereference. It's my fault of course, but there you have it. Comments have been included for future devs.
* The comparaison couldn't ever not match. Based on the comment above the
function, I made it so that flags must contain at least one of B_WATCH_NAME,
B_WATCH_STAT or B_WATCH_ATTR
CID 2586
The implementation is temporary. Currently it reads through the packages
in the respective packages directory and checks against the package
links. Once package activation is tracked explicitly we'll use the
activation file/directory.
A BPackageContentHandler subclass that initializes a BPackageInfo from
the read package attributes. Pulled out of RepositoryWriterImpl's
PackageContentHandler.
* Remove InitCheck() and the initializing constructor.
* Rename PackageCount() to CountPackages().
* Use BOpenHashTable instead of HashMap for the internal PackageMap.
* Allow multiple packages with the same name. Equally named packages are
in a singly linked list after the first package with that name.
* Add an Iterator inner class and a GetIterator() method, so one can now
iterate through the packages in the repository.
Always create the common repository cache/config paths so the BEntry
that is returned is valid at least. Fixes BRefreshRepositoryRequest
failing when the common repository cache path didn't exist yet.
The attribute is intended for simplifying package building. The
package's install path will be used for the package's .self package
symlink, allowing installation to a temporary directory when building
the package.
* Don't only look up the entry attribute when the entry is implicit.
Look it up, when it is a directory instead. This aligns it the logic
with _UpdateCheckEntryCollisions().
* When the entry attribute exits and the entry is not implicit, add file
attributes, but not stat data. This also aligns the logic with
_UpdateCheckEntryCollisions(), which removes colliding attributes, but
keeps stat data.
Add flags parameter to BPackageWriter::Init() (and the private
implementation classes) to indicate that an existing package file shall
be updated instead of created. Currently that always happens in-place.
When compression doesn't save space, using it nonetheless results in a
file that the reader complains about. So we fall back to writing an
uncompressed package attributes section in such a case.
The same still needs to be done for the TOC section.
* Add hooks HandleSectionStart() and HandleSectionEnd(). They are
invoked to bracket package file section, so the handler can
discriminate which section the attributes belong to.
HandleSectionStart() features a return parameter _handleSection, which
allows to handler to pick which sections it wants to handle.
* "package dump" does now print the section names.
If a FD is specified, instead of using the file with the given the FD is
used. Allows for adding entries without first copying them into the
directory structure.
* Match the attribute in a loop, use an attribute ID switch, do the
"seen" checks without the switch.
* Explicitly handle the case when encountering an unknown attribute.
* Use braces instead of brackets for lists.
* Semicolons and newlines separate items now. Remove handling for comma.
* Allow '\'' as quotation character.
* Remove assignment after variable name.
This should make the .PackageInfo format driver settings compatible, but
not vice versa. It is still stricter.
To avoid a clash with the regular version or an extra attribute level we
use the "package:provides.compatible" package attribute instead of
"package:version.major".
* The version string pattern is now:
<major>[.<minor>[.<micro>]][-<pre>][-<release>]
* Introduce B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_PRE_RELEASE package
attribute.
* Add "preRelease" field to BPackageVersionData.
* Add "preRelease" property to BPackageVersion and packagefs's Version.
* Adjust package reader and writer code accordingly.
Pull AttributeDataReader and FDDataReader implementations out of
DataReader.cpp into own source files. Thus we can avoid dependencies
(e.g. to fs_attr code) we don't need/want.
On a non-Haiku build platform map openat(), fstat(), and
FileDescriptorCloser to _kern_open(), _kern_read_stat(), and
BuildFileDescriptorCloser respectively, so symlinks can be opened and
stat()ed.
PackageWriterImpl:
* Iterate through attributes using fs_read_attr_dir() instead of
readdir(). Makes it work correctly on the build platform.
* On the build platform look up the system licenses in their source
directory rather than based on find_directory().
Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.
Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.
* the upcoming multibyte-implementation in libroot's ICU locale
backend is going to use this, so it's not good enough to provide
BReferenceable only in libbe.so