Commit Graph

128 Commits

Author SHA1 Message Date
Lars Uebernickel
b32f8ba19b gapplication: add a way to override the app-id
Some applications support running in a mode where they present
themselves as a different application to the user (for example web
browsers or terminals).

To facilitate this, add an option --gapplication-app-id which allows
users to override an application's id from desktop files or similar.

Applications need to opt-in to this by setting the
G_APPLICATION_CAN_OVERRIDE_APP_ID flag.

https://bugzilla.gnome.org/show_bug.cgi?id=743933
2016-02-18 08:18:58 -05:00
Matthias Clasen
caf03300e5 Remove leftover markup 2016-02-17 20:10:43 -05:00
Debarshi Ray
cd1eba043c docs: Improve the text on G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START
... and fix a couple of typos in the process.

https://bugzilla.gnome.org/show_bug.cgi?id=756251
2015-10-09 14:16:29 +02:00
Olivier Crête
be732677f5 gio: Add G_IO_ERROR_MESSAGE_TOO_LARGE
Corresponding to EMSGSIZE, for when UDP datagrams are rejected due to
being too big.

https://bugzilla.gnome.org/show_bug.cgi?id=752240
2015-10-01 14:31:40 +01:00
Jan Safranek
b31a873fb3 GDBus: Add new call flag to allow interactive authorization
DBus has recently introduced new message flag
DBUS_HEADER_FLAG_ALLOW_INTERACTIVE_AUTHORIZATION, which tells that
caller is willing to wait for unspecified amount of time for the call
to return, as the service may perform interactive authorization (e.g.
using polkit).

https://bugzilla.gnome.org/show_bug.cgi?id=739616
2015-06-05 14:35:34 -04:00
Paolo Borelli
b64e2956f6 Add an event signal to GSocketListener
This allows the caller to know when a socket has been bound so that
it can for instance set the SO_SENDBUF and SO_RECVBUF socket options
before listen is called

https://bugzilla.gnome.org/show_bug.cgi?id=738207
2015-04-04 21:26:15 +02:00
Ryan Lortie
2737ab3201 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.
2015-03-20 11:59:47 -04:00
Dan Winship
f8da414d08 gio: fix the Since/AVAILABLE version on network connectivity stuff 2014-12-10 18:39:21 +01:00
Dan Winship
8d08b82109 gio: add network connectivity state to GNetworkMonitor
Add a property to GNetworkMonitor indicating the level of network
connectivity: none/local, limited, stuck behind a portal, or full.

The default implementation just returns none or full depending on the
value of is-available.

https://bugzilla.gnome.org/show_bug.cgi?id=664562
2014-12-05 17:37:41 +01:00
Ignacio Casal Quinteiro
22ab227348 gio: fix build
next time I should definitely try to compile after a rebase conflict...
2014-12-02 14:29:50 +01:00
Ignacio Casal Quinteiro
fbfc23453d gio: add G_IO_ERROR_NOT_CONNECTED
It adds a new error G_IO_ERROR_NOT_CONNECTED
and makes the win32 error ERROR_PIPE_LISTENING
to be translated to it.

https://bugzilla.gnome.org/show_bug.cgi?id=741016
2014-12-02 14:21:14 +01:00
Dan Winship
967fedc0ae gsocket: add G_IO_ERROR_CONNECTION_CLOSED
Add G_IO_ERROR_CONNECTION_CLOSED as an alias for
G_IO_ERROR_BROKEN_PIPE, and also return it on ECONNRESET.

It doesn't really make sense to try to distinguish EPIPE and
ECONNRESET at the GLib level, since the exact choice of which error
gets returned in what conditions depends on the OS. Given that, we
ought to map the two errors to the same value, and since we're already
mapping EPIPE to G_IO_ERROR_BROKEN_PIPE, we need to map ECONNRESET to
that too. But the existing name doesn't really make sense for sockets,
so we add a new name.

https://bugzilla.gnome.org/show_bug.cgi?id=728928
2014-11-29 14:26:42 -05:00
Ting-Wei Lan
45344f3622 GCredentials: Fix ABI break when adding NetBSD support
https://bugzilla.gnome.org/show_bug.cgi?id=728256
2014-09-30 00:42:00 +08:00
Patrick Welche
afce39c228 gcredentials: add NetBSD support
https://bugzilla.gnome.org/show_bug.cgi?id=728256
2014-06-28 14:06:36 -04:00
Lars Uebernickel
01098e34c1 GNotification: add priority
https://bugzilla.gnome.org/show_bug.cgi?id=731623
2014-06-28 14:05:23 -04:00
Murray Cumming
2a27b72522 GDBusError enum: Remove trailing comma.
This is helpful to people using the g++ --pedantic option.
2014-05-22 12:46:07 +02:00
Volker Sobek
4441595378 docs: Remove <!-- --> comment before plural s
These did show up in the html. Since symbol names are checked for a
trailing plural s when generating the docs, the links stay functional
after removing these comments.

https://bugzilla.gnome.org/show_bug.cgi?id=728380
2014-04-24 13:42:37 +02:00
Stef Walter
76d6fd01de gio: Add newer dbus UnknownXxxx and PropertyReadOnly errors
Add G_DBUS_ERROR codes for:

 * org.freedesktop.DBus.Error.UnknownObject
 * org.freedesktop.DBus.Error.UnknownInterface
 * org.freedesktop.DBus.Error.UnknownProperty
 * org.freedesktop.DBus.Error.PropertyReadOnly

These were discussed on the dbus mailing list
and introduced in the following libdbus commit:

2c34514620c4b79ea4ec71d1db583379138d01ac

https://bugzilla.gnome.org/show_bug.cgi?id=727900
2014-04-09 20:48:19 +02:00
Dan Winship
9fc35dbfb6 gioerror: map some more values to G_IO_ERROR_NOT_SUPPORTED
Map EPROTONOSUPPORT, ESOCKTNOSUPPORT, EPFNOSUPPORT and EAFNOSUPPORT to
G_IO_ERROR_NOT_SUPPORTED in g_io_error_from_errno(). (GSocket's
socket_io_error_from_errno() already did this with the corresponding
Winsock errors.)

Also map EOPNOTSUPP, which on Linux is the same as ENOTSUP, but may
not be on other platforms.

Also, rewrite the EAGAIN/EWOULDBLOCK section to use the simpler idiom
used by EEXIST/ENOTEMPTY and (now) ENOTSUP/EOPNOTSUPP.
2014-03-30 11:06:35 -04:00
Dan Winship
c67d23aa2f Clarify expectations with error codes like G_IO_ERROR_FAILED
If an error code enumeration is expected to be extended in the future,
people shouldn't compare explicitly against its generic "FAILED" value.

https://bugzilla.gnome.org/show_bug.cgi?id=726775
2014-03-20 09:31:56 -04:00
Matthias Clasen
49cc207e35 docs: Ditch more markup
Some markup was hiding in docs in headers. Drop it there, too.
2014-03-02 18:23:43 -05:00
Philip Withnall
d173d97c9b gsubprocess: Fix ‘Since’ lines in documentation to read 2.40
GSubprocess was introduced in GLib 2.40, not 2.36.

https://bugzilla.gnome.org/show_bug.cgi?id=724001
2014-02-10 08:50:36 +00:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Stef Walter
65af7c47ff Add a request_certificate virtual method to GTlsInteraction
This allows GTlsConnection implementations to request a certificate
from the user.

Fix ups by Dan Winship <danw@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=637257
2013-10-28 09:36:26 +01:00
Colin Walters
5b48dc40cc GSubprocess: New class for spawning child processes
There are a number of nice things this class brings:

0) Has a race-free termination API on all platforms (on UNIX, calls to
   kill() and waitpid() are coordinated as not to cause problems).
1) Operates in terms of G{Input,Output}Stream, not file descriptors
2) Standard GIO-style async API for wait() with cancellation
3) Makes some simple cases easy, like synchronously spawning a
   process with an argument list
4) Makes hard cases possible, like asynchronously running a process
   with stdout/stderr merged, output directly to a file path

Much rewriting and code review from Ryan Lortie <desrt@desrt.ca>

https://bugzilla.gnome.org/show_bug.cgi?id=672102
2013-10-17 14:32:44 -04:00
Dan Winship
5a269e5a90 gcredentials: add Solaris support
Based on patches from Igor Pashev.

https://bugzilla.gnome.org/show_bug.cgi?id=705029
2013-10-04 09:51:31 -04:00
Giovanni Campagna
32d2539295 GDBusProxy: add flag to control autostarting at construction time
Sometimes the application doesn't want to autostart a service
when it creates a proxy, but wants the service autostarted when
it makes the first method call. Allow that behavior with a new
flag.

https://bugzilla.gnome.org/show_bug.cgi?id=708828
2013-10-04 02:38:17 +02:00
Ryan Lortie
6ec2bb17c3 GFile: add new g_file_measure_disk_usage() API
This is essentially the equivalent of 'du'.

This is currently only supported on local files.  gvfs will add support for the
interface later.

https://bugzilla.gnome.org/show_bug.cgi?id=704893
2013-09-06 13:16:17 -04:00
Lars Uebernickel
00f6d78125 g_dbus_connection_signal_subscribe: add path and namespace matching
https://bugzilla.gnome.org/show_bug.cgi?id=695156
2013-04-08 15:59:39 +02:00
Ryan Lortie
5bbca5fa0c GApplication: document IS_SERVICE timeout properly
The documentation was suggesting that using G_APPLICATION_IS_SERVICE
would automatically set an inactivity timeout (ie: app stays around for
a while after the use count drops to zero).

In reality, it only adds an initial 10 second wait for the first
activation message to arrive after which it uses the normal inactivity
timeout mechanism.
2013-02-21 14:59:53 +00:00
Will Thompson
f2a5b33270 G_IO_ERROR_INVALID_DATA: fix docstring typo 2013-01-10 11:17:01 +00:00
Matthias Clasen
e1b99b2ddc Move single-include guards inside include guards
gcc has optimizations for include guards that only work
if they are outermost in the the header.
https://bugzilla.gnome.org/show_bug.cgi?id=689810
2012-12-27 23:43:14 -05:00
Dan Winship
3a7244bd0c Add "Since 2.36" to G_FILE_MONITOR_WATCH_HARD_LINKS doc 2012-12-19 08:22:23 -05:00
Ryan Lortie
707bc4a40f gio + inotify support for hard links
Add a new GFileMonitorFlag: G_FILE_MONITOR_WATCH_HARD_LINKS.  When set,
changes made to the file via another hard link will be detected.

Implement the new flag for the inotify backend.

https://bugzilla.gnome.org/show_bug.cgi?id=532815
2012-12-19 08:19:18 -05:00
Juan Pablo Ugarte
ccd1fb6820 Added G_IO_ERROR_BROKEN_PIPE 2012-11-29 16:29:47 -03:00
Matthias Clasen
e27367f341 Exterminate 'the the' 2012-08-18 23:15:58 -04:00
Murray Cumming
b9ec5699cd Remove trailing commas from enums 2012-06-12 10:35:52 +02:00
Ryan Lortie
16f92a33ac GApplication: allow null application_id
GApplication application ID is now permitted to be NULL, in which case
G_APPLICATION_NON_UNIQUE will be implicitly enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=671249
2012-04-30 17:38:15 -04:00
Xavier Claessens
95bf3d1194 Add GTestDBus object
This is a helper to write unit tests using a private dbus-daemon.

https://bugzilla.gnome.org/show_bug.cgi?id=672985
2012-04-19 10:06:26 +02:00
David Zeuthen
a6f83d73e5 Revert "Add GTestDBus object"
This reverts commit 1b5f70b5b0.
2012-04-18 13:47:51 -04:00
Xavier Claessens
1b5f70b5b0 Add GTestDBus object
This is a helper to write unit tests using a private dbus-daemon.

session_bus_up/down() are now just wrappers around a GTestDBus singleton.

https://bugzilla.gnome.org/show_bug.cgi?id=672985
2012-04-18 11:19:13 -04:00
Stef Walter
666374c16f Add support for MX, TXT, NS and SOA records to GResolver
* Add resolver functions for looking up DNS records of
   various types. Currently implemented: MX, TXT, SOA, SRV, NS
 * Return records as GVariant tuples.
 * Make the GSrvTarget lookups a wrapper over this new
   functionality.
 * Rework the resolver test so that it has support for
   looking up MX, NS, SOA, TXT records, and uses GOptionContext

https://bugzilla.gnome.org/show_bug.cgi?id=672944
2012-04-16 15:51:39 +02:00
Rodrigo Moya
118c42e747 Always include G_SOCKET_FAMILY_UNIX value in GSocketFamily
This is needed because glib-mkenums doesn't handle #ifdef values in
enums, and so it needs to have all values always defined in the enum.
When not available, define the missing values to a negative value.
2012-04-04 11:39:03 +02:00
Ryan Lortie
81aaf53567 GSocketMsgFlags: annotate as a flags
This was being incorrectly guessed as an enum.  Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=671942
2012-03-12 16:44:00 -04:00
David King
a290fff9a2 docs: Fix GTlsDatabase typos 2012-02-21 01:10:54 +01:00
David King
b50863aafa docs: Add GIOModuleScope and GIOModuleScopeFlags
Fix some typos and add GIOModuleScope and GIOModuleScopeFlags to
gio-sections.txt.
2012-02-18 11:11:52 +00:00
David Zeuthen
a067df5d72 GDBusProxy: Add G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES flag
This is useful when using certain D-Bus services where the
PropertiesChanged signal does not include the property value such as
e.g. various systemd mechanisms, see e.g.

 https://bugs.freedesktop.org/show_bug.cgi?id=37632

Signed-off-by: David Zeuthen <davidz@redhat.com>
2012-02-08 12:49:22 -05:00
Dan Winship
d22c36cf00 gioenums.h: clean up a few GIOErrorEnum descriptions 2012-02-03 12:49:48 -05:00
Murray Cumming
41fbf42c3c gioenums.h: Remove a trailing comma. 2012-01-19 16:18:05 +01:00
Christian Persch
87dc862408 Ensure to generate a flags GType for empty Flags enums
When the flags enum only has the default NONE = 0 entry, glib-mkenums
creates an enum type for it, not a flags type. Add an annotation to the
enum to ensure the correct GType is created.

Bug #667938.
2012-01-15 13:03:16 +01:00