Commit Graph

7576 Commits

Author SHA1 Message Date
Humdinger
6229115bac More small C++11 tweaks. 2014-06-16 19:34:56 +02:00
Humdinger
991dadd632 Make sure there's a space in front of B_UTF8_ELLIPSIS.
As PulkoMandy said in hrev47388: C++11 safe and reads better.
2014-06-16 17:55:34 +02:00
Adrien Destugues
dbd4f8c46b SetTime_t: Use the sign-fixed modulo we computed
* In C++03 and earlier, the sign of the modulo result is implementation
defined (this was fixed in C++11).
* Setting a negative time is not what we want here, so make sure we use
the proper value.
2014-06-16 08:46:56 +02:00
Ingo Weinhold
0b57c6338b BTransactionIssue::ToString(): Fix some strings 2014-06-15 17:21:02 +02:00
Ingo Weinhold
f2f19f110d BPackageManager: Support installing/updating local package files
* The Install() and Update() versions that take a const char* array
  now check whether a string looks like a path to a local package file.
  If so, they use that file instead of interpreting the string as a
  search string.
* Extend the repository hierarchy. There's now a LocalRepository base
  class from which InstalledRepository and the new MiscLocalRepository
  derive. The latter is instantiated once and collects all package files
  specified by path.
2014-06-15 17:21:01 +02:00
Ingo Weinhold
eee422752c BPackageManager: Make BCommitTransactionResult available
* BFatalErrorException: Add commitTransactionResult property and
  respective constructor. In case committing the transaction failed,
  BPackageManager throws a BFatalErrorException with the result.
* BFatalErrorException::UserInteractionHandler: Pass
  BCommitTransactionResult to ProgressTransactionCommitted().
2014-06-15 17:21:01 +02:00
Ingo Weinhold
0de3219e33 package daemon: Rework error and issue propagation to client
* BDaemonClient: Move inner class BCommitTransactionResult to top level
  and make it public.
* BCommitTransactionResult:
  - Add a whole bunch of specific error code enum values. Such an error
    code is now the primary error, as opposed to before where we would
    mix status_t and enum value errors. There's a systemError property
    of type status_t which may provide additional information, though
    (depending on the primary error type).
  - Remove the errorMessage property. Due to mapping all errors to the
    specific error codes this is no longer necessary. Mixing such a
    message with another error description is also not very helpful when
    it comes to localization (still not supported, though).
  - Add several properties (paths, strings, error codes) that serve as
    arguments to the primary error and are used by FullErrorMessage().
  - Add issues property, a list of instances of new class
    BTransactionIssue. Those describe non-critical issues (e.g. failed
    update of a settings file) that occurred in the process of
    committing the transaction. Those issues should be presented to the
    user by the package management program.
* Exception: Adjust to transport the BCommitTransactionResult
  properties.
* CommitTransactionHandler, FsTransactions, Root, Volume: Adjust to
  BCommitTransactionResult/Exception changes.
* CommitTransactionHandler: Now requires a BCommitTransactionResult to
  which it adds the issues it encounters. The reply BMessage is no
  longer needed, though.
* Volume: Refactor common code from the three methods that use
  CommitTransactionHandler into new method _CommitTransaction.
2014-06-15 17:21:01 +02:00
Ingo Weinhold
6077cad882 BEntryOperationEngineBase::Entry: Add debug methods
Add GetPathOrName() and PathOrName() methods which try to get some kind
of usable path or at least a file name for the entry. Useful mainly for
debugging and error reporting cases.
2014-06-15 17:21:00 +02:00
Ingo Weinhold
9680cf0bce BEntryOperationEngineBase::Entry: Add node_ref+path c'tor 2014-06-15 17:21:00 +02:00
John Scipione
0546bdd5e5 Tracker: code simplication to hrev47374
We don't need to create a BNode from a BDirectory because BDirectory derives
from BNode! So use the BDirectory we already have as a BNode and get the
node_ref from it so we can pass it into WatchNode().

Sorry for the noise.
2014-06-14 21:19:42 -04:00
Cedric Degea
076cb5a752 BOptionPopUp: check for non-NULL Message(). Fixes #10733
Signed-off-by: John Scipione <jscipione@gmail.com>
2014-06-14 20:50:10 -04:00
John Scipione
1f17f750db Tracker: Use BPathFinder to find add-ons 2014-06-14 20:48:15 -04:00
John Scipione
6cf062b93d Tracker: Style fixes to DeskWindow 2014-06-14 16:21:05 -04:00
Jessica Hamilton
00922c9989 Tracker: fix accidental logic inversion. Fixes #10940. 2014-06-15 05:30:21 +12:00
John Scipione
1f424632be Style fixes to IK, focus on docs 2014-06-13 17:27:01 -04:00
John Scipione
2776568d27 Fix BHandler::GetSupportedSuites()
The logic was reversed accidentally in hrev47355

Rewrite the method to make more sense. If data is NULL return
B_BAD_VALUE right away. Otherwise set the status based on the first
operation, if that succeeds perform a second one, and return the
result.

Fixes CID 1222666
2014-06-12 13:57:05 -04:00
John Scipione
219bf21ef6 Style fixes to Locale Kit, focus on docs. 2014-06-11 16:48:02 -04:00
John Scipione
37fedaf849 Style fixes to the Game Kit, focus on docs 2014-06-11 16:44:48 -04:00
John Scipione
be902ac4db App Kit: style changes.
No functional change intended.

Focused on documented classes only.

* Update copyright information.
* whitespace fixes.
* pointer style
* Rename some variables, msg => message, form => what
* Need consistent variable names to make documentation easier,
  allows us to use \copydoc or \copydetails instead of repeating
  ourselves over and over again.
2014-06-11 16:24:02 -04:00
Adrien Destugues
895fa41e0b Make handling of Http Authentication thread safe
* Each BHttpAuthentication object is locked on all field accesses,
* They are owned by the BUrlContext and never deleted, so there is no
need for reference-counting them,
* The BUrlContext itself is now reference counted, and all BUrlRequests
hold a reference to it.

This makes sure using the BHttpAuthentication objects from requests is
thread-safe.
2014-06-11 14:11:01 +02:00
Adrien Destugues
463ffbfde4 First steps towards cookie jar thread-safety
* Change the semantics of the iterators copy constructor and assignment
operator: they now return a new iterator for the same cookie jar (and
same url for the UrlIterator). They don't try to point to the same
position as the copied iterator. The only purpose of these is to write
code such as:

Iterator it = jar.GetIterator();

so having a full copy isn't that useful.

* The per-domain cookie lists are now protected with a read-write lock.
The iterators retain a read lock while they are handling cookies from
that list. They get a write lock when doing Remove. Adding a cookie to
the jar also gets the write lock for the matching list

* Fix a memory leak when adding a new domain-list to the jar failed

* Simplify the declaration of the PrivateHashMap type (it would be
even simpler if HashMap was a public API)

* The domain hashmap is now a SynchronizedHashMap. It is locked as long
as an Iterator or UrlIterator exists, which may be a problem as these
are public APIs. Writing safe iterators for an hashmap with concurrent
accesses is not easy, so the API could be modified to return a list of
domains and a list of cookies for a given domain or URL instead. This
would suit the intended uses just as well.

* The jar now store const cookies, so there is no need to lock them for
access/modification. Updating a cookie is done by replacing it with
another one in the jar (with the same domain and value). There is still
the problem of deleting a cookie while other threads may still access
it, this will be fixed by making cookies BReferenceable.
2014-06-11 12:59:33 +02:00
John Scipione
888f72ca9a Tracker: close Desktop window on switch to spatial mode
If you have the Desktop window open when you switch to spatial
mode this will now close the window. You aren't allowed to have
the Desktop open in 2 places symultaneously in spatial mode.
2014-06-10 00:59:50 -04:00
John Scipione
646b1fe1e8 Tracker: Open Desktop folder in own window in browser mode.
... in a few more cases.

If you are in spatial mode and you double-click on the Desktop folder
it activates the Desktop putting all other Tracker windows in the
background.

If you are in browser mode and you double-click on the Desktop folder
it opens the Desktop folder in the current window.

If you issue 'open ~/Desktop' from Terminal or if you have Expander set
to open the expanded folder and you expand something on the Desktop
it won't open the Desktop folder in its own window in either spatial or
browser mode.

This patch alters Trackers behavior to  open the Desktop folder in its own
window in these cases when you are in browser mode.

One might argue (as a few have on IRC) that this behavior should also
happen in spatial mode, but, this patch does not alter the behavior of
spatial mode. In spatial mode opening the Desktop folder with
'open ~/Desktop' or extracting a zip file with Expander on the Desktop
simply activates the Desktop pushing all other Tracker windows into the
background state.

Fixes #10929
2014-06-10 00:57:33 -04:00
John Scipione
157e4b428a Tracker: Replace max_c() with std::max() 2014-06-10 00:36:11 -04:00
John Scipione
9437e677ba Tracker: Style fixes 2014-06-10 00:36:10 -04:00
Adrien Destugues
0e79d0efbc Disable tracing unless built in debug mode. 2014-06-09 14:12:56 +02:00
Adrien Destugues
1cbab031fd More relaxing of cookie-setting rules
* Allow non-secure page to set (but not read) secure cookies
* Allow pages to set cookies for subdomains (but not access them)
2014-06-09 11:17:49 +02:00
Adrien Destugues
d888718621 HttpTime: don't try to parse timezone
* Cookies sometimes come with the UTC timezone, or no tz info at all.
* No other timezone seems to be used

This allows better matching of cookies which would otherwise be kept
only as session cookies.
2014-06-09 11:10:19 +02:00
Adrien Destugues
f7e7eeba4a Limit cookie value size to 4096 bytes.
Too big cookies will make most web servers reject requests.
2014-06-09 08:50:29 +02:00
Jessica Hamilton
a0b864f0e4 BString: fix possible infinite loop in _DoReplace 2014-06-08 04:37:16 +12:00
Adrien Destugues
550f5b1c95 Fix some issues detected by the testsuite
* An empty "expires" field results in a session cookie, rather than
rejecting the cookie altogether
* A page can set a cookie it is not allowed to access (for example in a
subdirectory of where the page is located). Separate IsValidForUrl and
_CanBeSetFromUrl to perform the appropriate checks in each case.
* Limit cookie path to 4096 characters. As a result of the previous
change, a page would be allowed to set a cookie with an aribrarily long
subpath, wasting disk space and RAM by growing hte cookie jar.
* Don't allow path with . or .. elements. These are a source of
confusion and are not needed.
* Reset the cookie fields when parsing failed. This does not matter when
using the cookie jar, but is useful when working directly with
BNetworkCookie.
2014-06-06 16:53:50 +02:00
Adrien Destugues
fed9b96e26 Better handling of parse errors in HttpTime
strptime can return non-NULL values even if it only parsed part of the
string. This was sometimes making us use the wrong format. Now we try
all formats and checks how much of the string strptime managed to parse.
We stop when it has parsed a big enough part of it.
2014-06-06 16:49:11 +02:00
Adrien Destugues
6ac7ba848b Sort cookies by path length (longest first)
* This makes sure the most specific cookies are sent first, matching
what other browsers do.
2014-06-06 16:48:15 +02:00
Adrien Destugues
4e14963b73 CID 1108421: BUrl constructor missing initializers. 2014-06-06 08:04:16 +02:00
Stephan Aßmus
5eba63a680 UrlContext: Improved comment 2014-06-06 00:23:47 +02:00
Stephan Aßmus
cb1a99c5f0 HttpHeaders: Small code refactorings
Also check BList::Add() for success when adding a BHttpHeader.
2014-06-06 00:23:47 +02:00
Stephan Aßmus
79852c5551 HttpHeaders: Check assigning self in operator=() 2014-06-06 00:23:46 +02:00
Stephan Aßmus
16b8886a59 HttpAuthentication: Check LockBuffer() success...
... in _H() MD5 digest method. Thanks to axeld
for the suggestion.
2014-06-05 21:43:35 +02:00
Stephan Aßmus
258817720c HttpAuthentication: improvements and fixes
* BString::CopyInfo() takes length as second
   parameter, not the end-offset. This bug didn't
   have any effect, since BString clamps the length.
 * ',' is a comma, ':' is a colon.
 * When parsing "additionalData" in the loop for
   name=value pairs, an empty name is not useful,
   continue the loop early.
 * "value" may have the length 0, accessing it
   with value[0] would not lead to an access violation,
   since it just reads the terminating zero (I think),
   but it's nicer if the code makes it clear that
   value being empty is considered.
 * _H() was using a static buffer, in a heavily
   multi-threaded situation. I don't think this was
   healthy.
 * Implement the proposed optimization of using
   BString::LockBuffer(). Appending one char at a time
   is really bad for peformance. The Base64 encoding/decoding
   should really be rewritten as well for similar reasons.
2014-06-05 00:01:13 +02:00
John Scipione
daabbbe5f9 BRegion: Style fix, update parameter name
No functional change.

Trying to indentify each kind of object uniquely and consistently.

... update docs as well.
2014-06-04 11:58:07 -04:00
Adrien Destugues
cd805f6793 Remove some redundant fields
These were getting out of sync and causing trouble, and they are easy to
compute from existing information.

Fixes some problems detected by the testsuite where the user/password or
the host would sometime disappear from the URL.
2014-06-04 11:56:23 +02:00
Adrien Destugues
b5bde4ad81 Fix bugs identified by the testsuites
* Handle resolving . and .. in path properly
* Make the subtle distinction between empty and unset for the authority,
fragment and query.
2014-06-04 10:36:10 +02:00
Adrien Destugues
e29e0a0d2a Fix Url relative constructor.
Actually get the query from the base URL.
2014-06-04 08:22:13 +02:00
John Scipione
44cee34013 BRegion: Style updates for documentation.
No functional changes intended.

* Updated copyright information.
* Reduced doxygen documentation down to a helpful summary
  in a regular comment, the documentation has been moved into
  the Haiku Book.
* Some parameter renaming for consistency and clarity.
* A few other style fixes.
2014-06-03 20:26:45 -04:00
Oliver Tappe
1a7bcf6962 Lots of B_PRI... insertions to fix errors with DEBUG=1. 2014-06-02 02:00:28 +02:00
John Scipione
532c873311 BRect: Replace max_c() and min_c() with std::max() and std::min() 2014-05-30 19:46:30 -04:00
John Scipione
1f46fc6d52 BRect: Style fixes for documentation 2014-05-30 19:31:10 -04:00
John Scipione
8ad6baf789 BButton style fixes for docs.
No functional change intended.
2014-05-28 14:21:06 -04:00
John Scipione
b29d84a85a BRadioButton style fixes for docs. 2014-05-28 14:10:35 -04:00
John Scipione
7ad8e674de BCheckBox: Style fixes, variable renaming for consistency, docs.
Also some other style fixes, no functional changes intended.
2014-05-28 14:06:32 -04:00
John Scipione
092e3093c3 BControl: Style fixes, variable renaming for consistency, docs.
Also some other style fixes, no functional changes intended.
2014-05-28 14:05:22 -04:00
John Scipione
f4870e1cf4 BView: Rename parameters for consistency, docs.
No functional change.
2014-05-28 12:11:57 -04:00
Oliver Tappe
6b6ff33d60 Fix zlib-dependency in libnetapi.
* Fix copy-'n'paste bug that resulted in the zlib.h dependency being
  added to no source file at all.
2014-05-24 20:26:41 +02:00
John Scipione
b955a4ca6b BPolygon: Style fixes for documentation. 2014-05-21 16:12:47 -04:00
John Scipione
1867d69c8b BPoint: Replace max_c() and min_c() with std::max() and std::min() 2014-05-20 15:48:04 -04:00
John Scipione
e430d19ef6 BPoint: Style fixes for documentation. 2014-05-20 15:47:25 -04:00
John Scipione
c109d7e06f BPictureButton: Style fixes related to documentation
Some variable renaming for consistency.
2014-05-19 20:13:38 -04:00
John Scipione
df48d3f9a8 BPicture: Style fixes related to documentation.
Mostly pointer style adjustments
2014-05-19 20:13:38 -04:00
Jessica Hamilton
194ce33d65 DynamicBuffer: remove unneeded size check. CID 604168. 2014-05-08 16:41:14 +12:00
Jessica Hamilton
41a9299bb5 BNetEndPoint: fix signedness issues. CID 604169. 2014-05-08 13:48:51 +12:00
Ingo Weinhold
e9eb4df71b BDaemonClient: Handle options message fields correctly 2014-05-05 21:29:25 +02:00
Ingo Weinhold
4284b6c93a BInstallationLocationInfo: Provide more info
* If the active state is not the latest state, also provide a package
set for it.
* If an old state has been booted, provide its name.
2014-05-04 20:59:01 +02:00
Ingo Weinhold
5a1c6a7089 InstallationLocation: Rename [in]activePackages properties
Add prefix "Latest".
2014-05-04 20:59:01 +02:00
Jessica Hamilton
24a8416ea7 Revert "Fix window behavior when default button is present"
With some testing, found that even with the second patch
provided in #10792, the behaviour is still inconsistent, so
reverting for now.

This reverts commit 273109e004.
2014-05-03 10:04:05 +12:00
Adrien Destugues
77b60d2222 Use std::stable_sort instead of mergesort.
* stable_sort is part of the C++ standard, and should work just as well.
2014-05-02 16:36:16 +02:00
Adrien Destugues
3dfdd43723 BGradient: preserve order of stops with same offset.
* Use merge sort, which is a stable sort, instead of the qsort used in
BList::SortItems
* This allows setting two stops with the same offset to create a sharp
color change in a gradient. This trick is used to create stripe patterns
with css gradients in some web pages.

Fixes #10733.
2014-05-02 11:46:37 +02:00
Murai Takashi
79895eed07 Fix gcc 4.9.0 build
Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2014-04-29 22:01:34 +02:00
Adrien Destugues
1d09e9cee3 BScrollbar: remove unused field.
* Nothing ever reads fTargetName in the scrollbar code, so remove the
field.
* Frees one reserved slot, and a little memory, as the target name was
copied with strdup.
2014-04-29 16:46:00 +02:00
Kacper Kasper
273109e004 Fix window behavior when default button is present
* Don't intercept Enter key press in a window when there is default
button and another BControl focused.
* Current behavior was basically breaking every window using default
button. Even if there was a button focused (using Tab key), when Enter
was hit, default button handled the message, therefore instead of
i.e. 'Revert' 'Apply' was pressed.
* Fixes #10792.

Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-04-28 22:52:09 +12:00
Adrien Destugues
cb2c4f8d44 Convert more printf to TRACE in media kit. 2014-04-27 18:03:03 +02:00
Guillermo Bonvehi
667cfcdd56 TabView BTab::Select only add child if it doesn't have a parent
Signed-off-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
2014-04-26 12:20:40 +12:00
John Scipione
60370b9a6c BMenuField/BTextControl: Store and reuse Label() 2014-04-24 15:31:16 -04:00
John Scipione
b11edca47d BTextControl: style fixes 2014-04-24 15:31:15 -04:00
John Scipione
c79f260276 BMenuField: Check if menuBar is NULL explicitly 2014-04-24 15:31:15 -04:00
John Scipione
d055b93b25 BMenuField: Replace 5 with DefaultLabelSpacing() 2014-04-24 15:31:14 -04:00
John Scipione
58a3b20760 BMenuField: style fixes 2014-04-24 15:31:14 -04:00
John Scipione
c884d017ed BMenuBar style fixes 2014-04-24 15:31:14 -04:00
John Scipione
ca6cc0aa50 BMenu: Replace min_c and max_c
... with std:min and std:max
2014-04-24 15:31:13 -04:00
John Scipione
b7096fd76b BMenu: remove useless default case 2014-04-24 15:31:13 -04:00
John Scipione
cb30cf1423 BMenu: style fixes 2014-04-24 15:31:12 -04:00
John Scipione
a631719fb4 BButton style fixes 2014-04-24 15:31:12 -04:00
Adrien Destugues
53286932c0 Move IconMenuItem.h to headers/private/tracker.
* This can be useful outside of Tracker, so make it more visible.
2014-04-24 14:33:53 +02:00
Adrien Destugues
84da57fd56 MediaRoster: remove another message to app stdout. 2014-04-24 14:33:52 +02:00
Adrien Destugues
179c6ec2fd Remove some traces sent to application stdout.
* This may be fine in media server where it lands in logs, but certainly
not when the code is run in applications.
* Helps with all media-related webkit tests.
2014-04-23 15:13:14 +02:00
Adrien Destugues
de3e2b5186 BGradient: don't allow out of bounds stops.
* They crash app_server if you try to use them, which is not a good idea.
* we could clamp them to 0/255, but reporting the error to the user
seems better.
2014-04-22 10:45:24 +02:00
Adrien Destugues
02cdea9f9d BTab: use ControlLook to draw label.
* Supports disabled tabs like BeOS did: label is drawn with disabled
color, but can still be selected.
2014-04-12 11:37:45 +02:00
Adrien Destugues
4991d3fb52 Fix build. 2014-04-12 09:32:43 +02:00
Adrien Destugues
9b1f41b9c1 AddOnManager: remove more annoying traces. 2014-04-12 08:57:28 +02:00
Adrien Destugues
cfc4b62367 Network Kit: Prepare for HTTP range requests
* The DataReceived hook gets a position argument, making it possible for
listeners to handle out-of-order data (from two range requests at
different positions, for example)
* Adjust HaikuDepot (only user of the API in our sources)
* Add a copy constructor to HTTPRequest that copies the relevant
parameters from an existing request. Makes it easy to repeat a request
with a different range. Could be useful for restarting downloads, or
paralellizing them.
* Add SetRangeStart, SetRangeEnd calls to HTTPRequest, no implementation
yet. I'm putting all the API changes in this commit as it needs to be
synced with a matching haikuwebkit release.
* All archs must update to HaikuWebkit 1.3.0. Previous versions are
broken by this.
2014-04-12 08:57:26 +02:00
Adrien Destugues
5ba7abf8f2 AddOnManager: remove useless traces
These were acceptable in media kit log, but are only annoying now that
the AddOnManager is ran in applications. Moreover, these get to stdout
and make some WebKit tests fail.
2014-04-12 08:57:23 +02:00
Adrien Destugues
f325986993 FileRequest: identify unknown files.
* WebKit testsuite relies on the MIME types being correct, so when the
file doesn't have one, try to identify it.
* May be useful for other apps using FileRequest, anyway.
2014-04-10 08:51:00 +02:00
Adrien Destugues
a8d8e823ea HttpRequest: handle 302 and 307 redirects.
* Makes jamendo.com player work, as their soundfiles are behind a
temporary redirect for load balancing.
2014-04-10 08:50:59 +02:00
John Scipione
e439b00397 Fix button label position, try number 2
Create and use BLayoutUtils::AlignOnRect() to position the button label
in BControlLook::DrawLabel().

AlignOnRect(), unlike AlignInFrame(), provides the possibility to return
a rectangle with dimensions greater than the available size.

Add some comments above the methods in LayoutUtils that indicate such.

Also update copyright headers in LayoutUtils and ControlLook
2014-04-08 14:10:10 -04:00
John Scipione
f0fdd7b97a LayoutUtils: Use floorf() instead of floor() 2014-04-08 14:10:09 -04:00
John Scipione
6ecc270f57 LayoutUtils: Use std::max instead of max_c 2014-04-08 14:10:09 -04:00
John Scipione
04b48a29bd LayoutUtils: Style fix, remove leading space 2014-04-08 14:10:08 -04:00
John Scipione
4e8acd3232 ControlLook::DrawLabel() tiny style changes 2014-04-08 14:10:08 -04:00
John Scipione
c79ddce494 Revert "Fix button label position"
This reverts commit 1c69e1c306.
2014-04-08 14:10:07 -04:00
Jessica Hamilton
6242374090 Media Kit: fix use of pthread_once_init in FormatManager.cpp
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2014-04-04 22:25:46 +02:00
Adrien Destugues
8bbdad1487 FormatManager: actually return the singleton instance.
This should work better.
2014-04-04 12:42:14 +02:00
John Scipione
f5c284eeed Style fixes to BTextView 2014-04-02 19:38:25 -04:00
Adrien Destugues
638510600c Plugin loading: style fixes.
* Fix style issues pointed by stippi. Thanks!
* Rework the FormatManager instanciation to be thread safe.
2014-04-02 14:05:11 +02:00
Adrien Destugues
bf3b475c38 Urpdate AddOnManager and FormatManager for Media Kit
* These classes were moved from Media Server, making the use of ports
and messages to communicate with the app irrelevant.
* Split in a separate commit to help git keep track of moved files.

Fixes #4893.
2014-04-02 09:56:34 +02:00
Adrien Destugues
2feaa37f24 Move media plug-in support to application side.
The media server tried to use node monitoring to dynamically add and
remove plug-ins, but it isn't that useful:
* When a plug-in is added, applications would have to query the media
server to get an up to date list of available formats. For example
MediaConvert populates its format menus on startup.
* When removing a plugin, if an app already had it loaded, there is not
much that can be done to keep it working.
* The list of plugins was not sorted by directories (user vs system
add-ons), so the directories were re-scanned to make sure user add-ons
were returned first, rendering the node monitoring less interesting.

Now, the format handling is done by each application. The node
monitoring is removed, instead the apps will scan the plugin directory
when first using the media kit classes. Restarting the application is
needed to update the media formats list.
2014-04-02 09:56:32 +02:00
John Scipione
1c69e1c306 Fix button label position
This reverts a portion of hrev46580 concerning placement of a label on a button.
The label was draw too low on the button in some cases, notably in Keymap.
Restoring the old code for the icon-less case fixes the problem.

There still may be a problem drawing labels on buttons with icons, but, the code
should behave the same as it did in hrev46580 for that case, which is when
buttons with icons was introduced.
2014-04-01 17:19:00 -04:00
Adrien Destugues
943b310c90 Data URLs: fix size computation.
The decoded data is 3/4 the size of base64 encoded, not 4/3.
2014-03-31 09:59:12 +02:00
John Scipione
9ce450b9c2 AboutWindow: Move to Interface Kit (still private) 2014-03-25 14:17:19 -04:00
John Scipione
78877e7200 AboutWindow: Add FBC padding 2014-03-25 14:07:46 -04:00
John Scipione
293d80be6f BAboutWindow: style fixes
* mostly whitespace fixes
* reorder methods
2014-03-25 14:07:44 -04:00
John Scipione
71e3210d35 AboutWindow: Right-align close button 2014-03-25 13:38:59 -04:00
John Scipione
f188f5ccfc AboutWindow: Simplify layout (de-ident)
There's no functional change here but this eliminates a redundant group.
2014-03-25 13:38:08 -04:00
John Scipione
924f8e5344 AboutWindow: Make FromSignature methods private 2014-03-25 13:37:01 -04:00
Stephan Aßmus
244796701b app_server: store and restore fill rule...
...when sending the whole view state over the link.
Also inherit the fill rule when pushing states (DrawState
copy constructor). A somewhat sloppy oversight, I must add.
2014-03-17 22:55:47 +01:00
Adrien Destugues
eb43166326 app_server & interface kit: support fill rules.
* BView gets SetFillRule/FillRule methods. The fill rule is part of the
view state.
* The B_NONZERO rule is the default. This is what we implemented before.
* The B_EVEN_ODD rule is the other common possibility for this, and
we need to support it to help WebKit to render properly.
2014-03-11 17:27:42 +01:00
John Scipione
5d98ee1e4d Revert "BScrollView: Increase small scroll step size from 1 to 3"
This reverts commit bdcfc07617.
2014-03-08 15:18:35 -05:00
Rene Gollent
84e7206b05 Style fix. 2014-03-08 09:46:13 -05:00
Rene Gollent
b7282c5f2e Fix #10610.
Added missing initializer for fContext in PackageInfoErrorListener whose
absence was leading to crashes when generating the error string.
2014-03-08 09:44:13 -05:00
John Scipione
a6213356bc BView: scroll horizontally when holding control
... instead of vertically. This actually swaps horizontal and vertical
so if you have a mouse with a fancy 2-axis scroll ball it will swap
the x and y coordinates. (untested)
2014-03-07 19:11:46 -05:00
John Scipione
ab5c74422e BView: ScrollWithMouseWheelDelta return status code 2014-03-07 19:11:44 -05:00
John Scipione
b2404e2a39 BView: Check scroll delta isn't 0 2014-03-07 19:11:43 -05:00
John Scipione
bdcfc07617 BScrollView: Increase small scroll step size from 1 to 3
... and then don't multiply by 3 in BView
2014-03-07 19:11:37 -05:00
John Scipione
c4337a4324 BView: style fixes related to mouse scrolling 2014-03-07 19:11:35 -05:00
John Scipione
b7929c0574 BScrollBar: style fixes, update copyright header 2014-03-07 19:11:33 -05:00
John Scipione
86bdb1b69d Style fixes to BStringItem 2014-03-07 13:55:43 -05:00
John Scipione
5d10a74cfb BSeparatorItem: Style fix, rename archive to data
... missed it in a few places, trying to make variables names consistent.

Update hrev in docs
2014-03-04 14:28:20 -05:00
John Scipione
379ede58af Style fixes to BMenuItem::GetContentSize and update docs
Rename width and height to _width and _height matching the header.

Update the documentation for this method as well.
2014-03-04 14:17:46 -05:00
John Scipione
4479c8fda7 Style fixes to BSeparatorItem class.
Mostly meant for documentation with a few other style corrections as well.

Update copyright header.
2014-03-04 14:15:20 -05:00
Oliver Tappe
2e61b6dd1d Adjust libnetwork.so to no longer depend on libbe.so.
* Libbe is not available when cross-building the *_bootstrap packages,
  so no libnetwork could not be used either, which made building 
  anything network-related impossible.
* The only code in libnetwork that requires libbe is the notification,
  so I moved that over to libbnetapi. Non-C++ applications can't use
  the notification calls anyway, as their interface is C++-only.
2014-03-02 21:55:25 +01:00
Adrien Destugues
87400ed1de Use local time when computing max-age expiration
BDateTime.SetTime_t expects its parameter to be in local time.
2014-03-01 09:16:33 +01:00
John Scipione
fa412b5fd9 BMenuItem: Style fixes related to documentation. 2014-02-28 19:05:34 -05:00
Stephan Aßmus
91233f88a3 Font: Work on support for spacing modes.
* Change default spacing to B_BITMAP_SPACING. The BeBook does not document
   what the default spacing is, and I have no BeOS install handy to check.
   However, I believe that B_BITMAP_SPACING is what should be the default,
   since it gives the best visible result for the common use-case.
   In terms of implementation, there is no change, since spacing was ignored
   until now and the behavior was that of B_BITMAP_SPACING. This change could
   however break BeOS apps which assume B_CHAR_SPACING is the default and don't
   set it on new when they need it. Sample code in the BeBook however shows
   setting B_CHAR_SPACING on a newly created BFont.
 * Implement B_STRING_SPACING to do something sensible. The BeBook documentation
   is completely vague in what it is actually supposed to do. Given the
   possibilities of FreeType, I am implementing it to enable the use of
   kerning. Kerning optimizes the spacing between two glyphs, for example, it
   would decrease the spacing between "T" and "e" in the string "Test" for
   our default font. Untested.
2014-02-26 11:51:37 +01:00
Stephan Aßmus
569eed2db5 Font.cpp: Style cleanup
* Unify asterisk style
 * switch indentation style of FontList declaration
 * Order FontList methods according to declaration
 * Use named constants in default BFont constructor for spacing and encoding.
2014-02-26 11:51:36 +01:00
Philippe Saint-Pierre
75a80fb341 Use delete[] on array (CID #701816) 2014-02-25 21:31:08 -05:00
John Scipione
e9a0833a86 ScreenSaverRunner: Fix segmentation fault loading bad screen saver.
When Settings.ModuleName() returned NULL here we got a segmentation fault
trying to access the pointer.

I ran into this trying to load up a non-screensaver executable in ScreenSaver,
it crashed instead of doing the right thing and refusing to load.

Also, since we go to the trouble of saving this to a variable, we should actually use it.
2014-02-25 15:00:13 -05:00
John Scipione
9d312ae750 ScreenSaverSettings: Check that name is valid
... before trying to use it in GetModuleState() and SetModuleState()

also, rename the stateMsg variable to stateMessage (already correct in header)
2014-02-25 15:00:12 -05:00
John Scipione
94f8ac8cf1 ScreenSaverRunner: print errors to stderr instead of stdout.
Also print on a couple of new error cases:
* print and error if fSaver is NULL,
* print and error if unload_add_on failed.
2014-02-25 15:00:11 -05:00
John Scipione
06f133c1f2 ScreenSaverRunner: treat load_add_on return value like an image_id
... rather than a status_t, because that's what it is.
2014-02-25 15:00:09 -05:00
John Scipione
84466cefd3 ScreenSaverRunner: check return value of methods 2014-02-25 15:00:08 -05:00
John Scipione
d960838b5b ScreenSaverRunner: clarify some comments 2014-02-25 15:00:07 -05:00
John Scipione
4116ae4ffd ScreenSaverSettings: check find_directory return value 2014-02-25 14:58:38 -05:00
Julian Harnath
d10ecc2c41 Style fix: add parameter name
* As pointed out by Axel.
2014-02-22 13:51:55 +00:00
Julian Harnath
c99d7ea45c Fix double-free crash in BSecureSocket when cert. verification fails
* BSecureSocket::CertificateVerificationFailed() took a BCertificate
  instance by value as parameter.
  BCertificate deletes internal data in its destructor. Passing an
  object by value creates a copy, so the copy attempted to delete
  the internal data again during its destruction.
  This caused mail_daemon to crash here when it came across a failed
  certificate.

* Fix: pass BCertificate object as reference.
2014-02-22 02:09:55 +00:00
Adrien Destugues
64c12b418f Reintroduce BeOS compatible en/decode_base64.
Fixes #8579.
2014-02-21 22:30:18 +01:00
Stephan Aßmus
09b0602fff Tracker: Revert not offsetting the text.
It actually looked better before. It completely depends
on the first and last letter of the text whether there is
a pixel too much on the left or right. On average, it
looks better with the offset, since the string width often
includes the spacing needed before the next glyph on the
right, while the string touches the bounding box on the left.
What should be changed is how tight everything is in general,
the selection box should simply extend more outward. But I
don't really feel like diving into that right now.
2014-02-21 09:51:52 +01:00
Stephan Aßmus
06a4c38e3a Tracker: Don't offset text in selection box
Either the offset was a workaround for some BeOS bug or
backwards compatibility (I know of at least a vertical off-by-one
text positioning on BeOS for backwards compatibility reasons), or
the Haiku (FreeType) text rendering simply differs slightly, which
can't be avoided. In any case, relevant here is what looks better.
Should fix #1319.
2014-02-21 09:41:16 +01:00
John Scipione
14aa801ae9 Update DecorInfo to scan for decorators
Look in system and user packaged and non-packaged decorator directories.
2014-02-20 19:31:49 -05:00
Stephan Aßmus
bb322d3500 BMenuField: Draw everything on resize
* The label might be truncated, in which case the entire width needs to be
   redrawn when the menu field shrinks or grows.
 * Invalidating the border in the parent looked a bit weird. Simplified.
2014-02-18 22:50:07 +01:00
Adrien Destugues
67d06c8802 Httprequest: remove "chunked" from http accept-encoding.
This is useless, chunked support is mandatory in HTTP1.1, and it's not a
content-encoding, but a transfer-encoding, so accept-encoding wouldn't
help anyway.
2014-02-17 14:48:57 +01:00
Stephan Aßmus
3e2e0e63cd BHttpRequest: Improve cookie string building loop...
... to avoid some checks. Does it make the code more readable? Not
that it was hard to follow before.
2014-02-13 12:27:33 +01:00
Stephan Aßmus
1514eb3753 BHttpRequest: More elegant way to build cookieString 2014-02-13 10:21:37 +01:00
Stephan Aßmus
6aeaeade6b BHttpRequest: Small fixes
* Allow BString to find a semicolon more efficiently.
 * Replace a dynamic stack allocated array with BStackOrHeapArray
   in one more place.
2014-02-13 10:12:55 +01:00
Adrien Destugues
3e358c1fca HttpRequest: use BStackOrHeapArray
Sometimes we get enough bytes at once from the connection to trigger a
stack overflow. Allocate memory on the heap instead.
2014-02-13 09:36:40 +01:00
Adrien Destugues
916382a10f Style fixes, no functional changes
* Pointed out by Axel and Ingo.
2014-02-12 14:05:27 +01:00
Adrien Destugues
f6658d2c2c Fix one more status_t/ssize_t mixup. 2014-02-12 09:50:34 +01:00
Jérôme Duval
675878fcfe shared kit: fixed headers dependency. 2014-02-11 18:47:24 +01:00
Jérôme Duval
7202cfb455 build fix follow up on status_t/ssize_t changes.
* added a TODO in packagefs.
2014-02-11 18:26:41 +01:00
Adrien Destugues
19f3bae071 Fix more issues detected by gcc4 compiler:
More ssize_t/status_t mixup.
2014-02-11 17:51:22 +01:00
Adrien Destugues
6555120f3b ...and also fix a mismatched prototype
gcc2 doesn't seem to notice.
2014-02-11 13:26:32 +01:00
Adrien Destugues
c3d0dd7a5e HttpRequest: support gzip and deflate compression.
* Use the ZlibDecompressor to decompress the data
* Advertise support in accept-encoding

This should make web browsing feel even faster on wesites that support
these compresion schemes. It also fixes some websites (www.ru,
rainloop.net, ...) that serve gzipped resources even to browser not
supporting it.
2014-02-11 12:06:42 +01:00
Adrien Destugues
36b1f55a18 DynamicBuffer: implement BDataIO
This makes it possible to use it with the ZlibDecompressor.
2014-02-11 12:06:41 +01:00
Adrien Destugues
142d59ca90 ZlibDecompressor: also accept gzip format
zlib can decompress both gzip and zlib formatted compressed streams. The
compression algorithm is the same, but the headers are different. The
format is autodetected from the data.
2014-02-11 12:06:39 +01:00
Adrien Destugues
9af2105d36 Move ZlibDecompressor to libshared
* This will be used to implement compressed http streams
* Remove the custom BDataOutput class, and use BDataIO instead, for
easier integration with existing code.
2014-02-11 12:06:38 +01:00
Ingo Weinhold
32cae72412 package daemon: Handle location info request in app thread
* ... instead of queuing it for the job thread. The advantage is that
the request will be handled immediately and clients won't have to wait
for transactions (which may even require user feedback) to finish. It
complicates Volume a bit, since there are now two threads that may
access it. The shared data have been moved to a State object which is
protected by a lock.
* For commit transaction requests check whether another package request
is already pending/in progress before queuing a job. Fail immediately,
if there is.

Fixes bug #10039.
2014-02-07 01:21:57 +01:00
Stephan Aßmus
a6db6bd40f Added WIP support for affine transformations to BViews.
Everything untested, but compiles, so it must work. The idea is to introduce
BAffineTransform additionally to the existing Origin and Scale properties of
BViews. One may use it in parallel or as an alternative. Painter in app_server
is not yet aware of the additional transformation. It is however already used
to transform drawing coordinates. It probably needs to work differently,
perhaps only in Painter and AGGTextRenderer.
2014-02-04 22:53:06 +01:00
Ingo Weinhold
d5ed97cd18 LibsolvSolver::GetResult(): Fix package update cases
* The transaction_type(.., ..., SOLVER_TRANSACTION_RPM_ONLY)
categorization of the transaction steps is incorrect since rpm
automatically replaces an older package version when a new one is
installed and thus such package removals would be omitted. Use a
simpler check instead.
* Omit the unnecessary explicit check whether a package really has to be
installed.

Thanks to Michael Schroeder @ SUSE for his help figuring this out.
2014-02-03 23:00:04 +01:00
John Scipione
77acb43273 TextView: Remove Cmd+Up and Cmd+Down Shortcuts
to go to the beginning and end of the document.
2014-02-01 11:04:34 -05:00
John Scipione
9bd08d10ab Tracker: Don't change selection if right-click
... inside a selection. If you click outside a selection extend the
selection to include the new items as Tracker normally would and
then pop up the dialogs.

Works with control-click as well, same utility function used.

Fixes #10449
2014-02-01 04:42:39 -05:00
John Scipione
80f4300a72 Tracker: Make context menu work with control-click
in additional to secondary mouse button click, uses same utility function.
2014-02-01 04:42:38 -05:00
John Scipione
898f108250 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.
2014-02-01 04:42:36 -05:00
John Scipione
eed35bac80 Tracker: add class name to pragma 2014-02-01 04:42:35 -05:00
John Scipione
e37767b0d2 Tracker: some style fixes to BContainerWindow() 2014-02-01 04:42:34 -05:00
John Scipione
6be6813f23 Tracker: swap using std::swap() 2014-02-01 04:42:33 -05:00
John Scipione
fcb24e82c4 Tracker: Only open items if doubleclick w/ primary MB
Also rename fLastClickPt to fLastClickPoint
2014-02-01 04:42:32 -05:00
John Scipione
9d33fe6896 Tracker: Style fixes to BPoseView 2014-02-01 04:42:31 -05:00
Stephan Aßmus
b58b8cdd30 BView: Fix ClipTo[Inverse]Picture() syncing.
When BPictures are created on the stack and go out of scope, they send a
AS_DELETE_PICTURE command to the ServerApp thread, and that command may be
processed sooner than the AS_VIEW_CLIP_TO_PICTURE command in the ServerWindow
thread, causing that command to no longer find a ServerPicture for the given
token. Apparently, the Be API leaves you the choice not to sync, in case for
example when you cache your BPictures and they remain valid. The default
value for "sync" is true. The BeBook could explain the situation better when
sync is needed and when not.
2014-02-01 10:39:12 +01:00
Stephan Aßmus
138e4c77eb BPicture: Attach as many picture tokens as promised. 2014-02-01 10:39:11 +01:00
John Scipione
0875173246 TextView: Update nav shortcuts again
Make Cmd+Left and Cmd+Right work the same as Option+Left and
Option+Right, that is, they do word-wise navigation.

Make Option+Up go to beginning of paragraph and Option+Down go to end
of paragraph like Cmd+Left and Cmd+Right used to.

Unfortunately option shortcuts are currently eaten by S&T until #9431
gets fixed.
2014-01-31 18:30:07 -05:00
John Scipione
eb774c2948 TextView: Update navigation shortcuts
* Command+Left goes to beginning of line, ignoring softwrap
* Command+Right goes to the end of line, ignoring softwrap
* Home goes to beginning of line, accounting for softwrap
* End goes to end of line, accounting for softwrap
* Option+Left goes to previous word
* Option+Right goes to next word
* Command+Home and Command+Up go to beginning of document
* Command+End and Command+Down go to end of document

Shift with any of the above also selects the text.

This is similar to how the text editor Eddie works.
2014-01-30 19:48:31 -05:00
Adrien Destugues
d0fa6c78f4 BView: Allow resetting ClipToPicture
Just like for regions, ClipToPicture(NULL) removes any picture clipping
at the current state level (clipping in pushed states are not undone).
2014-01-28 15:39:36 +01:00
Ingo Weinhold
73ac4cdc3f truncate_string(): Be a lot laxer wrt. rounding incaccuracies
Instead of 1/10000 we now add 1/128 to the width to compensate for
rounding inaccuracies. Due to the limited float mantissa precision
(23 bit) the previous value would already have no effect for relatively
small widths (>= 128).

Fixes #10455.
2014-01-27 16:29:08 +01:00
Alexander von Gluck IV
800d5376f9 package kit: Disable curl requirement on bootstrap build
* As per the mailing list.
* Introduce HAIKU_BOOTSTRAP_BUILD define to sources
  to let them know they are taking part in a bootstrap
2014-01-26 10:42:37 -06:00
Ingo Weinhold
902fd96ce2 MimeInfoUpdater: Don't touch the MIME DB
Use the new SetIconForType() and SetSupportedTypes() versions and
request the MIME DB not to be updated. This changes the
update_mime_info() and mimeset (without -a/-A) behavior in that they
only modify the (application) file attributes, now. Addresses #10453.
2014-01-26 13:43:05 +01:00
Ingo Weinhold
c41356fab5 BAppFileInfo: Add method versions that don't touch the MIME DB
Add SetSupportedTypes() and SetIcon[ForType]() versions with an
additional bool updateMimeDB parameter. If false, the method doesn't
update the MIME DB entries for the type.
2014-01-26 13:43:04 +01:00
Ingo Weinhold
3b07762c54 BAppFileInfo: Coding style update
Also remove doxygen comments.
2014-01-26 13:43:04 +01:00
Ingo Weinhold
ee2974dadb mime/Database: Add SetIcon[ForType]() BBitmap* version
When switching AppMetaMimeCreator from BMimeType to Database the
SetIcon[ForType]() calls with a BBitmap* ended up calling the vector
icon version with the icon_size as the data size argument, thus not only
not writing the bitmap icon attributes, but also clobbering the vector
icon attribute.
2014-01-25 11:53:47 +01:00
Ingo Weinhold
6ef57ae2a9 pkgman: Add full-sync command
* BSolver/LibsolvSolver: Add FullSync() method. It uses libsolv's
SOLVER_DISTUPGRADE mode.
* BPackageManager: Add FullSync() using the new solver mode.
* pkgman: Add full-sync command.

The new command is similar to the update command without arguments, just
more aggressive, allowing downgrading or even removal of packages, to
match the state of the repositories. Just like "update" it doesn't work
properly yet.
2014-01-25 10:47:35 +01:00
Adrien Destugues
35480631f2 Fix various issues with cookie time.
* This is more tricky than it looks.
* We probably want easier conversions from struct tm to BDateTime, and
direct parsing/formating there.
2014-01-23 19:24:34 +01:00
Adrien Destugues
afdca74d9b Make signal handler static
We don't want this method to be exposed in the global namespace!
Also add a note about removing this signal-based solution when our
close() method can be interrupted in other ways.

thanks axel for watching!
2014-01-23 17:23:29 +01:00
Adrien Destugues
d417133ed2 Fix cookies with far expiration date.
Some websites set cookies expiring in the (not so) far future, after year 2038.
So, using time_t to store the cookie expiration date won't do. Use the
BDateTime class instead.

This makes goodsearch.com login work again (#10460).
2014-01-23 17:22:46 +01:00
Adrien Destugues
281727261d urlRequest: interrupt syscalls using a signal
Sometimes an HTTP request would get stuck in a call to connect(). While
our read() and write() implementations are interrupted if you close()
the socket, our connect() isn't. It would nonetheless abort the
connection process, and connect would stay blocked for quite a long
time.

When navigating away from a page, WebKit closes all pending connections,
and in our network backend this also means freeing the request object.
But, the destructor can't be called until the thread has stopped
running, to ensure proper cleanup.

Avoid the lockup in connect by sending a signal (SIGUSR1) to the thread
we want to unlock. This interrupts the syscall, and the thread exits
immediately.
2014-01-23 16:01:39 +01:00
Stephan Aßmus
d5c2ed6b14 FileRequest: Better error handling for size mismatches 2014-01-23 10:20:22 +01:00
Stephan Aßmus
084a160655 FileRequest: Fix transfer error detection not working. CID 1162764 2014-01-22 22:23:31 +01:00
Jérôme Duval
1d63ae96cd libmidi2: fix BMidiRoster init.
* should fix #10175.
2014-01-22 19:12:59 +01:00
Jérôme Duval
c71a35bdd5 PathMonitor: check for NULL before dereferencing.
* should fix #10277.
2014-01-22 18:50:32 +01:00
Stephan Aßmus
840aeab5b9 NetEndpoint: Don't forget to close socket in error case. CID 1162792 2014-01-22 17:41:52 +01:00
Stephan Aßmus
dae0b385cf DataRequest: Don't leak buffer in error case. CID 1162796 2014-01-22 17:41:52 +01:00
Stephan Aßmus
59246cf737 HttpRequest: Apparently fContext can be NULL. CID 1162798 2014-01-22 17:41:51 +01:00
Adrien Destugues
e0d1cc186a BView: move ClipToPicture code to app_server
Now that DrawingContext makes it possible to draw on a ServerBitmap
without the need for a BView, we can replay pictures on app_server side,
avoiding the cost of creating a BBitmap, offscreen BWindow, and BView
from the application side.

The offscreen drawing context gets the same state as the view it's
rendering the picture for, so font size, drawing mode, etc are used.

The implementation is still the suboptimal one, converting the BBitmap
to a BRegion, and using that for clipping. Changing that comes next.
2014-01-22 17:30:12 +01:00
Adrien Destugues
c2dcc4d500 Get test_app_server to run again
* We should have the buildbots compile this to make sure it still works
* I had to split two ServerApp methods to a searate C++ file to link
them in libtestappserver.so
* some fixes related to the switch to PM and better hybrid support in
jam rules; moving of MIME stuff from registrar to storage kit, merge of
Locale Kit and ICU in libbe, and a few more.
* Modified the test_app_server hwinterface and rdef file so it is not a
background app, and the window isn't floating. Otherwise, hiding the
window would leave you without a way to recover it.
2014-01-22 11:12:22 +01:00
Adrien Destugues
8e7d9c7245 Attempt to fix test_appserver build again.
There seem to be a problem with the architecture, when building for an
x86_gcc2 system things are generated in libbe_test/x86, and then fail
with a lot of undefined references. Help welcome.
2014-01-21 17:17:58 +01:00
Rene Gollent
701a5d6b79 Resolve #10435.
Adjust Database{Location} to only attempt to create a mimetype when
actually necessary, and fail otherwise if a writable version doesn't yet
exist. Correspondingly, adjust callers such as
DatabaseLocation::DeleteAttribute(). Fixes a problem where a caller asking
to perform a mimeset could fail early due to SetSupportedTypes() attempting
to update the read-only mime database entry supplied by a package, and
consequently most of the mimeset operations would be skipped.
2014-01-20 20:52:32 -05:00
Adrien Destugues
fed5e6126b LocaleRoster: race condition on catalog loading.
Using a vint32 isn't enough to safely decide if the catalog is
initialized or not. Use init_once features instead.
2014-01-19 12:12:57 +01:00
Adrien Destugues
7e433e7cad FileRequest: set the mime type early.
WebKit may use the MIME type during incremental loading, so we better
set it before we start feeding the data.
2014-01-19 12:09:52 +01:00
Adrien Destugues
32da3d9dae Cookies: avoid timezone confusion
Cookies date are always in GMT time. Using mktime wrongly converts them
as local time instead. This would lead to cookies expiring too early or
too late.
2014-01-19 12:09:51 +01:00
Adrien Destugues
ab390d3af3 Style fixes and allocation checks 2014-01-17 15:08:57 +01:00
Adrien Destugues
9e9ccf69c0 Yet anoter noSSL build fix. 2014-01-17 12:13:27 +01:00
Adrien Destugues
76b3c7f420 More noSSL build fixes. 2014-01-17 11:21:13 +01:00
Pawel Dziepak
d0f2d8282f Merge branch 'scheduler'
Conflicts:
	build/jam/packages/Haiku
	headers/os/kernel/OS.h
	headers/os/opengl/GLRenderer.h
	headers/private/shared/cpu_type.h
	src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.h
	src/bin/sysinfo.cpp
	src/bin/top.c
	src/system/kernel/arch/x86/arch_system_info.cpp
	src/system/kernel/port.cpp
2014-01-17 04:06:15 +01:00
Adrien Destugues
e395fc4f3b NetworkCookieJar: use-after-free, memcpy overwrite
* Add some tracing, std::nothrow and null checks
* The HashString class doesn't like SetTo being called with a substring
of the current key, so use a copy of it instead.

Fixes #6667.
2014-01-16 16:54:51 +01:00
Adrien Destugues
547c1486ff Add some missing std::nothrow
... and allocation failure checks.
2014-01-16 13:29:15 +01:00
Adrien Destugues
b70c72a692 Fix concurrency issues in BSecureSocket
* Use pthread_once to initialize the SSL context once, in a thread-safe
way.
* Do not delete the BIO immediately when closing a connexion, instead
delay this to the destructor. This makes sure the protocol loop is done
running when we do that.
* Instead of creating a new BIO when we reconnect an already used
connection, create the BIO upfront, and reuse it with the new file
descriptor.
* Fix a memory leak: the SSL struct from OpenSSL was never freed, only
the BIO was.

Fixes #10414.
2014-01-16 11:25:47 +01:00
Adrien Destugues
67af469ef0 Fix time_t/bigtime_t mixup.
Thanks stippi for noticing!
2014-01-16 09:41:01 +01:00
Adrien Destugues
3db3864644 Fix crash when trying to open a non-existing file. 2014-01-16 09:30:13 +01:00
Adrien Destugues
385a7d89b7 More style fixes. 2014-01-16 09:30:12 +01:00
Adrien Destugues
159d1fb69a Style fixes, build fix with OpenSSL disabled. 2014-01-15 23:32:10 +01:00
Adrien Destugues
00b65b2d7b FileRequest: multiple fixes
* Don't crash when opening a symlink, traverse it instead.
* Add a ".." entry to navigate to the parent folder
* Set the encoding to utf-8 in the MIME header, but this doesn't seem to
work.
2014-01-15 20:20:58 +01:00
Adrien Destugues
4e4396fa46 Fix build. 2014-01-15 17:52:39 +01:00
Adrien Destugues
5ebdc79955 SecureSocket: add some certificate support
* Instead of creating an OpenSSL context ofor each socket, use a global
one and initialize it lazily when the first SecureSocket is created
* Load the certificates from our certificate list so SSL certificates
sent by servers can be validated.
* Add a callback for signalling that certificate validation failed, the
default implementation proceeds with the connection anyway (to keep the
old behavior).
* Introduce BCertificate class, that provides some information about a
certificate. Currently it's only used by the callback mentionned above,
but it will be possible to get the leaf certificate for the connection
after it's established.

Review of the API and implementation is welcome, before I start making
use of this in HttpRequest and WebKit to allow the user to accept new
certificates.
2014-01-15 17:45:21 +01:00
Adrien Destugues
0e766ecb5b allow BNavMenu to traverse symlinks
* Patch by stpere
* Fixes #6780.
2014-01-13 10:46:09 +01:00
Adrien Destugues
9ab54f9475 Filerequest: UrlDecode() the request.
Makes things work even if the filename has some URL-disallowed
characters (spaces, utf-8, or otherwise).
2014-01-13 09:18:42 +01:00
Adrien Destugues
b3cc244542 Simplify cookie string-ification code. 2014-01-13 09:05:19 +01:00
Adrien Destugues
3d864cd870 Remove B_PROT_* and related code
Use standard error codes instead.
This allows using error code returned by the underlying functions
directly, and makes it possible to use strerror for debugging. So, we
can also remove StatusString() from the various *Request classes.
2014-01-13 08:05:32 +01:00
Adrien Destugues
5e9a96156d FileRequest: style fixes
Pointed out by axeld, stippi and waddlesplash. Thanks for watching.
2014-01-13 08:05:30 +01:00
Stephan Aßmus
5c3fd4605e BView: Don't allow a view to add itself as a child. 2014-01-12 22:06:35 +01:00
Jonathan Schleifer
72b14059a9 Fix sizeof on private, non static variable. 2014-01-10 22:32:10 +01:00
Jonathan Schleifer
f4c2f7ebdb Remove variable length arrays of non-PODs.
Variable length arrays of non-PODs are not part of the C++ standard, but
a GNU extension that never worked correctly. Instead, BStackOrHeap array
is used now, which makes sure that it's not too big for the stack, calls
all constructors and is valid C++.
2014-01-10 22:31:50 +01:00
Jonathan Schleifer
6abec6b93a Declare BLooperListIterator in the right place.
Before, it tried to typedef it to a private struct, but outside of the
class.
2014-01-10 22:31:37 +01:00
Adrien Destugues
090ba6d06b FileRequest: implement directory listings.
Use the EPFL (Easily Parsed File Listing) format. This is one of the
formats that WebKit allows for directory listings, and it's easily
parsed and generated.
2014-01-10 15:32:09 +01:00
noryb009
f466a0b81e Fix Coverity CID 1108465: Use after free
Signed-off-by: Ingo Weinhold <ingo_weinhold@gmx.de>
2014-01-09 06:18:30 +01:00
Alexander von Gluck IV
aa4b5749d6 runtime_loader: Detect and trigger on PE binaries
* Previously PE binaries would trigger the "incorrectly
  executable" dialog. Now we get a special message for
  B_LEGACY_EXECUTABLE and B_UNKNOWN_EXECUTABLE
* Legacy at the moment is a R3 x86 PE binary. This could
  be extended to gcc2 binaries someday far, far, down the
  road though
* The check for legacy is based on a PE flag I see
  set on every R3 binary (that isn't set on dos ones)
* Unknown is something we know *is* an executable, but
  can't do anything with (such as an MSDOS or Windows
  application)
* No performance drops as we do the PE scan last
* Tested on x86 and x86_gcc2
2014-01-07 19:38:07 -06:00
Adrien Destugues
5bdd4157d3 SecureSocket: avoid crash on close
Deleting the BIO while it's still waiting on a read() in another thread
will lead to a crash when the socket is eventually closed. Close the
socket first, so the read() is unlocked, then safely delete the BIO.
2014-01-06 12:48:46 +01:00
Murai Takashi
7727da7d3d Fix mismatching allocation and deallocation 2014-01-03 13:57:03 +01:00
Adrien Destugues
5b53e2e516 HttpRequest: close the connection on Stop()
When calling Stop(), we expect the request thread to exit as soon as
possible. Closing the connection unlocks it from any blocking read() or
write(), avoiding some lockup situations.
2014-01-02 08:38:03 +01:00
Ingo Weinhold
a0848a1916 BButton: Add optional pop-up marker
* Add behavior constant B_POP_UP_BEHAVIOR which adds a pop-up marker
  to the button (similar to that of BMenuField).
* Add methods [Set]PopUpMessage(). To set/get the the message that is
  sent to the button's target when the pop-up marker is clicked.
2013-12-30 04:42:52 +01:00
Ingo Weinhold
87f392c9f0 BControlLook::GetFrameInsets(): Fix button insets
The button frame is 3 pixels wide, but that includes one pixel that
actually belongs to the background, which is accounted for by
GetBackgroundInsets().
Removes the additional one pixel inset accidentally introduced earlier.
2013-12-30 04:18:34 +01:00
Ingo Weinhold
813c5772c9 BButton: Removed dead code
Remove methods _DrawDefault() and _DrawFocusLine() which were used for
the non-BControlLook drawing.
2013-12-30 04:18:33 +01:00
Ingo Weinhold
b998f9f02f BButton: Add support for toggle button behavior
Add methods SetBehavior(), Behavior(). Supported behavior constants are
B_BUTTON_BEHAVIOR -- normal button behavior -- and B_TOGGLE_BEHAVIOR
-- toggle button behavior.
2013-12-29 01:21:45 +01:00
Ingo Weinhold
a249edfbfc BButton: Add flat property
* Add methods SetFlat()/IsFlat(). A flat button doesn't draw its frame,
  unless the mouse is hovering over it or it is otherwise activated.
* As a side effect this change also activates the hover glow that was
  already implemented in BControlLook, but not activated in BButton.
2013-12-29 00:13:49 +01:00
Jérôme Duval
9f79c0ca9a media: Fix ParameterWeb (un)flattening behavior for x86_64.
* should fix #10316.
2013-12-25 18:39:02 +01:00
Freeman Lou
80c9ee9c3f Tracker: exclude trash from selection.
Signed-off-by: Rene Gollent <rene@gollent.com>
2013-12-25 12:09:53 -05:00
John Scipione
63632ee1a2 BListView: Skip disabled items via keys
Update B_UP_ARROW, B_DOWN_ARROW, B_HOME, and B_END
in KeyDown() to skip over disabled items.
2013-12-23 05:03:42 -05:00
John Scipione
c6c5cd9940 BListView: Only select enabled items
when selecting multiple items in a multi-select list view.
2013-12-23 05:03:41 -05:00
John Scipione
b38f03f561 BListView: small optimization.
We already got item at index, don’t get it again
2013-12-23 05:03:40 -05:00
John Scipione
d093101215 BListView: style fixes 2013-12-23 05:03:39 -05:00
Alexander von Gluck IV
eb45d168e1 GL: Remove OpenGL kit, x86 Mesa
* Depend on Mesa packages to provide functionality
2013-12-22 23:36:02 -06:00
Ingo Weinhold
5e815cf35b BRadioButton: Add icon support
* Fix off-by-one issue in Draw() and GetPreferredSize(). The label was
  too close to the knob.
* GetPreferredSize(): Remove empty space to the right, when no label
  and no icon was specified. Like with BCheckBox there's still two rows
  of empty pixels above and below the knob.
* Draw(), GetPreferredSize(): Add icon support.
2013-12-22 15:17:55 +01:00
Ingo Weinhold
36e1566271 BRadioButton: Remove non-BControlLook code 2013-12-22 15:17:54 +01:00
Ingo Weinhold
f0c3101151 BControl: Move icon code to separate class BIcon 2013-12-22 15:17:53 +01:00
Ingo Weinhold
97bf0ce362 BControl: Move icon code to separate class BIcon 2013-12-22 14:45:34 +01:00
Ingo Weinhold
5414b3c445 Move icon related constants to InterfaceDefs.h
There will be non-BControl views to use those as well.
2013-12-22 14:45:33 +01:00