Commit Graph

7566 Commits

Author SHA1 Message Date
John Scipione
4deecac061 Tracker: Fix BuildMimeTypeList(), styleish and correct
Thanks Axel for pointing out my error.
2014-07-18 17:18:12 -04:00
John Scipione
29c145bcbe Tracker: Check LockLooper() return value.
Fixes CID602468 and CID602469

Thanks waddlesplash for pointing this out.
2014-07-18 14:12:25 -04:00
John Scipione
b992df8968 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.
2014-07-18 10:58:30 -04:00
John Scipione
bb804d092e Tracker: Make sure count > 0
... in a more stylish way, no negative counts allowed.
2014-07-18 10:47:11 -04:00
John Scipione
6527415d5a Tracker: obligatory round of style fixes
* Explicit NULL checks
* whitespace
* single line if gets no {}'s
*
2014-07-18 10:47:09 -04:00
John Scipione
61dec7d2ec Tracker: fix bug introduced in hrev17795
Ticket #298 for context.

In BContainerWindow::AddWindowContextMenus() pasteItem is used but
not declared if CUT_COPY_PASTE_IN_CONTEXT_MENU is defined.
2014-07-18 09:15:23 -04:00
John Scipione
5ddedec51a Tracker: more style fixes to ContainerWindow.cpp
* Rename templateMenu to templatesMenu.
* 80 char limit fixes
* whitespace fixes
* Declare 1 item per line.
* Don't set variables inline, set, then use.
* Explicit NULL comparisons
* {}'s around if statment with multi-line appearance
2014-07-18 09:04:19 -04:00
John Scipione
bc1739a5c5 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
2014-07-17 20:13:54 -04:00
John Scipione
c6433b0b3c Tracker: A few more style fixes to IconCache
* Hilight => Highlight
2014-07-17 19:36:48 -04:00
John Scipione
9f2a3f6f47 Tracker: Move opening Desktop window to constructor
BRoster::Launch() sends B_REFS_RECEIVED before B_READY_TO_RUN
if the application is not running, so, when B_REFS_RECEIVED looked for
the Desktop window it wasn't created yet since that happen in ReadyToRun().

By creating the Desktop window in the constructor instead it is available
in RefsReceived() so an extra Desktop windows isn't opened.
2014-07-17 15:11:15 -04:00
John Scipione
3f2239f6b6 Storage Kit: Style fixes to mime database
* Update doxygen docs a bit, especially returns.
* Some variable renaming for consistency and clarity, err/error => result.
* Remove some dead code that isn't coming back. (code moved to IconUtils)
* OpenType() returns a status_t, put it in a status_t, not a ssize_t.
  and then later create a new ssize_t to hold the read bytes read
  and use that, saves a lot of casting and confusion.
2014-07-17 14:51:35 -04:00
John Scipione
9bbfee0fd5 BNodeInfo: Style fixes
* Remove public method docs, they are in Haiku Book only.
* Format private method docs as doxygen.
* Other style fixes like explicit NULL checks.
* Remove dead code in GetIcon() that isn't coming back.
* Pointer style.
2014-07-17 14:51:32 -04:00
John Scipione
8e5c1f2394 Tracker: style, reorder includes in DeskWindow.cpp 2014-07-17 14:51:29 -04:00
John Scipione
670b729d65 Tracker: style fixe, update comment, spelling
...and fits on 1 line
2014-07-17 14:51:28 -04:00
John Scipione
8b9604572e Tracker: style fixes to ContainerWindow 2014-07-17 14:51:27 -04:00
John Scipione
537e1fff3e Tracker: Write Trash icon attrs only once
Also create Trash if does not exist but check the if the icon
attrs are set separately.

Only set the vector trash icon #ifdef __HAIKU__ does this
even matter anymore?
2014-07-17 14:51:26 -04:00
John Scipione
7f68dcb4a7 Tracker: Write Desktop icon attrs only once 2014-07-17 14:51:24 -04:00
John Scipione
dd3359ae8f Tracker: return B_BAD_VALUE if you pass in a NULL dir 2014-07-17 14:51:23 -04:00
John Scipione
c2d07d9988 Tracker: yet more style fixes 2014-07-17 14:51:22 -04:00
John Scipione
ae7d51b28a Tracker: Style fixes to IconCache and Utilities 2014-07-17 14:51:20 -04:00
John Scipione
ee196640fb Tracker: Update Tracker nav bitmaps and layout 2014-07-17 14:51:16 -04:00
John Scipione
bd41bc5105 Tracker: Style fixes in Tracker (app) 2014-07-17 14:51:15 -04:00
John Scipione
f6d495501e Tracker: include ContainerWindow.h in Navigator.h 2014-07-17 14:51:14 -04:00
John Scipione
e17179d381 Tracker: Style fixes to Navigator.h 2014-07-17 14:51:12 -04:00
John Scipione
b77cc9391a Tracker: Style fix, move headers down in Navigator.cpp 2014-07-17 14:51:11 -04:00
John Scipione
f13a47d224 Tracker: Pose style fixes kind => which 2014-07-17 14:51:10 -04:00
John Scipione
d5868b5976 Tracker: style fixes to PoseView
Variable renaming for consistency and clarity
2014-07-17 14:51:09 -04:00
John Scipione
8dd0b0aeac Tracker: style fixes to Model 2014-07-17 14:51:08 -04:00
John Scipione
d7e6821137 Tracker: miscellaneous style fixes 2014-07-17 14:23:33 -04:00
John Scipione
6ab2085f7b Tracker: Style fixes to ContainerWindow 2014-07-17 14:23:33 -04:00
John Scipione
49d37d9438 Tracker: tiny style fix, explicit NULL check 2014-07-17 14:23:32 -04:00
John Scipione
6c424fff1e Tracker: Tiny style fix to Bitmaps.cpp 2014-07-17 14:23:32 -04:00
John Scipione
021aaa43d0 Tracker: Style fix, capitalize share icons hex
... just to make them consistent with the rest.
2014-07-17 14:23:32 -04:00
Adrien Destugues
92dd9f7360 Style fixes, no functional changes. 2014-07-16 17:57:47 +02:00
Adrien Destugues
3528905be6 Parse multiple HTTP at once
Instead of relying on the global protocol loop to call _ParseHeaders
once for each header, extract as much as possible from the current
buffer.

This saves memory, avoids useless operations on the socket and various
processing steps, and fixes #10245.

Also improve the handling of 0-size requests to make sure they terminate
properly.
2014-07-16 17:34:31 +02:00
Adrien Destugues
ceb65ce14e Extend Tracker scripting capabilities
* Allow EXECUTE on the Folder property to open a window for the passed
ref and return a BMEssenger targetting that window.
* Allog GET on the Folder property to return a messenger to the matching
window, if one is already open.
* Make scripting support mandatory and remove the define allowing to
disable it.
2014-07-16 15:53:49 +02:00
Adrien Destugues
dd03c93fbf Move automount settings to the Tracker preferences
* Avoids the ugly "button that opens another window" UI paradigm in
Tracker preferences.
* Makes it possible to revert changes to the automount settings as the
Tracker preferences window has a revert button.
2014-07-16 14:46:27 +02:00
Puck Meerburg
62f70e6f0a Fix Coverity bug 1108392: Stray semicolon
Signed-off-by: Philippe Saint-Pierre <stpere@gmail.com>
2014-07-15 16:17:46 -04:00
Puck Meerburg
d32cb23734 Fix Coverity bug 603941: Negative array index read
Signed-off-by: Philippe Saint-Pierre <stpere@gmail.com>
2014-07-15 15:14:56 -04:00
Philippe Saint-Pierre
fcd2bfb773 Style fix, no functional changes
Thanks Axel!
2014-07-15 14:06:49 -04:00
Philippe Saint-Pierre
384eec8fb3 Ticket #3385: inconsistencies when single window + disks icon
When using the Show Disks icon option, single window navigaton mode,
and starting navigation by the Disks icon, these bugs would occurs
upon entering child poses :

*) The draggable icon at the top right wouldn't appear
*) The file menu wouldn't update properly (for example, the New folder
menu item won't show)

Based in part on dru_ed's patch.
2014-07-14 21:16:35 -04:00
John Scipione
db1ef05aef BShape: Style fixes for docs 2014-07-14 19:02:44 -04:00
Ingo Weinhold
e1e6c12480 BPackageWriter::Recompress(): Change param to BPositionIO*
Besides that this is a nicer interface, it allows us to get a the HPKG
header as a side effect of initializing the reader, thus preventing
seeking backward in the file. This makes "package recompress - <file>"
work.
2014-07-13 17:57:57 +02:00
Ingo Weinhold
43a6b92c64 PackageReaderImpl: Delay reading sections until ParseContent() 2014-07-13 17:57:56 +02:00
Ingo Weinhold
05b565f4f2 Add private BDataPositionIOWrapper
Implements the BPositionIO interface on top of a BDataIO, requiring the
{Read,Write}At() accesses to be sequential.
2014-07-13 17:57:56 +02:00
Ingo Weinhold
44c4771163 BPackageWriter: Add BPositionIO support 2014-07-13 17:57:55 +02:00
Ingo Weinhold
8f5130edfa package kit: Actually add support for B_HPKG_COMPRESSION_NONE
Until now we always declared in the HPKG header that the package file is
zlib compressed. For uncompressed files we would just store all
individual chunks uncompressed. Now we handle completely uncompressed
files slightly differently: We don't write the redundant chunk size
table anymore. The size savings are minor, but it makes the uncompressed
format read-streamable which may be handy.
2014-07-12 23:12:21 +02:00
Ingo Weinhold
e527b79631 Switch package file accessor classes to use BPositionIO
* PackageFileHeap{Reader,Writer} as well as Package{Reader,Writer} and
  their implementation and super classes do now internally use a
  BPositionIO instead of a FD to access the package file. This provides
  more flexibility needed for features to come.
* BPackageReader has already grown a new Init() version with a
  BPositionIO* parameter.
2014-07-12 15:40:22 +02:00
Ingo Weinhold
c55a06055f Add private class BFdIO
Simple BPositionIO implementation using the POSIX API on a FD. In effect
similar to BFile, but more easily ported to kernel and boot loader (and
the FD is reusable).
2014-07-12 15:40:21 +02:00
Ingo Weinhold
8546c4160e BPositionIO: Add {Read,Write}AtExactly()
Analoguous to {Read,Write}Exactly(), just for the *At() versions.
2014-07-12 15:40:21 +02:00