Ryan Lortie [Thu, 26 Mar 2015 03:08:38 +0000 (23:08 -0400)]
file monitors: fix a typo
Due to a typo, a rename reported via a pair of delete/create events (due
to the watcher not giving the flag for moves to be paired) was
accidentally reported as being created with the old name instead of the
new name.
Fix that.
Ryan Lortie [Wed, 25 Mar 2015 13:29:49 +0000 (09:29 -0400)]
GListModel: roll back use of type redefinition
We declare the typedefs for GListModel and GListStore in giotypes.h, as
a matter of convention. This is not actually required, since the
typedef is emitted as part of the G_DECLARE_* macros.
The giotypes.h approach is only used to avoid cyclic dependencies
between headers, which is not a problem in this case.
Type redefinition is a C11 feature, and although it was around in some
compilers before then, gcc 4.2.1 (from 2007) is apparently still in wide
use, being the default compiler for OpenBSD.
Eventually, we will probably hit a case where we actually need to
redefine a type, but since we're not there yet, let's back off a bit.
Petr Kovar [Wed, 25 Mar 2015 12:01:47 +0000 (13:01 +0100)]
Update Czech translation
Ryan Lortie [Sun, 9 Nov 2014 16:22:42 +0000 (11:22 -0500)]
GClosure: add valgrind hints
GClosure has been in the "allocate area before the pointer" game since
before we did this with GTypeInstance. At the time that this was done
for GClosure, we didn't have valgrind.h in GLib.
Now that we do, we should add similar valgrind hints as the ones we did
for GTypeInstance. This substantially reduces reports of "possibly
lost" on pretty much any program that makes use of signals.
https://bugzilla.gnome.org/show_bug.cgi?id=739850
Matthias Clasen [Sun, 22 Mar 2015 19:05:13 +0000 (15:05 -0400)]
Fix the build
The world would be a better place if gcc had __has_feature(), too.
Matthias Clasen [Sun, 22 Mar 2015 18:18:36 +0000 (14:18 -0400)]
Account for clangs lack of __alloc_size__
clang's emulation of gcc 4.3 is not perfect, despite its
pretending that it is.
https://bugzilla.gnome.org/show_bug.cgi?id=745821
Muhammet Kara [Sun, 22 Mar 2015 00:17:31 +0000 (00:17 +0000)]
Updated Turkish translation
Philip Withnall [Thu, 15 May 2014 10:44:18 +0000 (11:44 +0100)]
gsocket: Document FD ownership with g_socket_new_from_fd()
https://bugzilla.gnome.org/show_bug.cgi?id=730188
Ask H. Larsen [Sat, 21 Mar 2015 15:24:42 +0000 (16:24 +0100)]
Updated Danish translation
Christian Kirbach [Sat, 21 Mar 2015 15:22:09 +0000 (15:22 +0000)]
Updated German translation
Inaki Larranaga Murgoitio [Sat, 21 Mar 2015 15:07:05 +0000 (16:07 +0100)]
Updated Basque language
Dan Winship [Fri, 6 Mar 2015 18:43:37 +0000 (13:43 -0500)]
gversionmacros: add 2.46 version macros
Ryan Lortie [Fri, 19 Dec 2014 22:05:59 +0000 (17:05 -0500)]
gmain: Save errno when handling unix signals
Our signal handler calls write() on a pipe or an eventfd in order to
deliver the notification. It's unlikely, but this could fail, setting
errno. We even check the case that it fails with EINTR.
If it does set errno, then it has potentially blown away the value or
errno that the preempted code cared about (ie: if the signal arrived
shortly after a system call but before errno was checked).
Wrap the handler with code to save errno.
https://bugzilla.gnome.org/show_bug.cgi?id=741791
Chun-wei Fan [Thu, 12 Mar 2015 11:20:30 +0000 (19:20 +0800)]
Win32: Port Directory Monitoring to New GLocalFileMonitor
This WIP patch moves the Windows Directory Monitoring code to the new
GLocalFileMonitor mechanism, and adds file monitoring in the process.
Progress from previous patch:
-File renames are now properly supported, but G_FILE_MONITOR_EVENT_MOVED_IN
and G_FILE_MONITOR_EVENT_MOVED_OUT needs to be investigated, as
ReadDirectoryChangesW() seems to send FILE_ACTION_REMOVED when a file is
moved out of a directory.
-Events are handled for both the long and short (8.3) variants of the
filenames, and files monitored will report changes when it is changed
via its short or long filenames.
Things to be done:
-Perhaps find out about attribute changes in files in a monitored
directory; if a file is monitored, attribute changes are correctly
handled.
-Investigate on G_FILE_MONITOR_EVENT_MOVED_OUT,
G_FILE_MONITOR_EVENT_MOVED_IN, G_FILE_MONITOR_EVENT_PRE_UNMOUNT,
G_FILE_MONITOR_EVENT_UNMOUNTED.
-Investigate on the "boredom" algoritm, and see how we can do it on
Windows.
https://bugzilla.gnome.org/show_bug.cgi?id=730116
Ryan Lortie [Sat, 17 Jan 2015 16:11:22 +0000 (11:11 -0500)]
file monitors: rewrite FAM file monitor
Completely rewrite the FAM file monitor. Major changes:
- now runs in the worker thread
- dispatches events in a threadsafe way via GFileMonitorSource
- uses unix fd source instead of a GIOChannel
- is now simple enough to fit into one short file
Ryan Lortie [Sat, 17 Jan 2015 01:25:38 +0000 (20:25 -0500)]
fen: remove Solaris file monitor support
This code is unmaintained and we have no way to port it to the new file
monitoring API.
Ryan Lortie [Fri, 16 Jan 2015 23:51:34 +0000 (18:51 -0500)]
kqueue backend: port to new GLocalFileMonitor API
This is the bare minimal effort. This seems not to crash immediately,
but it definitely needs some better testing.
The backend is not in good shape. It could use some serious work.
Ryan Lortie [Fri, 16 Jan 2015 21:41:21 +0000 (16:41 -0500)]
GPollFileMonitor: use thread default main context
Attach the GPollFileMonitor to the thread default main context instead
of the global default.
This matches the behaviour of the other file monitors.
Ryan Lortie [Thu, 15 Jan 2015 21:38:22 +0000 (16:38 -0500)]
inotify: implement "boredom" algorithm
Use the "interesting" value from g_file_monitor_source_handle_event() to
decide if we're currently being flooded by a stream of boring events.
The main case here is when one or more files is being written to and the
change events are all being rate-limited in the GFileMonitor frontends.
In that case, we become "bored" with the event stream and add a backoff
timeout. In the case that it is exactly one large file being written
(which is the common case) then leaving the event in the queue also lets
the kernel perform merging on it, so when we wake up, we will only see
the one event. Even in the case that the kernel is unable to perform
merging, the context switch overhead will be vastly reduced.
In testing, this cuts down on the number of wake ups during a large file
copy, by a couple orders of magnitude (ie: less than 1% of the number of
wake ups).
Ryan Lortie [Thu, 15 Jan 2015 20:39:43 +0000 (15:39 -0500)]
GFileMonitorSource: return "interesting" value
Return an "interesting" boolean from the event handler function on
GFileMonitorSource.
An event was "interesting" if it will result in a signal actually being
dispatched to the user. It is "uninteresting" if it only hit an
already-dirty rate limiter.
We will use this information to do some backing off in the backends when
faced with a flood of uninteresting events.
Ryan Lortie [Thu, 15 Jan 2015 16:08:35 +0000 (11:08 -0500)]
inotify: send CHANGES_DONE when new files 'appear'
We generally assume that an IN_CREATE event is the start of a series of
events in which another process is doing this:
fd = creat (...) -> IN_CREATE
write (fd, ..) -> IN_MODIFY
write (fd, ..) -> IN_MODIFY
close (fd) -> IN_CLOSE_WRITE
and as such, we use the CHANGES_DONE_HINT event after CREATED in order
to show when this sequence of events has completed (ie: when we receive
IN_CLOSE_WRITE when the user closes the file).
Renaming a file into place is handled by IN_MOVED_FROM so we don't have
to worry about that.
There are many other cases, however, where a new file 'appears' in a
directory in its completed form already, and the kernel reports
IN_CREATE. Examples include mkdir, mknod, and the creation of
hardlinks. In these cases, there is no corresponding IN_CLOSE_WRITE
event and the CHANGES_DONE_HINT will have to be emitted by an arbitrary
timeout.
Try to detect some of these cases and report CHANGES_DONE_HINT
immediately.
This is not perfect. There are some cases that will not be reliably
detected. An example is if the user makes a hardlink and then
immediately deletes the original (before we can stat the new file).
Another example is if the user creates a file with O_TMPFILE. In both
of these cases, CHANGES_DONE_HINT will still eventually be delivered via
the timeout.
Ryan Lortie [Mon, 12 Jan 2015 19:59:35 +0000 (14:59 -0500)]
substantially rework file monitors
Remove all event merging and dispatch logic from GFileMonitor. The only
implementation of GFileMonitor outside of glib is in gvfs and it already
does these things properly.
Get rid of GLocalDirectoryMonitor. We will use a single class,
GLocalFileMonitor, for both directory and file monitoring. This will
prevent every single backend from having to create two objects
separately (eg: ginotifydirectorymonitor.c and ginotifyfilemonitor.c).
Introduce GFileMonitorSource as a thread-safe cross-context dispatch
mechanism. Put it in GLocalFileMonitor. All backends will be expected
to dispatch via the source and not touch the GFileMonitor object at all
from the worker thread.
Remove all construct properties from GLocalFileMonitor and remove the
"context" construct property from GFileMonitor. All backends must now
get the information about what file to monitor from the ->start() call
which is mandatory to implement.
Remove the implementation of rate limiting in GFileMonitor and add an
implementation in GLocalFileMonitor. gvfs never did anything with this
anyway, but if it wanted to, it would have to implement it for itself.
This was done in order to get the rate_limit field into the
GFileMonitorSource so that it could be safely accessed from the worker
thread.
Expose g_local_file_is_remote() internally for NFS detection.
With the "is_remote" functionality exposed, we can now move all
functions for creating local file monitors to a proper location in
glocalfilemonitor.c
Port the inotify backend to adjust to the changes above. None of the
other backends are ported yet. Those will come in future commits.
Ryan Lortie [Fri, 6 Mar 2015 02:28:29 +0000 (21:28 -0500)]
inotify: rewrite inotify-kernel
Remove the hardwired 1 second event queue logic from inotify-kernel and
replace it with something vastly less complicated.
Events are now reported as soon as is possible instead of after a
delay.
We still must delay IN_MOVED_FROM events in order to look for the
matching IN_MOVED_TO events, and since we want to report events in order
this means that events behind those events can also be delayed. We
limit ourselves, however:
- no more than 100 events can be delayed at a time
- no event can be delayed by more than 10ms
https://bugzilla.gnome.org/show_bug.cgi?id=627285
Ryan Lortie [Fri, 6 Mar 2015 02:05:06 +0000 (21:05 -0500)]
GLocalFile: add _new_from_dirname_and_basename
Add a new internal constructor for GLocalFile (which itself is private).
This new constructor allows creating a GLocalFile from a dirname and a
basename, assuming that the dirname is already in canonical form and the
basename is a regular basename.
This will be used for creating GLocalFile instances from the file
monitoring code (for signal emissions).
Jiri Grönroos [Fri, 20 Mar 2015 15:43:30 +0000 (17:43 +0200)]
Finnish translation update
Kjartan Maraas [Thu, 19 Mar 2015 20:16:10 +0000 (21:16 +0100)]
Updated Norwegian bokmål translation.
Jasper St. Pierre [Wed, 18 Mar 2015 21:28:07 +0000 (14:28 -0700)]
Update .gitignore
Yosef Or Boczko [Tue, 17 Mar 2015 10:27:19 +0000 (12:27 +0200)]
Updated Hebrew translation
Ryan Lortie [Mon, 16 Mar 2015 19:22:03 +0000 (15:22 -0400)]
bump version (to GLib 2.45.0)
Ryan Lortie [Mon, 16 Mar 2015 18:25:53 +0000 (14:25 -0400)]
GLib 2.43.92
Stas Solovey [Mon, 16 Mar 2015 10:01:52 +0000 (10:01 +0000)]
Updated Russian translation
Matej Urbančič [Sun, 15 Mar 2015 13:31:13 +0000 (14:31 +0100)]
Updated Slovenian translation
Claude Paroz [Sat, 14 Mar 2015 08:34:57 +0000 (09:34 +0100)]
Updated French translation
A S Alam [Sat, 14 Mar 2015 03:50:42 +0000 (22:50 -0500)]
Translation pa updated for Gnome
Ryan Lortie [Fri, 13 Mar 2015 21:34:57 +0000 (17:34 -0400)]
ContextSpecificGroup: some fixups
For all of the effort spent ensuring that this algorithm would be
correctly threadsafe, I messed up the order of operations within a
single thread when porting to the new approach.
Fix that up.
Also: fix some overzealous asserting in the testcases. Since shutdown
is now lazy, we can never surely say !is_running at any particular point
in time.
Samir Ribic [Fri, 13 Mar 2015 20:57:49 +0000 (20:57 +0000)]
Updated Bosnian translation
Sebastian Rasmussen [Fri, 13 Mar 2015 17:16:00 +0000 (17:16 +0000)]
Updated Swedish translation
Philip Withnall [Fri, 13 Mar 2015 09:10:01 +0000 (09:10 +0000)]
goption: Mention type of G_OPTION_ARG_CALLBACK in documentation
Tim-Philipp Müller [Fri, 12 Dec 2014 01:38:24 +0000 (01:38 +0000)]
threads: use FUTEX_WAIT_PRIVATE and FUTEX_WAKE_PRIVATE if possible
This avoids some expensive code paths in the kernel, see
http://lwn.net/Articles/229668/
https://bugzilla.gnome.org/show_bug.cgi?id=741442
Ryan Lortie [Thu, 12 Mar 2015 21:24:05 +0000 (17:24 -0400)]
docs: clean up a few glib issues
Fix a few typical problems, and also stop wrapping the inline definition
of g_steal_pointer in parens, since it is not necessary and it confuses
gtk-doc.
Ryan Lortie [Thu, 12 Mar 2015 21:01:00 +0000 (17:01 -0400)]
gio docs: remote errant colon from docstring
This does not belong there.
Ryan Lortie [Thu, 12 Mar 2015 20:53:18 +0000 (16:53 -0400)]
Convert remaining uses of 'Rename to:'
This was replaced by (rename-to) in 2013 (see bug 676133).
They're also causing gtk-doc trouble, so let's get rid of them.
Ryan Lortie [Thu, 12 Mar 2015 20:43:02 +0000 (16:43 -0400)]
docs: more cleanups for GIO
Xavier Claessens [Wed, 11 Feb 2015 16:27:28 +0000 (11:27 -0500)]
Doc: Fix missing API from GOptionGroup boxing
Xavier Claessens [Thu, 5 Feb 2015 18:10:14 +0000 (13:10 -0500)]
Doc: Mark a few things as private
Xavier Claessens [Wed, 28 Jan 2015 17:25:10 +0000 (12:25 -0500)]
Win32: Move g_win32_check_windows_version() to the correct place in header
It was added after G_END_DECLS, outside the #ifdef G_PLATFORM_WIN32,
and inside a #ifndef __GTK_DOC_IGNORE__ block. So it was missing from
the doc.
https://bugzilla.gnome.org/show_bug.cgi?id=743661
Rūdolfs Mazurs [Thu, 12 Mar 2015 19:54:49 +0000 (21:54 +0200)]
Updated Latvian translation
Changwoo Ryu [Wed, 11 Mar 2015 17:51:35 +0000 (02:51 +0900)]
Updated Korean translation
Tom Tryfonidis [Wed, 11 Mar 2015 13:12:14 +0000 (13:12 +0000)]
Updated Greek translation
Jordi Mas [Tue, 10 Mar 2015 21:44:19 +0000 (17:44 -0400)]
Update Catalan translation
Benjamin Steinwender [Tue, 10 Mar 2015 20:56:05 +0000 (20:56 +0000)]
Updated German translation
Piotr Drąg [Tue, 10 Mar 2015 18:50:30 +0000 (19:50 +0100)]
Updated POTFILES.in
Philip Withnall [Thu, 21 Aug 2014 18:04:04 +0000 (19:04 +0100)]
gtask: Add a GTask:completed property
This can be used to query whether the task has completed, in the sense
that it has had a result set on it, and has already – or will soon –
invoke its callback function.
Notifications for this property are emitted immediately after the task’s
main callback, in the same main context as that callback. This allows
for multiple bits of code to listen for completion of the GTask, which
opens the door for blocking on cancellation of the GTask and improved
handling of ‘pending’ behaviour.
https://bugzilla.gnome.org/show_bug.cgi?id=743636
Alexander Shopov [Tue, 10 Mar 2015 08:35:24 +0000 (10:35 +0200)]
Updated Bulgarian translation
Dušan Kazik [Mon, 9 Mar 2015 11:48:33 +0000 (11:48 +0000)]
Updated Slovak translation
Trần Ngọc Quân [Mon, 9 Mar 2015 06:26:18 +0000 (13:26 +0700)]
Updated Vietnamese translation
Signed-off-by: Trần Ngọc Quân <vnwildman@gmail.com>
Daniel Mustieles [Sun, 8 Mar 2015 20:25:11 +0000 (21:25 +0100)]
Updated Spanish translation
Aurimas Černius [Sun, 8 Mar 2015 18:26:36 +0000 (20:26 +0200)]
Updated Lithuanian translation
Baurzhan Muftakhidinov [Sun, 8 Mar 2015 18:06:01 +0000 (18:06 +0000)]
Updated Kazakh translation
Balázs Úr [Sun, 8 Mar 2015 17:38:41 +0000 (17:38 +0000)]
Updated Hungarian translation
Milo Casagrande [Sun, 8 Mar 2015 15:32:40 +0000 (15:32 +0000)]
Updated Italian translation
Piotr Drąg [Sun, 8 Mar 2015 14:42:16 +0000 (15:42 +0100)]
Updated Polish translation
Piotr Drąg [Sun, 8 Mar 2015 14:39:02 +0000 (15:39 +0100)]
Updated POTFILES.in
Changwoo Ryu [Sat, 7 Mar 2015 18:31:59 +0000 (03:31 +0900)]
Updated Korean translation
Dan Winship [Tue, 9 Dec 2014 12:35:06 +0000 (13:35 +0100)]
GSocketClient: fix handling of application proxies
g_socket_client_add_application_proxy() claimed "When the indicated
proxy protocol is returned by the #GProxyResolver, #GSocketClient will
consider this protocol as supported but will not try to find a #GProxy
instance to handle handshaking." But in fact, it did the checks in the
wrong order, so GProxy proxies ended up overriding
application-specified ones. Fix that.
Also, simplify the code a bit by making use of g_hash_table_add() and
g_hash_table_contains().
https://bugzilla.gnome.org/show_bug.cgi?id=733876
Paolo Borelli [Sat, 28 Feb 2015 10:05:02 +0000 (11:05 +0100)]
HTTP proxy support
Based on code from "WockyHttpProxy" written by Nicolas Dufresne
and Marc-André Lureau. Initial glib patch by Brian J. Murrell.
https://bugzilla.gnome.org/show_bug.cgi?id=733876
Chun-wei Fan [Thu, 5 Mar 2015 08:13:03 +0000 (16:13 +0800)]
Windows: Use Standard Networking Functions If Possible
Currently, the Windows code use Winsock2-specific APIs to try to emulate
calls such as inet_pton(), inet_ntop() and if_nametoindex(), which may not
do the job all the time. On Vista and later, Winsock2 does provide a
proper implementation for these functions, so we can use them if they exist
on the system, by querying for them during g_networking_init(). Otherwise,
we continue to use the original code path for these, in the case of XP and
Server 2003.
This enables many of the network-address tests to pass on Windows as a
result, when the native Winsock2 implementations can be used.
https://bugzilla.gnome.org/show_bug.cgi?id=730352
ria.freelander@gmail.com [Thu, 5 Mar 2015 13:07:00 +0000 (13:07 +0000)]
gfdonotificationbackend: support themed icons
The spec allows setting the "image-path" hint to an icon name as well.
https://bugzilla.gnome.org/show_bug.cgi?id=745634
Chun-wei Fan [Mon, 19 Jan 2015 03:03:57 +0000 (11:03 +0800)]
gresolver.c: Windows: Fix IPv6 Address Handling
Check the IPv6 addresses on Windows, as we need to reject those that have
brackets/ports around them as valid addresses in this form would have been
accepted during the call to g_inet_address_new_from_string ().
https://bugzilla.gnome.org/show_bug.cgi?id=730352
Marc-Antoine Perennou [Wed, 4 Mar 2015 10:46:46 +0000 (11:46 +0100)]
gio: add some missing autocleanup
https://bugzilla.gnome.org/show_bug.cgi?id=745589
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Chun-wei Fan [Wed, 4 Mar 2015 12:11:43 +0000 (20:11 +0800)]
MSVC Builds: Few More Enahncements
Update the .pdb file generation for the MSVC 2010+ DLLs (and the x64 gspawn
helper programs), so that they match the names of the DLLs/EXEs that are
built. Also update the .lib generation so that all will use -$(ApiVersion)
from the property sheets instead of the -2.0 which was previously hard
coded (as we will eventually move into GLib 3.x in the future, for example)
Philip Withnall [Wed, 4 Mar 2015 08:52:22 +0000 (08:52 +0000)]
gobject: Mark a helper variable as const
It’s only used for argv values, which are not modified here.
https://bugzilla.gnome.org/show_bug.cgi?id=614684
Philip Withnall [Fri, 19 Dec 2014 18:21:30 +0000 (18:21 +0000)]
gerror: Minor clarifications to the GError documentation
• Clarify that GError** parameters are for the return of _newly
allocated_ GError*s.
• Clarify that errors may need to be checked for explicitly if the
return value of a function doesn’t reliably indicate them.
https://bugzilla.gnome.org/show_bug.cgi?id=741779
Мирослав Николић [Tue, 3 Mar 2015 19:05:47 +0000 (20:05 +0100)]
Updated Serbian translation
Philip Withnall [Fri, 19 Dec 2014 17:08:59 +0000 (17:08 +0000)]
gvariant: Use ‘UTF-8’ in docs rather than ‘utf8’
Nitpicky correction.
https://bugzilla.gnome.org/show_bug.cgi?id=741779
Philip Withnall [Fri, 19 Dec 2014 15:33:59 +0000 (15:33 +0000)]
gmain: Explicitly document the threading behaviour of g_timeout_add()
i.e. That calling g_timeout_add() from a thread other than the main one
probably doesn’t do what you want. Same for g_idle_add() and the
*_full() variants.
https://bugzilla.gnome.org/show_bug.cgi?id=741779
Philip Withnall [Fri, 19 Dec 2014 19:02:15 +0000 (19:02 +0000)]
gobject: Mention g_clear_object() in g_object_unref() documentation
https://bugzilla.gnome.org/show_bug.cgi?id=741779
Philip Withnall [Fri, 19 Dec 2014 19:01:06 +0000 (19:01 +0000)]
gmem: Clarify that a NULL check is not needed before calling g_free()
It was documented before, but wasn’t especially clear. Doing
if (X)
g_free (X);
is apparently quite a pervasive real-world anti-pattern, so perhaps it
could be documented more explicitly.
https://bugzilla.gnome.org/show_bug.cgi?id=741779
Philip Withnall [Fri, 19 Dec 2014 18:53:54 +0000 (18:53 +0000)]
glist: Clarify that g_list_nth() is expensive
Just in case people have forgotten their basic algorithms course. Seen
in some pretty terrible code in the wild; hopefully mentioning the cost
in the documentation will make people think twice about using a counter
variable when iterating over a linked list.
https://bugzilla.gnome.org/show_bug.cgi?id=741779
Philip Withnall [Fri, 19 Dec 2014 18:53:22 +0000 (18:53 +0000)]
glist: Clarify how g_list_free_1() handles links
It doesn’t, which is fine, but could be unexpected if undocumented.
https://bugzilla.gnome.org/show_bug.cgi?id=741779
Philip Withnall [Fri, 19 Dec 2014 18:52:32 +0000 (18:52 +0000)]
ghash: Document that g_hash_get_[keys|values]() are expensive
And definitely not the right way to iterate over a hash table (as seen
in code in the wild).
https://bugzilla.gnome.org/show_bug.cgi?id=741779
Philip Withnall [Thu, 18 Dec 2014 11:23:05 +0000 (11:23 +0000)]
gparamspecs: Recommend use of most specific GParamSpec types
It’s quite common to see a g_param_spec_pointer() used for GObject or
boxed types which, while not incorrect, does make memory management
unsafe, since no copying or reference counting can be performed
automatically.
Similarly, people often use g_param_spec_boolean() when an enum would be
more appropriate, cf.
http://blog.ometer.com/2011/01/20/boolean-parameters-are-wrong/
Using enums also means that the set of allowable values can be extended
in future if needed.
In the hope that people who write code like that read the documentation,
mention the more specific types in the documentation.
https://bugzilla.gnome.org/show_bug.cgi?id=741779
Philip Withnall [Wed, 18 Feb 2015 17:01:18 +0000 (17:01 +0000)]
docs: Expand introduction to mention using async calls over sync ones
As discussed on the mailing list (see the whole thread):
https://mail.gnome.org/archives/desktop-devel-list/2015-February/msg00126.html
Expand the GIO documentation introduction to talk a little about when to
use async and sync functions, and how the former should almost always be
preferred over the latter.
Link to this from the GFile documentation, which is an entry point for a
lot of async calls.
https://bugzilla.gnome.org/show_bug.cgi?id=744722
Philip Withnall [Wed, 14 Jan 2015 10:44:52 +0000 (10:44 +0000)]
gstring: Mark the return value from g_string_free() as nullable
It’s NULL iff free_segment is TRUE, so the annotation doesn’t quite
capture all the function definition, but is a safe over-estimate of the
return value’s nullability.
https://bugzilla.gnome.org/show_bug.cgi?id=719966
Philip Withnall [Fri, 20 Jun 2014 20:20:36 +0000 (21:20 +0100)]
gfileutils: Mark the return value from g_path_skip_root() as nullable
It returns NULL for non-absolute paths.
https://bugzilla.gnome.org/show_bug.cgi?id=719966
Philip Withnall [Wed, 18 Feb 2015 17:58:32 +0000 (17:58 +0000)]
docs: Remove redundant header examples from GObject tutorial
These are in the header boilerplate section, but are actually source
boilerplate which is covered in later sections.
https://bugzilla.gnome.org/show_bug.cgi?id=744060
Philip Withnall [Fri, 20 Feb 2015 14:29:43 +0000 (14:29 +0000)]
docs: Change tutorial encodings from ISO-8859-1 to UTF-8
ISO-8859-1 — that’s a blast from the past.
https://bugzilla.gnome.org/show_bug.cgi?id=744060
Chun-wei Fan [Tue, 3 Mar 2015 11:21:40 +0000 (19:21 +0800)]
Visual Studio Builds: "Install" .pdb files
They are helpful in debugging in a stack.
Chun-wei Fan [Tue, 3 Mar 2015 10:24:08 +0000 (18:24 +0800)]
MSVC Builds: GIO: Standardize zlib Linking
Link to zlib1.lib for all builds, as:
-The notion of zlib1d.lib is rather not standardized across the board for
most cases.
-Easier for the grand all-in-one solution file.
Chun-wei Fan [Tue, 3 Mar 2015 10:09:42 +0000 (18:09 +0800)]
Visual Studio 2008 Builds: Speed Up Release Builds
Use the /MP option so that each project can build multiple sources in
parallel, which can cut down release build times by quite a bit. This will
cause a brief warning for debug builds due to their use of /Gm, and builds
would otherwise proceed as they did before.
Unfortunately Visual Studio 2008 is too old to support the /d2Zi+ flag, so
we can't make a better debug situation for it at the moment.
Chun-wei Fan [Tue, 3 Mar 2015 05:52:22 +0000 (13:52 +0800)]
MSVC Builds: Improve Build Speed and Debugging
Use Multiprocessor compilation which can cut down build times by quite a
bit and use the /d2Zi+ flag to have better debugging info being logged to
the .pdb for release builds.
These are only applicable for Visual Studio 2010/2012 and later.
Chun-wei Fan [Tue, 3 Mar 2015 04:05:50 +0000 (12:05 +0800)]
MSVC Builds: Fix and Update "Installation"
The gobjectnotifyqueue.c was accidently dropped from the files to copy, and
a new public header for GIO was added, so address these parts.
Marek Černocký [Mon, 2 Mar 2015 20:52:32 +0000 (21:52 +0100)]
Updated Czech translation
Ryan Lortie [Thu, 12 Feb 2015 17:18:22 +0000 (12:18 -0500)]
GContextSpecificGroup: fix deadlock
There was a theoretical deadlock between the worker trying to emit a
signal at the same time as we were waiting for it to shutdown the
notification (while holding the lock).
The deadlock was particularly annoying because we didn't really need to
wait for the shutdown and because it wasn't possible to signals to
arrive while waiting for a start. Attempting to deal with start and
stop in an asymmetric way could have lead to other weird situations,
however.
Drop the lock while waiting for the worker thread to start. This means
that we face the possibility of multiple waiters on the cond at the same
time, so we need to make more of a state machine.
https://bugzilla.gnome.org/show_bug.cgi?id=742599
Ryan Lortie [Sun, 25 Jan 2015 15:16:50 +0000 (15:16 +0000)]
tests: add some tests for GContextSpecificGroup
https://bugzilla.gnome.org/show_bug.cgi?id=742599
Ryan Lortie [Thu, 8 Jan 2015 06:35:33 +0000 (01:35 -0500)]
Make GUnixMountMonitor per-context
GUnixMountMonitor was not threadsafe before. It was a global singleton
which emitted signals in the first thread that happened to construct it.
Move it to a per-context singleton model where each GMainContext gets
its own GUnixMountMonitor. Monitor for the changes from the GLib worker
thread and dispatch the results to each context with an active monitor.
https://bugzilla.gnome.org/show_bug.cgi?id=742599
Ryan Lortie [Thu, 8 Jan 2015 04:52:53 +0000 (23:52 -0500)]
gunixmounts: move GUnixMountMonitor code
Move this code to the correct part of the file.
While we're at it, drop an unused #define MOUNT_POLL_INTERVAL.
https://bugzilla.gnome.org/show_bug.cgi?id=742599
Ryan Lortie [Thu, 8 Jan 2015 04:49:47 +0000 (23:49 -0500)]
gunixmounts.c: add fold markers
This is a large file with a lot of very complicated code in it. Add
some fold markers to make things a bit more manageable.
https://bugzilla.gnome.org/show_bug.cgi?id=742599
Ryan Lortie [Thu, 8 Jan 2015 07:16:50 +0000 (02:16 -0500)]
Deprecate g_unix_mount_monitor_set_rate_limit()
Deprecate g_unix_mount_monitor_set_rate_limit() and turn it into a
no-op.
This function doesn't behave as advertised. It only controls rate
limiting for filesystem-based monitors. It has no impact over reporting
mount changes on Linux, for example, because those are based on polling
for changes in /proc (which doesn't use filesystem monitors). It also
has no impact on Mac OS because a library interface is used there.
This was added in https://bugzilla.gnome.org/show_bug.cgi?id=521946 in
order to be used by HAL, which is effectively dead. udisks no longer
uses this code at all.
https://bugzilla.gnome.org/show_bug.cgi?id=742599
Ryan Lortie [Thu, 8 Jan 2015 07:03:18 +0000 (02:03 -0500)]
Rename g_unix_mount_monitor_new() to _get()
This is a singleton, but we have a function called _new() to get it.
What's worse is that the documentation makes no mention of this, and
actually specifically says that a new monitor will be created each time.
https://bugzilla.gnome.org/show_bug.cgi?id=742599