History log of /haiku/src/kits/tracker/OpenWithWindow.cpp
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>


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


# 59d0a832 28-Sep-2022 Augustin Cavalier <waddlesplash@gmail.com>

Remove "font size / 12" calculations from various places.

Use spacing values from BControlLook instead.


# 95ca8eef 09-Sep-2022 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Privatize most members of BPoseView.

Greatly reduces what is available to inherited classes.
No functional change intended.


# 054c1b27 31-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Overhaul list column size initialization and storage.

Mostly for HiDPI, but this also cleans up the code in general, too.

* Apply a scale-factor when loading and serializing column size/offsets
in ViewState.

* Do not hard-code offset values for default columns but let
BPoseView::AddColumn() compute them manually instead.

* Change BPoseView::AddColumn() to support being called during
early initialization and utilize it in SetUpDefaultColumns...().

* When adding deserialized columns to a BPoseView, always realign
the offsets instead of just doing sanity checking. The rationale here
is that the first time the TitleView is touched, it will do this
anyway, and cause "snapping" or drawing glitches if the alignment
is not as expected.

If it was actually somehow an intended feature that non-adjacent
columns can be displayed, changes are needed in TitleView and PoseView
to properly support this without triggering redraw glitches.

I still saw some very slight redraw glitches (e.g. column contents
shifting by 1px) at higher font sizes; however, Tracker before this
commit had far more of those glitches (this commit seems to resolve
a number of them.)

Tested with 12pt, 18pt, and 20pt font sizes; this seems to work
pretty well. But if you see strange behavior or more redraw glitches
than there were previously, please do file a ticket.


# 75e66d61 13-Jul-2022 John Scipione <jscipione@gmail.com>

Tracker: Improve repeated apps in Open with... menu

If you have multiple Haiku installations mounted, it is common to
have the same app on multiple volumes. This makes the Open with...
menu show the full paths truncating them which makes it tough to
see the app name you're looking for.

Show volume and app names for repeated apps in Open with... menu
instead of showing the full path. Keep track of whether each app in
the list is a repeat and only display the volume for those.

If there is only 1 app name, print it.
If >1 app name and volume names are different, print
[volume name] app name
If >1 app name but volume names are the same, print full path

Because many apps are in packages the volume is listed as [system]

Make kMaxMenuWidth a bit wider.

Compare app names and volume names using locale collator.

Sort by name, determine labels, then sort by relation because
repeats are not always consecutive once sorted by relation.

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


# a29f0661 14-Mar-2021 Jaidyn Ann <jadedctrl@teknik.io>

Tracker: Don't use hardcoded colors for the Open With window

Change-Id: Idb7b336006391da3d64b7f395e87ff30c07d3100
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3797
Reviewed-by: humdinger <humdingerb@gmail.com>


# 48a6df08 16-Sep-2018 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: Eliminate the double border in the OpenWithWindow.

Change-Id: I43e9b15c4cd7f4986fa7c1231cc8ca89676866bf
Reviewed-on: https://review.haiku-os.org/575
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.


# 777ff371 27-Jul-2016 Murai Takashi <tmurai01@gmail.com>

Tracker: Fix -Wlogical-not-parentheses

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>

With style fix: comparison must still be a boolean value.

Fixes #12892


# a449e230 19-Jul-2016 Axel Dörfler <axeld@pinc-software.de>

Tracker: Made open-with menu scale with font size.


# 2bd0b27f 08-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

Tracker: Fix use-after-free by ref filter of OpenWithPoseView.

Commit ea8b1e14 changed OpenWithPoseView from using ShouldShowPose for
filtering poses to a BRefFilter. The introduced ref filter used the
iterator handed to the BPoseView::AddPosesTask which took ownership
of that iterator and deleted it as soon as it was done. Since actually
adding the poses as well as further filtering is asynchronous and
happens after the AddPosesTask completes, the iterator was used after
it was already deleted.

Introduce BPoseView::ReturnDirentIterator() that is called after the
AddPosesTask is complete. The default version deletes the iterator,
the OpenWithPoseView overrides it and does nothing, it deletes the
iterator in the destructor instead.

Also fix leaking the ref filter. The BPoseView does not take ownership
of the filter as it usually comes from a BFilePanel which is documented
to not take ownership.


# 0a74a005 08-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

Tracker: Remove two outdated comments, whitespace cleanup.


# e7803cf1 26-Jan-2015 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: use the Layout API wherever possible.

Sorry this commit is so big, but I couldn't figure out how to do this
incrementally without breaking things.

I wasn't able to just merge Aldeck's branch, as it was a partial refactor
of Tracker and didn't just rewrite the UI creation code to use layouts,
and the changes for PM (e.g. addon loading, virtual directories) made it
very hard to merge (it doesn't even compile after an automerge) so rather
than spending time on that, I decided it'd be better to recreate his work.

Miscellaneous notes:
- This partially cleans up BPoseView & subclasses and BContainerWindow &
subclasses -- none of the subclasses and child views abuse the parent's
state, child views, or layout now.
- BFilePanel and BDeskWindow are not on layouts, because:
* BFilePanel docs in the Be Book instructed developers that wanted to
modify BFilePanel's layout to just use FindView() and then move the
views around. Obviously making it use layouts will break all BeOS
apps that do this, and there are a lot of them (Pe, WonderBrush are
just two examples.) I've added a note to the TODO list for R2 to create
a layout-compatible API for this.
* Some replicants (Workspaces, for example) rely on manipulating
BDeskWindow's drawing state. This is incompatible with layouts, as
at least in the case of Workspaces, it breaks a layouted version
of BDeskWindow entirely.
- I noticed a lot of #ifdef BEOS_VERSION ... gunk in the code. Tracker
probably didn't build on BeOS just before this commit, and now it
won't for sure, so I intend to go through and clean that out in the
near future.

This commit also fixes:
- enhancement #4996 (make Tracker's navigator use vector icons)
- bug #3039 (resizing OpenWithWindow flashes the blue border)
- bug #3889 (OpenWithWindow redraw errors)
- a regression that was a side effect of "dynamic_cast<BDeskWindow*>(this)"
always returning NULL when run in the constructor. I just added a "bool
isDeskWindow" to BContainerWindow's constructor that is only set to true
by BDeskWindow.
- a copy&paste error in VirtualDirectoryPoseView that was passing "uint32
resizeMode" as "uint32 viewMode".

Thanks to Alexandre for his original branch (it was a very useful
reference), Axel (for some miscellaneous advice & encouragement),
Adrien & Humdinger (for user interface review), and Diver (for user
interface review & testing).


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


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


# 54e2dd72 28-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes

No functional changes intended.


# 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


# b992df89 18-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Don't crash clicking Open with... menu item

This bug was introduced in hrev47498

The reason Tracker crashed was because OpenWithContainerWindow
had a NULL TargetModel() which we were trying to dereference.

Fix this by creating an empty model in OpenWithContainerWindow. Add an
ASSERT to check that the TargetModel() is not NULL in the future.

Another way to fix this bug would have been to check that TargetModel() wasn't
NULL each time before we use it. I didn't go with that solution because we
assume TargetModel() is not NULL in a lot of places so it would be a lot of work
to check them all. I think it's better to give OpenWithContainerWindow a dummy
model even though it doesn't make sense for it to have one just so that we don't
crash when we try to dereference the pointer.


# 6527415d 18-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: obligatory round of style fixes

* Explicit NULL checks
* whitespace
* single line if gets no {}'s
*


# 512c80ef 21-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: add back parens


# 64fda603 21-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: fix accidential logic reversal


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

Tracker: Use floats in OpenWithWindow calculations


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

Tracker: Style fixes to OpenWithWindow


# 6c6fcaf9 20-Dec-2012 Alex Smith <alex@alex-smith.me.uk>

Some build fixes for DEBUG=1.


# d6a17f3d 25-Nov-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: fix memory leak in OpenWithFilter. (CID #715684)


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

OpenWithWindow: Fix crash at closing, and fix filtering

Following hrev44493, the way ShouldShowPose was used changed a bit,
to harmonize with type ahead filtering.

This updates OpenWithWindow to use a BRefFilter to do its
filtering rather than overloading ShouldShowPose.


# aed35104 05-Aug-2012 Humdinger <humdingerb@gmail.com>

Close alerts with ESCAPE key.

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.


# 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


# 851c719d 04-Jul-2012 Humdinger <humdingerb@gmail.com>

Small text changes in alert when renaming/moving special folders.

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.


# 72b7db34 21-May-2012 Reznikov Sergei <diver@gelios.net>

Added resize to fit shortcuts. Partially fixes #7467.

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


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


# 5c6b9eb0 23-Feb-2012 Jerome Duval <jerome.duval@gmail.com>

Some fixes for GCC 4.6 warning: variable set but not used


# 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


# ad76f443 16-Sep-2010 Alexandre Deckner <alex@zappotek.com>

* Build fix, see ticket 6374
* 80 char limit fix



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


# 108f794c 16-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by mt: Translate various yet untranslated strings in libtracker,
closes ticket #6374. Thanks a bunch!


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


# 1f34e928 14-Jul-2010 Alexandre Deckner <alex@zappotek.com>

* Removed last remains of the OPEN_TRACKER define.
* Cleanup of unused include.


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


# 82d8aaf8 12-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Humdinger:
Changed strings to sentence case. The changes in StatusWindow and
FSUtils are missing because I have some unfinished work in progress
in those files. Will commit them separately. This is case-tracker.diff
from #5169.


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


# 107d2b33 26-Apr-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

Only try to add the preferred app if it can be found, otherwise the Open With
menu would be completelly empty.



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


# 019f90e6 05-Apr-2009 Jonas Sundström <jonas@kirilla.com>

Setting the escape key as shortcut for the Cancel options of Tracker's dialogs.

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


# 4f3347b6 03-Feb-2009 Joachim Seemer <humdingerb@googlemail.com>

As discussed here:
https://lists.berlios.de/pipermail/haiku-commits/2009-February/014198.html
We decided on a distinction between path+filename and only the path to a file.
I changed the places a user is exposed to the issue, using the definition:
Path with filename: "Path"
Path without filename: "Location"


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


# b2f91e61 11-Jan-2009 Karsten Heimrich <host.haiku@gmx.de>

* Prevent the B_OBSERVER_NOTICE_CHANGE to get passed on to ContainerWindow, since
this would crash Tracker in case the 'Open With' window is shown and one try's
to set, e.g 'Show full path in title' or 'Show Navigator' etc.



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


# d881bedf 04-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* We must not sort the cached inodes, or else we mess up the order for
CanOpenWithFilter().
* This fixes bug #2795.


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


# f28ab87b 04-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Added "sortInodes" parameter to CachedEntryIteratorList constructor.
* Moved static CompareInode() to CachedEntryIterator::_CompareInodes().
* Cleanup.


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


# 979fca9d 28-Sep-2006 Axel Dörfler <axeld@pinc-software.de>

Minor cleanup.


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


# 269d3bd5 11-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

Imported PoseView.cpp 1.61, OpenWithWindow.cpp 1.8, and OpenWithWindow.h 1.3
from OpenTracker CVS.
This fixes bug #354.


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


# 3b5cc3b1 31-May-2006 Axel Dörfler <axeld@pinc-software.de>

MIME types are case insensitive, so Tracker should not be so picky.
The app queries still are case sensitive, though (shouldn't hurt, as the MIME
type database preserves the case).


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


# 66d3076d 31-May-2006 Axel Dörfler <axeld@pinc-software.de>

Cleanup, no functional change.


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


# 2bd0b27f5d9720741ba72afa21de0470b7521d13 08-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

Tracker: Fix use-after-free by ref filter of OpenWithPoseView.

Commit ea8b1e14 changed OpenWithPoseView from using ShouldShowPose for
filtering poses to a BRefFilter. The introduced ref filter used the
iterator handed to the BPoseView::AddPosesTask which took ownership
of that iterator and deleted it as soon as it was done. Since actually
adding the poses as well as further filtering is asynchronous and
happens after the AddPosesTask completes, the iterator was used after
it was already deleted.

Introduce BPoseView::ReturnDirentIterator() that is called after the
AddPosesTask is complete. The default version deletes the iterator,
the OpenWithPoseView overrides it and does nothing, it deletes the
iterator in the destructor instead.

Also fix leaking the ref filter. The BPoseView does not take ownership
of the filter as it usually comes from a BFilePanel which is documented
to not take ownership.


# 0a74a00526901d507086cac0592c9940efc24e60 08-Apr-2015 Michael Lotz <mmlr@mlotz.ch>

Tracker: Remove two outdated comments, whitespace cleanup.


# e7803cf1f69a81b1c77880518ba16b6708c1efdb 26-Jan-2015 Augustin Cavalier <waddlesplash@gmail.com>

Tracker: use the Layout API wherever possible.

Sorry this commit is so big, but I couldn't figure out how to do this
incrementally without breaking things.

I wasn't able to just merge Aldeck's branch, as it was a partial refactor
of Tracker and didn't just rewrite the UI creation code to use layouts,
and the changes for PM (e.g. addon loading, virtual directories) made it
very hard to merge (it doesn't even compile after an automerge) so rather
than spending time on that, I decided it'd be better to recreate his work.

Miscellaneous notes:
- This partially cleans up BPoseView & subclasses and BContainerWindow &
subclasses -- none of the subclasses and child views abuse the parent's
state, child views, or layout now.
- BFilePanel and BDeskWindow are not on layouts, because:
* BFilePanel docs in the Be Book instructed developers that wanted to
modify BFilePanel's layout to just use FindView() and then move the
views around. Obviously making it use layouts will break all BeOS
apps that do this, and there are a lot of them (Pe, WonderBrush are
just two examples.) I've added a note to the TODO list for R2 to create
a layout-compatible API for this.
* Some replicants (Workspaces, for example) rely on manipulating
BDeskWindow's drawing state. This is incompatible with layouts, as
at least in the case of Workspaces, it breaks a layouted version
of BDeskWindow entirely.
- I noticed a lot of #ifdef BEOS_VERSION ... gunk in the code. Tracker
probably didn't build on BeOS just before this commit, and now it
won't for sure, so I intend to go through and clean that out in the
near future.

This commit also fixes:
- enhancement #4996 (make Tracker's navigator use vector icons)
- bug #3039 (resizing OpenWithWindow flashes the blue border)
- bug #3889 (OpenWithWindow redraw errors)
- a regression that was a side effect of "dynamic_cast<BDeskWindow*>(this)"
always returning NULL when run in the constructor. I just added a "bool
isDeskWindow" to BContainerWindow's constructor that is only set to true
by BDeskWindow.
- a copy&paste error in VirtualDirectoryPoseView that was passing "uint32
resizeMode" as "uint32 viewMode".

Thanks to Alexandre for his original branch (it was a very useful
reference), Axel (for some miscellaneous advice & encouragement),
Adrien & Humdinger (for user interface review), and Diver (for user
interface review & testing).


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


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


# 54e2dd7272db551cab02cc678bd45bc4131dd867 28-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: style fixes

No functional changes intended.


# 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


# b992df8968fcc9e83f0e247966571196ce5c90c9 18-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: Don't crash clicking Open with... menu item

This bug was introduced in hrev47498

The reason Tracker crashed was because OpenWithContainerWindow
had a NULL TargetModel() which we were trying to dereference.

Fix this by creating an empty model in OpenWithContainerWindow. Add an
ASSERT to check that the TargetModel() is not NULL in the future.

Another way to fix this bug would have been to check that TargetModel() wasn't
NULL each time before we use it. I didn't go with that solution because we
assume TargetModel() is not NULL in a lot of places so it would be a lot of work
to check them all. I think it's better to give OpenWithContainerWindow a dummy
model even though it doesn't make sense for it to have one just so that we don't
crash when we try to dereference the pointer.


# 6527415d5a7134839f2ed65459a63e3c310dce9c 18-Jul-2014 John Scipione <jscipione@gmail.com>

Tracker: obligatory round of style fixes

* Explicit NULL checks
* whitespace
* single line if gets no {}'s
*


# 512c80ef1ccf470fb8018834fd542a213a3f0b5c 21-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: add back parens


# 64fda603ef33d571f9ab9a2f1489c133528bad76 21-Jun-2014 John Scipione <jscipione@gmail.com>

Tracker: fix accidential logic reversal


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

Tracker: Use floats in OpenWithWindow calculations


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

Tracker: Style fixes to OpenWithWindow


# 6c6fcaf95bd0900cec88e13d58795f5241850037 20-Dec-2012 Alex Smith <alex@alex-smith.me.uk>

Some build fixes for DEBUG=1.


# d6a17f3d784f5d2998f4ccde09e53d5fdafea6e5 25-Nov-2012 Philippe Saint-Pierre <stpere@gmail.com>

Tracker: fix memory leak in OpenWithFilter. (CID #715684)


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

OpenWithWindow: Fix crash at closing, and fix filtering

Following hrev44493, the way ShouldShowPose was used changed a bit,
to harmonize with type ahead filtering.

This updates OpenWithWindow to use a BRefFilter to do its
filtering rather than overloading ShouldShowPose.


# aed35104852941f0f6f3d1dcc5338b5f337d0a3c 05-Aug-2012 Humdinger <humdingerb@gmail.com>

Close alerts with ESCAPE key.

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.


# 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


# 851c719d021e7f867be9f6dd97da23ce881b86ff 04-Jul-2012 Humdinger <humdingerb@gmail.com>

Small text changes in alert when renaming/moving special folders.

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.


# 72b7db341bb4b8be491ba2aa3453c297b621129f 21-May-2012 Reznikov Sergei <diver@gelios.net>

Added resize to fit shortcuts. Partially fixes #7467.

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


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


# 5c6b9eb00d0d623c12f72eb82a471cb4c71f4f33 23-Feb-2012 Jerome Duval <jerome.duval@gmail.com>

Some fixes for GCC 4.6 warning: variable set but not used


# 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


# ad76f4439fd539b006ab654596f6591f1bce9270 16-Sep-2010 Alexandre Deckner <alex@zappotek.com>

* Build fix, see ticket 6374
* 80 char limit fix



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


# 108f794c9749f5aef3e4f37591e65e1e7edcd76c 16-Sep-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by mt: Translate various yet untranslated strings in libtracker,
closes ticket #6374. Thanks a bunch!


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


# 1f34e928acb60a28c2343312ba738e4e9a434d8a 14-Jul-2010 Alexandre Deckner <alex@zappotek.com>

* Removed last remains of the OPEN_TRACKER define.
* Cleanup of unused include.


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


# 82d8aaf85a8c1ad19f69637468102ca08040facf 12-Jan-2010 Stephan Aßmus <superstippi@gmx.de>

Patch by Humdinger:
Changed strings to sentence case. The changes in StatusWindow and
FSUtils are missing because I have some unfinished work in progress
in those files. Will commit them separately. This is case-tracker.diff
from #5169.


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


# 107d2b333b14d044ba044461f30a07ea5f1ed475 26-Apr-2009 Bruno G. Albuquerque <bga@bug-br.org.br>

Only try to add the preferred app if it can be found, otherwise the Open With
menu would be completelly empty.



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


# 019f90e6348a15e47ef361c79970c4222e569b2d 05-Apr-2009 Jonas Sundström <jonas@kirilla.com>

Setting the escape key as shortcut for the Cancel options of Tracker's dialogs.

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


# 4f3347b64b79aee3511ebce4bbc0fbef41dd3d24 03-Feb-2009 Joachim Seemer <humdingerb@googlemail.com>

As discussed here:
https://lists.berlios.de/pipermail/haiku-commits/2009-February/014198.html
We decided on a distinction between path+filename and only the path to a file.
I changed the places a user is exposed to the issue, using the definition:
Path with filename: "Path"
Path without filename: "Location"


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


# b2f91e61b7c5c13efad598b9030eef439e4921cc 11-Jan-2009 Karsten Heimrich <host.haiku@gmx.de>

* Prevent the B_OBSERVER_NOTICE_CHANGE to get passed on to ContainerWindow, since
this would crash Tracker in case the 'Open With' window is shown and one try's
to set, e.g 'Show full path in title' or 'Show Navigator' etc.



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


# d881bedfc05feed54fe1f521bea9fff6b489d79d 04-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* We must not sort the cached inodes, or else we mess up the order for
CanOpenWithFilter().
* This fixes bug #2795.


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


# f28ab87b680bded1bbdd48104eb369d131868a56 04-Oct-2008 Axel Dörfler <axeld@pinc-software.de>

* Added "sortInodes" parameter to CachedEntryIteratorList constructor.
* Moved static CompareInode() to CachedEntryIterator::_CompareInodes().
* Cleanup.


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


# 979fca9d83db4a2d6480ac9ed86483d9bd54aee6 28-Sep-2006 Axel Dörfler <axeld@pinc-software.de>

Minor cleanup.


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


# 269d3bd5bce1fa4d84ee2cf577a29af93dab3b7a 11-Jun-2006 Axel Dörfler <axeld@pinc-software.de>

Imported PoseView.cpp 1.61, OpenWithWindow.cpp 1.8, and OpenWithWindow.h 1.3
from OpenTracker CVS.
This fixes bug #354.


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


# 3b5cc3b1f3fb76d9be1bcbae984cd06676ff3e55 31-May-2006 Axel Dörfler <axeld@pinc-software.de>

MIME types are case insensitive, so Tracker should not be so picky.
The app queries still are case sensitive, though (shouldn't hurt, as the MIME
type database preserves the case).


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


# 66d3076d171019cb336c52886cc571c9af3953ff 31-May-2006 Axel Dörfler <axeld@pinc-software.de>

Cleanup, no functional change.


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