History log of /haiku/src/kits/tracker/Model.cpp
Revision Date Author Comments
# 2b6ccde0 25-Apr-2023 John Scipione <jscipione@gmail.com>

Tracker: Disable edit menu items on ro volumes

... such as virtual directories or read-only media.
Also applies to open/save panels.

Menu items disabled on read-only volumes:
* New >
* Duplicate
* Move to Trash
* Move To >
* Cut
* Paste

Other reasons a menu item is disabled:
* Duplicate, Move To Trash, Cut, Copy, Move to >,
Copy to >, Create link > and Identify require a
selection.
* Paste requires something in your clipboard.
* Edit name requires a single item is selected.

Edit name is permitted on a read-only volume so
that you may copy the name. However the name is
not editable, you may only select and copy.

Pop system folder warning dialog on Edit name
commit instead, this way you won't see the dialog
if you just want to copy the name.

Move "Create link here" option last in the right-
click drag menu. Disable "Move here" if source or
dest is read-only, rest if dest is read-only.

Ignore Paste to virtual directory, (even more)
but permit Edit name.

Allow drag-and-drop to virtual directory but alert
and disable all right-click drag menu items like
other read-only directories.

Tint window backgrounds on all read-only windows
darker, not just on virtual and query folders.
Automatically switch the background color as you
navigate in and out of read-only folders.

Fix highlight color on column resize when background
color is not white. Fix "reverse video" effect so
that the highlight color is the inverse of the
background color. On Desktop however, highlight
color is always black or white.

Do not alter focus in save dialogs after initial
focus on the file name because focus on the pose
view is required for cut/copy/paste to work.

Make Edit Name work in file open/save dialogs and
make Cut/Copy/Paste work while editing file name.

Make Select all work in Edit name.

Duplicate code cleanup:

NameAttributeText::CommitEditedTextFlavor() and
HeaderView::FinishEditingTitle() call common
EditModelName() function in FSUtils.

RealNameAttributeText inherits from
NameAttributeText and calls its inherited
CommitEditedTextFlavor() method.

The alert text is defined in just one place in
FSUtils ShouldEditRefName() instead of three.
Consequently file name changed in the info window
can now be undone.

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


# a63a6739 23-Apr-2023 John Scipione <jscipione@gmail.com>

Tracker: Whitespace, alphabetize style fixes

No functional change intended.

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


# 6e8c897e 30-Oct-2022 PulkoMandy <pulkomandy@pulkomandy.tk>

Tracker: Always use thumb attr when there is one

... even when the "Generate image thumbnails" setting is off.

This allows applications to generate thumbnails for 'non-media' files.
For example I use this in the ACE Amstrad CPC Emulator, to add a
thumbnail to emulator savestates (snapshots) with a screen capture of
the machine.

Change-Id: I95b0e4c64f5b1ffa779512755f70cfd9c1881661
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5768
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: nephele <nep@packageloss.eu>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 6750cef9 26-Apr-2022 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Thumbnail attribute changes should cause an icon refresh.

This way, a full mimeset need not be run to trigger an icon update,
and also other applications can write thumbnails and trigger updates.


# 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.)


# 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>


# abef198c 31-Dec-2021 Adrien Destugues <pulkomandy@pulkomandy.tk>

Tracker: fix logic to use custom icons.

Regression caused by refactorings in hrev55348.

The logic for deciding when to use a built-in tracker icon was changed
incorrectly to ignore attributes on directories, trash, etc (anything
but executable applications). So the built-in icon was always used.

This commit restores the previous logic.

Shoud fix #17320 and #17371

Change-Id: I51ba22db59a8b6dd2bd1121b56c753ed47224c57
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4841
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 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>


# 707c912e 15-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Remove "launch broken link" cruft.

As the comment says, this was a pre-R5 (!) hack for Be's CIFS driver.


# d3628dcd 10-Nov-2015 John Scipione <jscipione@gmail.com>

IK: Move CheckNodeIconHintPrivate to Tracker

* Move BPrivate::BNodeInfo::CheckNodeIconHintPrivate() to Tracker's
Model class.
* Rename HasVectorIconHint(BNode*) to CheckNodeIconHint(BNode*).
and make it check not only for vector icons but also if you have
BOTH large and mini icons.
* Replace instances of CheckNodeIconHintPrivate() with the newly
created CheckNodeIconHint().


# eb866045 08-May-2015 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Model: use SetToFormat.


# 7ef62fb6 27-Feb-2015 John Scipione <jscipione@gmail.com>

Tracker: Style fixes

* Style fixes to QueryContainerWindow.h
* Style fixes to ContainerWindow
* Style fixes to Model
* Style fixes to Tracker
* Style fixes to PoseView
- Most of the changes come from unindenting the code


# 9e78efbb 27-Feb-2015 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: delete un-needed #includes.

All of these header files are already included by the .h file that
corresponds to the .cpp file.


# 5288f773 27-Jan-2015 John Scipione <jscipione@gmail.com>

Tracker: Reorder include alphabetically

No functional change intended, corrected in feature branch, but
unrelated to feature. Having this change in tree will make keeping
my Tracker feature branches up to date slightly easier.


# 9cc03189 28-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Add NULL checks and ASSERTs

To prevent recoverable NULL pointer dereferences. Dereferencing a
NULL pointer is undefined behavior and should be avoided.

Unrecoverable NULL checks will be dealt with in the next commit.


# 3aeed660 07-Aug-2014 Jérôme Duval <jerome.duval@gmail.com>

include strings.h where appriopriate...

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


# 8dd0b0ae 14-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to Model


# d7e68211 04-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: miscellaneous style fixes


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

Tracker: style fixes to Model class


# 9437e677 09-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: Style fixes


# 1c29b26e 29-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add virtual directory feature to Tracker

Similar to stored queries, files of the virtual directory type behave
like directories -- i.e. they open in a list-mode Tracker window and
show up as an item with submenu in navigation menus. The file itself is
a plain text file in driver settings format. It can have an arbitrary
number of "directory" entries, which specify the paths of (actual)
directories for which the virtual directory provides a merged view. The
view will not show duplicate entries. For non-directory entries the
first one encountered (according to the order the directory paths are
specified in the file) will be shown. A subdirectory entry will again
behave like a virtual directory.

The support in Tracker isn't perfect yet. I'm afraid major refactoring
would be necessary to get it there.

The virtual directory file type uses a differently colored version of
the folder icon. Alternatives welcome.


# 96c30cc8 03-Sep-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: fix warning in gcc2

Refactor a bit the conditions to avoid a warning.


# 139ee879 03-Sep-2012 Rene Gollent <anevilyak@gmail.com>

Fix some behavioral regressions introduced by previous commit.

- Some parts of Tracker were basing certain assumptions on whether the
types list was NULL or not. We now check on list emptiness instead.


# d6c852ec 19-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Actually cache something when CacheLocalizedName is called.

Before its name was a lie, since nothing was cached.

Another boolean was added because getting the localized name could fail, and we
don't want to pointlessly try again, so relying on fHasLocalizedName won't work
for that.

Since in my tests this was getting called up to 4 times per application when
opening the Deskbar Application menu, this caching should speed that up a bit,
at least when this file name translation feature is turned on.


# c2535dc4 07-Aug-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: various issues regarding filtering

1. A BRefFilter-ed PoseView wouldn't keep monitoring files after its opening
thus not picking up files that happen to fit the filter thereafter (mime attr
updated, etc..)
2. A filtered PoseView wouldn't get updated when:
a) a column was added or removed
b) a file was renamed
c) a file was moved
3. Harmonize the way BRefFiltering and Type-ahead filtering are working. Both
can be used together.
4. The handler for AttributeChanged() wasn't working properly if link(s) of a
changed model was/were its siblings.
5. Broken links weren't detected/updated (it nows monitor the lost target
parent directory, and wait for the target creation to show the link fixed)

This is a big change (even more considering the 'critical-ness' of the component)
Testing is MUCH welcome!

Should fix #4254, #5381, #1717 (and maybe others)


# adf8818e 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Compilation fixes for Terminal, add to image.

It runs, but has shown up various bugs: app_server crashes, kernel
panics, rendering problems. Working on fixing these now.


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

WIP: Yet more style fixes, mostly 80 char violations.


# 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


# 5cdd07a8 23-Jul-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: Optimisation of AddonMenu menu construction

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.


# 674ff0df 22-Jul-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: Various sorting issues in Tracker

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.


# 546208a5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* 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.


# 3773b475 10-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Tracker: Sort volumes like folders

Volumes no longer have a higher sorting priority than folders when "sort
folders first" is enabled.


# ee6a2e55 27-Mar-2011 Jonas Sundström <jonas@kirilla.com>

* Extend the Model class with a method bool HasLocalizedName().
* Disallow renaming of entries with localized names for now - this is meant to be temporary - and so far only in Tracker's Info window. Renames do not result in a change, visually, as the localized name hides the real name, and results in a bad user experience. One could possibly allow renames of the localized name, writing it back to the catalog. I've experimented with using BCatalogAddOn::SetString() but haven't been able to make it stick yet.
* Disallow renaming Trash in Tracker's Info window via Command-E.
* Adjust the argument order of BLocaleRoster::GetLocalizedFileName().
* Add a BLocaleRoster::GetLocalizedFileName() variant to look up another app's name given its signature and unlocalized, canonical name.

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


# 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


# 7b80b5d5 17-Sep-2010 Alexandre Deckner <alex@zappotek.com>

* Use multiple translate contexts in Tracker for easier translation


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


# 886c6276 12-Sep-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed debug build (format string/argument mismatches).


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


# 8eff03f5 25-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* fixed all build warnings by collectcatkeys that I found
* automatic whitespace cleanup

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


# 4ed28a57 12-Jul-2010 Alexandre Deckner <alex@zappotek.com>

* Applied libtracker localization patch from T.Murai (a.k.a mt) with some modifications (see below).
* Functional modifications:
Reworked InfoWindow file size localization, the patch removed number formating (size in bytes) and was too complicated to my taste.
Replaced the uses of sprintf with the safer snprintf.
Changed signature to x-vnd.Haiku-libtracker instead of x-vnd.Haiku-libTracker (to be consistent with the binary name)
* Style modifications:
Reworked lots of 80 char indenting (probably due to the now shorter line lengths since your previous patch that wasn't using the macros)
Lots of missing brackets when "if's" becomes multiline.
Other minor fixes.

Noticed a few uses of FindItem on translated names that might become problematic someday. Added some TODO's regarding localization of file sizes. Localization might still be
optimized a bit regarding the produced en.catkeys

Note to translators: .catkeys files should be placed in haikusource/data/catalogs/kits/tracker though beware as the base en.catkeys might change
slightly in the next days.
Note to users: As with any other app you need to restart Tracker (or any aother app using libtracker's filepanels) for it to pick the locale setting. E.g: use 'quit an
application' and 'restart Tracker' from process controller.

Thanks a lot T.Murai


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


# cee04e80 08-Feb-2010 Artur Wyszynski <aljen-mlists@o2.pl>

Fixed various errors/warnings reported by cppcheck:
* memory leaks
* resource leaks
* added const's to getters
* removed a few reundant conditions


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


# 89af0548 17-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Employ a similar naming abstraction for the desktop as has been done for Trash to allow that name to be localized visually later (same on-disk location though).
SlowContextPopup also needed to be adjusted to account for trash's new location.



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


# 0e848e2d 17-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Fix error spotted by Adrien: don't return Trash name for anonymous volumes.



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


# 6abd81fc 17-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Add a special node type for the Trash analogous to the one used for the root dir. This allows the model to return an arbitrary name not directly tied to the on-disk name for the Trash directory, which a) makes it localizable in the future, and b) means it's not tied to the on-disk name, which removes the requirement that the Trash dir name be uppercase on disk.



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


# 01dffd8e 14-Jan-2010 Rene Gollent <anevilyak@gmail.com>

More Tracker refactoring:
* relocated Trash dirs to volume roots by modifying find_directory() to report the trash location as volume/Trash.
* FSUtils no longer creates /home/Desktop on every volume.
* TrashWatcher now keeps icons in sync on all volumes.
* Simplified FSGetDeskDir since it no longer has to worry about getting the desk directory on any volume other than the root.
* Relocated trash context menu logic to BContainerWindow so it can also be used at the volume roots.
* DesktopPoseView now creates a virtual Trash pose representing the trash contents as before.
* Corrected typo: Model::WriteAttrKillForegin() -> Model::WriteAttrKillForeign().

Closes ticket #5245.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35085 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


# 6e927a5f 30-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

malloc.h ain't no standard header. Use stdlib.h instead.


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


# f6e4cbb9 15-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 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


# 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


# eb8660457a9a478f88c379605b039e0484c43790 08-May-2015 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Model: use SetToFormat.


# 7ef62fb6c2485f91ba49b0cde5e73e62687375e9 27-Feb-2015 John Scipione <jscipione@gmail.com>

Tracker: Style fixes

* Style fixes to QueryContainerWindow.h
* Style fixes to ContainerWindow
* Style fixes to Model
* Style fixes to Tracker
* Style fixes to PoseView
- Most of the changes come from unindenting the code


# 9e78efbb4d21a6821be64e5053defd99ed364aea 27-Feb-2015 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: delete un-needed #includes.

All of these header files are already included by the .h file that
corresponds to the .cpp file.


# 5288f7733b564e54d0ddb4ef7345fe3be849fa7e 27-Jan-2015 John Scipione <jscipione@gmail.com>

Tracker: Reorder include alphabetically

No functional change intended, corrected in feature branch, but
unrelated to feature. Having this change in tree will make keeping
my Tracker feature branches up to date slightly easier.


# 9cc03189faa3cb4923d63a897435f56ec98c62b0 28-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Add NULL checks and ASSERTs

To prevent recoverable NULL pointer dereferences. Dereferencing a
NULL pointer is undefined behavior and should be avoided.

Unrecoverable NULL checks will be dealt with in the next commit.


# 3aeed6607cd07762c0e709633c012b3a632dbad9 07-Aug-2014 Jérôme Duval <jerome.duval@gmail.com>

include strings.h where appriopriate...

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


# 8dd0b0aeac1b8f1f7427c7c494a0bb0e636eb195 14-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes to Model


# d7e682113776632e5c04a6558eca0c5650a164e4 04-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: miscellaneous style fixes


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

Tracker: style fixes to Model class


# 9437e677ba3d5f813929944ae2b09fc37feb8d2d 09-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: Style fixes


# 1c29b26e7c7eb94ee125315eca5a94265f613420 29-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Add virtual directory feature to Tracker

Similar to stored queries, files of the virtual directory type behave
like directories -- i.e. they open in a list-mode Tracker window and
show up as an item with submenu in navigation menus. The file itself is
a plain text file in driver settings format. It can have an arbitrary
number of "directory" entries, which specify the paths of (actual)
directories for which the virtual directory provides a merged view. The
view will not show duplicate entries. For non-directory entries the
first one encountered (according to the order the directory paths are
specified in the file) will be shown. A subdirectory entry will again
behave like a virtual directory.

The support in Tracker isn't perfect yet. I'm afraid major refactoring
would be necessary to get it there.

The virtual directory file type uses a differently colored version of
the folder icon. Alternatives welcome.


# 96c30cc820dc6031e85e264dcad55fc1a2caea52 03-Sep-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: fix warning in gcc2

Refactor a bit the conditions to avoid a warning.


# 139ee879031c4cfc9fcf3434f2d577402a91ad4c 03-Sep-2012 Rene Gollent <anevilyak@gmail.com>

Fix some behavioral regressions introduced by previous commit.

- Some parts of Tracker were basing certain assumptions on whether the
types list was NULL or not. We now check on list emptiness instead.


# d6c852ec49df1af8400a62ab7a2eb950b50f1de0 19-Aug-2012 Ryan Leavengood <leavengood@gmail.com>

Actually cache something when CacheLocalizedName is called.

Before its name was a lie, since nothing was cached.

Another boolean was added because getting the localized name could fail, and we
don't want to pointlessly try again, so relying on fHasLocalizedName won't work
for that.

Since in my tests this was getting called up to 4 times per application when
opening the Deskbar Application menu, this caching should speed that up a bit,
at least when this file name translation feature is turned on.


# c2535dc48a28016ead05c4ebf522f018dc770429 07-Aug-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: various issues regarding filtering

1. A BRefFilter-ed PoseView wouldn't keep monitoring files after its opening
thus not picking up files that happen to fit the filter thereafter (mime attr
updated, etc..)
2. A filtered PoseView wouldn't get updated when:
a) a column was added or removed
b) a file was renamed
c) a file was moved
3. Harmonize the way BRefFiltering and Type-ahead filtering are working. Both
can be used together.
4. The handler for AttributeChanged() wasn't working properly if link(s) of a
changed model was/were its siblings.
5. Broken links weren't detected/updated (it nows monitor the lost target
parent directory, and wait for the target creation to show the link fixed)

This is a big change (even more considering the 'critical-ness' of the component)
Testing is MUCH welcome!

Should fix #4254, #5381, #1717 (and maybe others)


# adf8818ec004e8a20614523f3e893303ea318642 05-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Compilation fixes for Terminal, add to image.

It runs, but has shown up various bugs: app_server crashes, kernel
panics, rendering problems. Working on fixing these now.


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

WIP: Yet more style fixes, mostly 80 char violations.


# 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


# 5cdd07a8148b04cd1b7e29778ec0661df7dbe46d 23-Jul-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: Optimisation of AddonMenu menu construction

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.


# 674ff0df2f2eb00cbc78b4384fcf5b148a2139ff 22-Jul-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: Various sorting issues in Tracker

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.


# 546208a53940a26c6379c48a7854ade1a8250fc5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* 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.


# 3773b4751472f62d68a29116ac9c1508ef7b2a63 10-Jul-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Tracker: Sort volumes like folders

Volumes no longer have a higher sorting priority than folders when "sort
folders first" is enabled.


# ee6a2e5589a8ff169bb64870650b8f194aa9da14 27-Mar-2011 Jonas Sundström <jonas@kirilla.com>

* Extend the Model class with a method bool HasLocalizedName().
* Disallow renaming of entries with localized names for now - this is meant to be temporary - and so far only in Tracker's Info window. Renames do not result in a change, visually, as the localized name hides the real name, and results in a bad user experience. One could possibly allow renames of the localized name, writing it back to the catalog. I've experimented with using BCatalogAddOn::SetString() but haven't been able to make it stick yet.
* Disallow renaming Trash in Tracker's Info window via Command-E.
* Adjust the argument order of BLocaleRoster::GetLocalizedFileName().
* Add a BLocaleRoster::GetLocalizedFileName() variant to look up another app's name given its signature and unlocalized, canonical name.

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


# 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


# 7b80b5d5181053872dd475b1c559bc010914a31c 17-Sep-2010 Alexandre Deckner <alex@zappotek.com>

* Use multiple translate contexts in Tracker for easier translation


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


# 886c627650b0f2522e8a64dd96371cc45a867330 12-Sep-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed debug build (format string/argument mismatches).


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


# 8eff03f5705966c294c96a4e249bb525069b8e78 25-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* fixed all build warnings by collectcatkeys that I found
* automatic whitespace cleanup

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


# 4ed28a571a7d5f7f13b5b4636fabfeabdfddd40b 12-Jul-2010 Alexandre Deckner <alex@zappotek.com>

* Applied libtracker localization patch from T.Murai (a.k.a mt) with some modifications (see below).
* Functional modifications:
Reworked InfoWindow file size localization, the patch removed number formating (size in bytes) and was too complicated to my taste.
Replaced the uses of sprintf with the safer snprintf.
Changed signature to x-vnd.Haiku-libtracker instead of x-vnd.Haiku-libTracker (to be consistent with the binary name)
* Style modifications:
Reworked lots of 80 char indenting (probably due to the now shorter line lengths since your previous patch that wasn't using the macros)
Lots of missing brackets when "if's" becomes multiline.
Other minor fixes.

Noticed a few uses of FindItem on translated names that might become problematic someday. Added some TODO's regarding localization of file sizes. Localization might still be
optimized a bit regarding the produced en.catkeys

Note to translators: .catkeys files should be placed in haikusource/data/catalogs/kits/tracker though beware as the base en.catkeys might change
slightly in the next days.
Note to users: As with any other app you need to restart Tracker (or any aother app using libtracker's filepanels) for it to pick the locale setting. E.g: use 'quit an
application' and 'restart Tracker' from process controller.

Thanks a lot T.Murai


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


# cee04e8074ec61fd8c6dac3539c5b821c3618888 08-Feb-2010 Artur Wyszynski <aljen-mlists@o2.pl>

Fixed various errors/warnings reported by cppcheck:
* memory leaks
* resource leaks
* added const's to getters
* removed a few reundant conditions


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


# 89af054816a9b1fbaabe8297da758015bf417d4d 17-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Employ a similar naming abstraction for the desktop as has been done for Trash to allow that name to be localized visually later (same on-disk location though).
SlowContextPopup also needed to be adjusted to account for trash's new location.



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


# 0e848e2d694cdf7969b8544d9c7b1db2a587aecc 17-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Fix error spotted by Adrien: don't return Trash name for anonymous volumes.



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


# 6abd81fcf093254a00ea9e80e0571f6fa416f9ee 17-Jan-2010 Rene Gollent <anevilyak@gmail.com>

Add a special node type for the Trash analogous to the one used for the root dir. This allows the model to return an arbitrary name not directly tied to the on-disk name for the Trash directory, which a) makes it localizable in the future, and b) means it's not tied to the on-disk name, which removes the requirement that the Trash dir name be uppercase on disk.



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


# 01dffd8edd94699ac1e6f2cc4322555f2171da14 14-Jan-2010 Rene Gollent <anevilyak@gmail.com>

More Tracker refactoring:
* relocated Trash dirs to volume roots by modifying find_directory() to report the trash location as volume/Trash.
* FSUtils no longer creates /home/Desktop on every volume.
* TrashWatcher now keeps icons in sync on all volumes.
* Simplified FSGetDeskDir since it no longer has to worry about getting the desk directory on any volume other than the root.
* Relocated trash context menu logic to BContainerWindow so it can also be used at the volume roots.
* DesktopPoseView now creates a virtual Trash pose representing the trash contents as before.
* Corrected typo: Model::WriteAttrKillForegin() -> Model::WriteAttrKillForeign().

Closes ticket #5245.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35085 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


# 6e927a5fc080cb934e7584454f472cacf4c3e361 30-Oct-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

malloc.h ain't no standard header. Use stdlib.h instead.


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


# f6e4cbb95290a74b33d012600438b84742b0e572 15-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Rewrote BeBuild.h which had "a few" consequences (got rid of all those class
definitions).
* Minor cleanup here and there.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22577 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


# 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