History log of /haiku/src/kits/tracker/Utilities.h
Revision Date Author Comments
# 8446d3b9 13-Dec-2023 John Scipione <jscipione@gmail.com>

Tracker: Miscellaneous cleanup

Move DraggableContainerIcon out of ContainerWindow.cpp into new.
Move CompareLabels to Utilities.cpp

Rename fContainerWindowFlags to fOpenFlags. These are the flags set
by OpenContainerWindow to save and restore state and should not be
confused with the windowFlags that are passed to BWindow. There are
two sets of flags, which I'm calling openFlags and windowFlags.

Rename fUseLayouts to fUsesLayout and useLayouts to useLayout. Put
all the constructor created flags at the top.

"window" variable name is ok, we don't need to say "containerWindow".

Rename Addons to AddOns everywhere with a capital O.
Rename BuildAddOnMenu() to BuildAddOnsMenu() with an s.
Rename AttributeMenu...() methods to AttributesMenu...() with an s.
Rename SetUp...() methods to Setup...() with a lowercase u.

Replace a few instances of fPoseView with PoseView() inline in
BContainerWindow and BDeskWindow.

A few more minor fixes in BDeskWindow.

Replace BPoint(0, 0) with B_ORIGIN in Pose.h

Change-Id: If30803753b63b19e35f14c0f0c4e08111d0d0980
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7240
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# cf83394d 22-Nov-2023 John Scipione <jscipione@gmail.com>

Tracker: Put duplicate checks into convenience methods

... and a few minor feature updates.

Create a CanEditName method on PoseView because we were using
subtly different checks in different places to see if allowed
to edit the name or not.

Tint background color of the Edit name text box on read-only
to indicate that the file name cannot be edited (only copied).

Create ReadOnlyTint() method in Utilities and use it here and
in PoseView to set the background color. Eliminate BackTint()
method from PoseView which served a similar purpose.

Add CanMoveToTrashOrDuplicate() convenience method.
Move To Trash, Delete and Duplicate options use same check.

Context menu of selection in file panel gets Duplicate option,
window context menu never did so don't try to enable it there.

Change-Id: I7a82d00ea10f22a7885c2e898a809e1abe9a6b30
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7122
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 425ac1b6 20-Jun-2023 Alexander von Gluck IV <kallisti5@unixzen.com>

refactor: Swap %Ld for %lld in all format usages

* %Ld is an undocumented alias for %lld in glibc.
* muslc doesn't implement it for this reason.
* While we will likely never drop %Ld support,
lets clean house and set a better example.

Change-Id: Id46dad3104abae483e80cc5c05d1464d3ecd8030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6636
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# b7dd18b2 02-May-2023 John Scipione <jscipione@gmail.com>

Tracker: Style fixes only

... including whitespace, brackets, rename loc to where or
location, add a pragma.

Replace min_c with std::min.
Replace BPoint(0, 0) with B_ORIGIN
Use make_color() function to make static rgb_color objects.

Change-Id: I47a4e5e5f0e7038643baca7539d211350bbb8f20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6404
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>


# 5192c3bf 25-Apr-2022 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Move thumbnail-manipulation code to its own file.

Preparatory work for refactoring thumbnail generation to not use
so many resources (threads, ports, etc.)


# 457d8a92 25-Apr-2022 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Remove unused rgb_color creation function.

Nothing seems to use it. make_color should be used instead.


# c6b6adc4 25-Apr-2022 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Replace custom LooperAutoLocker with AutoLocker<BLooper>.


# cd053a38 20-Jan-2022 John Scipione <jscipione@gmail.com>

Tracker: Fix image thumbnails

hrev55756 fixed regressions but also broke thumbnails.

Tell Model to look for an thumbnail icon in the node in
FinishSettingUpType() if eligible.

Create ShouldGenerateThumbnail() convinience method in Utilities.h

Change-Id: I454156374ec539f5bb09a61f24b16ebb6a7a95a1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4887
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 7f819534 05-Aug-2021 John Scipione <jscipione@gmail.com>

Tracker: Add thumbnail support

Define thumbnail attributes in Attributes.h:
Media:Thumbnail to store the thumbnail,
Media:Thumbnail:CreationTime to see if thumbs need to be regenerated.

Store 128x128 thumbnail in attribute, for icon sizes smaller than
128x128 down-scale the 128x128 thumbnail. Use B_FILTER_BITMAP_BILINEAR
to down-scale the image using the bilinear scaling algorithm which
creates nicer looking thumbnails than the default scaling algorithm.

Store thumbnails as WebP images which compress smaller than PNGs and
fit in the inode better at 128x128.

Check the file's modification time in GetFileIconFromAttr() and compare
it to the thumbnail creation time. If the file has not been modified
since the last time we generated thumbnails return the thumbnail from
the attribute, otherwise fetch a new thumbnail with GetThumbnailIcon().

Add "Generate image thumbnails" Tracker setting. Default is turned off
for now. To generate image thumbnails you must first turn this setting
on in Tracker Windows preferences.

Spawn a get_thumbnail() thread to generate thumbnails and retrieve them
later on from the window thread to fill out into the icon. This should
improve responsiveness of generating thumbnails from a folder with a
lot of images. The generator thread will write the thumbnail data to an
attribute if on writable BFS volume.

If not on writable BFS volume, the generator thread will send the data
back to the original thread through a port by calling write_port().

When the thread is finished creating the thumbnail it sends a message
back to the Tracker application thread to update the pose which
instructs the window thread to look for an thumbnail. It either finds a
thumbnail in an attribute, or picks up the thumbnail data that has been
sent through write_port() using read_port().

This works on both read-write and read-only BFS volumes but it still
depends on the presence of a BEOS:TYPE parameter to have been written
to the volume before it became read-only. Thumbnail generation does not
work on other read-only volumes for example an ISO-9660 CD, but it does
work on read-only BFS volumes for example the BeOS R5 CD.

Move BPrivate::CheckNodeIconHintPrivate() from BNodeInfo to Tracker
Model CheckNodeIconHint(). Create Model::CheckAppIconHint() and look
for a vector icon or mini and large icon in that method. Check that
the base type is directory, volume, trash, desktop, or if executable
call CheckAppIconHint().

Add 1 to temp_name to fix the following warning:
src/kits/tracker/FSUtils.cpp:2437:12: note: 'snprintf' output 3 or more
bytes (assuming 267) into a destination of size 266

Rename temp_name to tempName following our style guidelines. Use
strlcpy() and strlcat() instead of strcpy() to safely copy the string.
This fixes thumbnail generation on 64-bit Haiku.

Change-Id: I7f927a5a1f8cf65e4b1aa1e0eb55bbfae87fd969
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3163
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# a55e9f52 05-Nov-2018 Axel Dörfler <axeld@pinc-software.de>

Tracker: NavMenu icons scale with font size

* Moved icon size computation into separate utility function.


# 0f03d737 04-Nov-2018 Axel Dörfler <axeld@pinc-software.de>

Tracker: List view icons now grow with font size

* This also removes the mini/large icon mode for list views; it's now
simply always matching your font size.

Change-Id: Ieedd86cc3a50dd0f950d97bbd9839384d44f8bd3
Reviewed-on: https://review.haiku-os.org/662
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 8fdd2629 01-Sep-2016 John Scipione <jscipione@gmail.com>

Tracker: 32x32 icon size option in list mode

16x16 is same old default
32x32 is new and fun

Adjust start offset to depend on icon size

Remove the kColumnStart variable and instead use StartOffset()
method which calculates the column start offset based on the icon
size. When you switch between icon sizes in list mode recalculate
the first column width to make room for the icon or more text.

Add some padding to list height in large icon mode.


# caf0a129 11-Apr-2016 John Scipione <jscipione@gmail.com>

Tracker: Draw IconMenuItem in closed state

Add an Icon() and SetIcon() method. Override SetMarked() to set the
parent menu field icon.

Don't move the label right if icon is NULL. Make the first menu item
an IconMenuItem with a NULL icon. This allows the icon to draw in the
closed menu state.

icon gets updated even if you select an item in a submenu


# 2f5fe16a 14-Feb-2015 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: delete #ifndef __HAIKU__ code.

Since tracker_layout has been merged, this is pretty useless now.
Should result in no change to generated assembly.


# 2f60dea5 29-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Throw exception on assert failure

... in situations where a NULL pointer dereference was vital to the
functioning of the method we use a stronger assert that throws an
exception on failure. This is accomplished by a new method in
Utilities.cpp, ThrowOnAssert().

None of these conditions should ever be true, if they are it means that
the code is written improperly and would have resulted in a NULL
dereference and undefined behavior (most likely a crash) before.

Most instances of ThrowOnAssert() either replace an ASSERT followed
by a dereference or an early return that covered the error.

Also remove _ThrowOnErrorWithMessage() which wasn't being used.


# bc1739a5 17-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: A few more style fixes to Utilities

* 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


# ae7d51b2 02-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Style fixes to IconCache and Utilities


# a4c3bbd3 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to Utilities


# 898f1082 01-Feb-2014 John Scipione <jscipione@gmail.com>

Tracker: Add SecondaryMouseButtonDown method

Create this utility method in Utilities.cpp and use it elsewhere tell if the
secondary mouse button is pressed or if it is emulated with a control-click.


# fb6cc6d8 08-Oct-2013 John Scipione <jscipione@gmail.com>

Move Thread classes from Tracker to shared

So that they may be utilized outside of Tracker


# ea001e58 28-Jul-2012 John Scipione <jscipione@gmail.com>

Round 2 of style changes to Tracker

* focused on 80-char limit fixes.
* also some whitespace and case statement indentation fixes


# b05aa8b5 27-Jul-2012 John Scipione <jscipione@gmail.com>

Style changes in Tracker, no functional change.

Manual whitespace cleanup
Change instances of const char * to const char*
Convert /* */ C style comments to // C++ style comments


# 41836758 02-Mar-2012 Rene Gollent <anevilyak@gmail.com>

Move black/white color constant definitions to header.

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.


# 04847ecc 27-Nov-2011 Philippe Saint-Pierre <stpere@gmail.com>

Fix style coding violation (possibly causing confusion)


# ec9e2f90 27-Nov-2011 Philippe Saint-Pierre <stpere@gmail.com>

No functional change, avoid confusion in Coverity about exceptions

CID 9248, CID 9250, CID 10844, CID 10977, CID 10978, CID 10979, CID 10980,
CID 10981, CID 10982, CID 10983


# 6f477364 21-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Make BLocaleRoster::GetLocalizedFileName() take a const entry_ref& rather than a non-const entry_ref&. Remove private GetLocalizedFileName() from libtracker and make Tracker and Deskbar use the one in BLocaleRoster.

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


# ed7ee7a4 11-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Localization support for filesystem entries in Tracker and Deskbar (leaf menu). (It appears to work, but is likely incomplete and quite possibly incorrect.) Fix issue with RosterData::Refresh() resulting in a B_LOCALE_CHANGED broadcast, and Deskbar looping. Add a global boolean gLocalizedNamePreferred to avoid calling BLocaleRoster::Default()->IsFilesystemTranslationPreferred() too often from Model instances. Following Tracker code style in libtracker, so as to not mix in too much clean-up.

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


# f5c0a997 03-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Support for showing localized app entries in Deskbar. Just the app entries so far, and not yet the items in the leaf menu. Please review.

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


# 9daff332 28-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* moved NaturalCompare() from libtracker.so to libshared.a, in order
to make it available elsewhere


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


# 567ffaec 19-Oct-2010 Rene Gollent <anevilyak@gmail.com>

FetchNaturalChunk() needs to use isspace() just as NaturalCompare does
when retrieving number chunks. Otherwise we wind up with an infinite
loop if a number chunk is preceded by another whitespace char such as
\t. Fixes a hang observed on Clemens' mail store.



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


# b2323020 11-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* The leading spaces and zeros are now actually skipped, instead of copied first
and then replaced.
* Now considers a space to end a number chunk. In the future, we might want to
think about sorting fractional amounts correctly as well, but I guess that's
not that important for Tracker.


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


# 6a960972 11-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* We cannot use a natural sorting algorithm that only supports int32 - that
cannot be stable for entries with up to B_FILE_NAME_LENGTH (256) bytes.
* Rewrote the natural sorting code to be simpler where possible, but also
supports sorting numbers of arbitrary length.


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


# b3e4ce54 31-Jan-2010 Michael Lotz <mmlr@mlotz.ch>

Use the multibyte aware string functions for typeahead search and filtering so
that special characters can be used as well (umlauts for example).


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


# d2b45aa3 20-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

Avoid an invalid GCC warning by using a union.


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


# 4fba3522 11-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed src/kits/tracker/OpenHashTable.h. The shared version in
headers/private/shared is newer, though with small interface changes.
* Removed the unnecessary Debug.h include in
headers/private/shared/ObjectList.h.
* Adjusted sources using these headers, mostly by adding missing includes.
* Lots of automatic whitespace cleanup.


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


# 7ce973c6 01-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Patch by plasm with some modifications by myself: Implement natural sorting
in Tracker. Strings are compared in chunks where the type of each chunk can be
numer or string. Thanks a lot!


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


# 49ad25b3 16-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* The type ahead mechanism did not work correctly in list view mode: instead
of taking the contents of the columns, it would always use the file name
instead.
* That uncovered another bug, though: WidgetText::Text() tried to cast everything
to StringAttributeText, but GenericAttributeText is actually used for most
columns.
* Therefore, GenericAttributeText is now a subclass from StringAttributeText.
* Extended the type ahead to take other columns into account, and made it also
find strings in the middle (like a filter) as a second choice.
* Whitespace cleanup.


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


# 687e327b 19-Jun-2007 Michael Lotz <mmlr@mlotz.ch>

Reworked the handling of periodically updated poses (currently only ones with a volume space bar):

* Addad global list where poses that need periodic updates can be registered with a callback
* Use this mechanism for poses with a volume space bar
* Create only one BVolume when the BPose is created for a volume, instead of every time the free space is calculated
* On Pulse() the global list is used to update all of the registered periodic update poses
* As the poses know their volume, it is no longer necessary to use a BVolumeRoster to loop through each volume on each Pulse()
* Removed the now superfluous SendNotices() mechanism
* Removed corresponding watching / handling of these notices in BPoseView

The BPoseView did a linear search for each volume pose on each Pulse() before. What's more it did this once for each mounted volume as it did get one individual notice for each of them. To get these volumes a BVolumeRoster was used to loop through the volumes, but then the BPose did still create a new BVolume to actually calculate the free space! I'm surprised that it did not suck away more performance with this method...

Anyway, this should bring down BVolume construction and update overhead down to a minimum and hopefully fix ticket #1247.

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


# 4686f4f7 24-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

A little oversight made all icons white on BeOS. This fixes bug #990.


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


# 9ecf9d1c 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


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


# cd94fdda 28-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Tracker wrote icons with the wrong type at several places.
* Also replaced all B_COLOR_8_BIT with the B_CMAP8 constant.


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


# 6d01b66d 13-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

GCC 4 fixes by Ingo Weinhold.


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


# 02be5353 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added libtracker.so to the repository and the build.


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


# 2f5fe16a3e5f838f26b296a2f2926cce407f014f 14-Feb-2015 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: delete #ifndef __HAIKU__ code.

Since tracker_layout has been merged, this is pretty useless now.
Should result in no change to generated assembly.


# 2f60dea53ae5e08baeae2c4e41c89a8d2e74aaa6 29-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Throw exception on assert failure

... in situations where a NULL pointer dereference was vital to the
functioning of the method we use a stronger assert that throws an
exception on failure. This is accomplished by a new method in
Utilities.cpp, ThrowOnAssert().

None of these conditions should ever be true, if they are it means that
the code is written improperly and would have resulted in a NULL
dereference and undefined behavior (most likely a crash) before.

Most instances of ThrowOnAssert() either replace an ASSERT followed
by a dereference or an early return that covered the error.

Also remove _ThrowOnErrorWithMessage() which wasn't being used.


# bc1739a5c56a2e8ab105ef2998cc4768a198a07f 17-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: A few more style fixes to Utilities

* 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


# ae7d51b28a8826a1f8330f28dead633d98cc42bd 02-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Style fixes to IconCache and Utilities


# a4c3bbd3f53b119820305adceeb69f6a061c9be9 20-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to Utilities


# 898f10825072bb17badf64bae8d7334e63a6a683 01-Feb-2014 John Scipione <jscipione@gmail.com>

Tracker: Add SecondaryMouseButtonDown method

Create this utility method in Utilities.cpp and use it elsewhere tell if the
secondary mouse button is pressed or if it is emulated with a control-click.


# fb6cc6d855f553fb19432e5ca53ce63d0f0ad8c3 08-Oct-2013 John Scipione <jscipione@gmail.com>

Move Thread classes from Tracker to shared

So that they may be utilized outside of Tracker


# ea001e585a588e40404945a1201821da893d2e09 28-Jul-2012 John Scipione <jscipione@gmail.com>

Round 2 of style changes to Tracker

* focused on 80-char limit fixes.
* also some whitespace and case statement indentation fixes


# b05aa8b5b16e5b4f420a35c37805c6387df98737 27-Jul-2012 John Scipione <jscipione@gmail.com>

Style changes in Tracker, no functional change.

Manual whitespace cleanup
Change instances of const char * to const char*
Convert /* */ C style comments to // C++ style comments


# 418367589556790e6fb2b2a9cadf62b1408a87c9 02-Mar-2012 Rene Gollent <anevilyak@gmail.com>

Move black/white color constant definitions to header.

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.


# 04847eccdf2a7d2158959b44e4cbf18eb34fdbd4 27-Nov-2011 Philippe Saint-Pierre <stpere@gmail.com>

Fix style coding violation (possibly causing confusion)


# ec9e2f901890930af72f12dcd9fb079e60d0cdba 27-Nov-2011 Philippe Saint-Pierre <stpere@gmail.com>

No functional change, avoid confusion in Coverity about exceptions

CID 9248, CID 9250, CID 10844, CID 10977, CID 10978, CID 10979, CID 10980,
CID 10981, CID 10982, CID 10983


# 6f477364cc55e3d6d26880c79cada179d9f93f76 21-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Make BLocaleRoster::GetLocalizedFileName() take a const entry_ref& rather than a non-const entry_ref&. Remove private GetLocalizedFileName() from libtracker and make Tracker and Deskbar use the one in BLocaleRoster.

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


# ed7ee7a43256baac60e2345f42fc28897cf5585e 11-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Localization support for filesystem entries in Tracker and Deskbar (leaf menu). (It appears to work, but is likely incomplete and quite possibly incorrect.) Fix issue with RosterData::Refresh() resulting in a B_LOCALE_CHANGED broadcast, and Deskbar looping. Add a global boolean gLocalizedNamePreferred to avoid calling BLocaleRoster::Default()->IsFilesystemTranslationPreferred() too often from Model instances. Following Tracker code style in libtracker, so as to not mix in too much clean-up.

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


# f5c0a9970a3acbabb2289a20fdedcc9d1c7b6b7a 03-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Support for showing localized app entries in Deskbar. Just the app entries so far, and not yet the items in the leaf menu. Please review.

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


# 9daff3323bf8d888dd4748427d1e482a939d0f83 28-Jan-2011 Oliver Tappe <zooey@hirschkaefer.de>

* moved NaturalCompare() from libtracker.so to libshared.a, in order
to make it available elsewhere


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


# 567ffaecb936a12f2cd61787aa0f114ff7df4628 19-Oct-2010 Rene Gollent <anevilyak@gmail.com>

FetchNaturalChunk() needs to use isspace() just as NaturalCompare does
when retrieving number chunks. Otherwise we wind up with an infinite
loop if a number chunk is preceded by another whitespace char such as
\t. Fixes a hang observed on Clemens' mail store.



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


# b2323020771d7cef1f5b98cb664b354a89768ab6 11-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* The leading spaces and zeros are now actually skipped, instead of copied first
and then replaced.
* Now considers a space to end a number chunk. In the future, we might want to
think about sorting fractional amounts correctly as well, but I guess that's
not that important for Tracker.


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


# 6a960972b5349596f2f8f11b65ae71407b7d7bf0 11-Aug-2010 Axel Dörfler <axeld@pinc-software.de>

* We cannot use a natural sorting algorithm that only supports int32 - that
cannot be stable for entries with up to B_FILE_NAME_LENGTH (256) bytes.
* Rewrote the natural sorting code to be simpler where possible, but also
supports sorting numbers of arbitrary length.


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


# b3e4ce5422563f8d157a779811c19a452ba102c4 31-Jan-2010 Michael Lotz <mmlr@mlotz.ch>

Use the multibyte aware string functions for typeahead search and filtering so
that special characters can be used as well (umlauts for example).


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


# d2b45aa3ded279afe9658472450ded5eb4c3863a 20-Nov-2009 Stephan Aßmus <superstippi@gmx.de>

Avoid an invalid GCC warning by using a union.


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


# 4fba3522e02906506b6c713ef5b57d72e9458fef 11-Apr-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

* Removed src/kits/tracker/OpenHashTable.h. The shared version in
headers/private/shared is newer, though with small interface changes.
* Removed the unnecessary Debug.h include in
headers/private/shared/ObjectList.h.
* Adjusted sources using these headers, mostly by adding missing includes.
* Lots of automatic whitespace cleanup.


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


# 7ce973c6767b03dfc3a25aaf60e1b83c540ed0c1 01-Apr-2009 Stephan Aßmus <superstippi@gmx.de>

Patch by plasm with some modifications by myself: Implement natural sorting
in Tracker. Strings are compared in chunks where the type of each chunk can be
numer or string. Thanks a lot!


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


# 49ad25b3922a6354639b9fe6325c7c6aa1895e41 16-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* The type ahead mechanism did not work correctly in list view mode: instead
of taking the contents of the columns, it would always use the file name
instead.
* That uncovered another bug, though: WidgetText::Text() tried to cast everything
to StringAttributeText, but GenericAttributeText is actually used for most
columns.
* Therefore, GenericAttributeText is now a subclass from StringAttributeText.
* Extended the type ahead to take other columns into account, and made it also
find strings in the middle (like a filter) as a second choice.
* Whitespace cleanup.


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


# 687e327bace5d8abca3e75ce74a8f532fac5c151 19-Jun-2007 Michael Lotz <mmlr@mlotz.ch>

Reworked the handling of periodically updated poses (currently only ones with a volume space bar):

* Addad global list where poses that need periodic updates can be registered with a callback
* Use this mechanism for poses with a volume space bar
* Create only one BVolume when the BPose is created for a volume, instead of every time the free space is calculated
* On Pulse() the global list is used to update all of the registered periodic update poses
* As the poses know their volume, it is no longer necessary to use a BVolumeRoster to loop through each volume on each Pulse()
* Removed the now superfluous SendNotices() mechanism
* Removed corresponding watching / handling of these notices in BPoseView

The BPoseView did a linear search for each volume pose on each Pulse() before. What's more it did this once for each mounted volume as it did get one individual notice for each of them. To get these volumes a BVolumeRoster was used to loop through the volumes, but then the BPose did still create a new BVolume to actually calculate the free space! I'm surprised that it did not suck away more performance with this method...

Anyway, this should bring down BVolume construction and update overhead down to a minimum and hopefully fix ticket #1247.

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


# 4686f4f71682dba98045cfdb0cc9a24141b3807a 24-Jan-2007 Axel Dörfler <axeld@pinc-software.de>

A little oversight made all icons white on BeOS. This fixes bug #990.


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


# 9ecf9d1c1d4888d341a6eac72112c72d1ae3a4cb 26-Aug-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Merge from layout management branch.


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


# cd94fddab267dad9683764eb2606994ae38479c0 28-Mar-2006 Axel Dörfler <axeld@pinc-software.de>

* Tracker wrote icons with the wrong type at several places.
* Also replaced all B_COLOR_8_BIT with the B_CMAP8 constant.


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


# 6d01b66d300c2841dba033705f120a7f6e709696 13-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

GCC 4 fixes by Ingo Weinhold.


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


# 02be5353fd41ea40007a382e13f007eaf6b5a3a0 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added libtracker.so to the repository and the build.


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