Commit Graph

786 Commits

Author SHA1 Message Date
Benjamin Otte
4b8ad50fc4 add g_file_attribute_set_*_by_id() and use them
This patch and the previous ones fixes the performance issues noted in
Bug 587089 – lookup_attribute() takes too much CPU
It increases performance for querying attributes by ~15% in my tests.
2009-06-29 18:25:02 +02:00
Benjamin Otte
bd198e5e45 export and use _g_file_attribute_matcher_matches_id() 2009-06-29 18:25:02 +02:00
Benjamin Otte
ceba40c27d add private header with attribute ids
attribute ids are generated when the attribute hash is initialized. This
way we can guarantee that the ids match every time.
2009-06-29 18:25:02 +02:00
Benjamin Otte
2620c23577 split lookup_attribute() into two functions 2009-06-29 18:25:02 +02:00
Benjamin Otte
66cebd7292 split attribute hash initialization into its own function 2009-06-29 18:25:01 +02:00
Tom Parker
e7a258692c Add NULL to end of g_filename_complete_get_completions() return value
g_filename_complete_get_completions() return value is meant to be a
g_strfreev-compatible array i.e. NULL-terminated. However, pointer arrays
aren't automagically NULL-terminated. This fixes bug 586868
2009-06-26 22:43:31 -04:00
Alexander Larsson
d884e509db Allow setting G_FILE_ATTRIBUTE_TYPE_INVALID attributes in GFileInfo
This is used to unset an attribute in g_file_set_attributes_from_info.
2009-06-25 09:18:01 +02:00
Richard Hughes
b0dc7afd2a Allow GCancellable to be subclassed by adding a private structure 2009-06-24 10:33:24 +02:00
David Zeuthen
0ccd18bc83 Bug 586675 – Runtime library location
Introduce an option to specify the runtime location for libraries via
a relative path to libdir.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2009-06-23 12:58:35 -04:00
Alexander Larsson
7662c86611 Add extension point for adding metadata for local files
This adds a local_file_add_info vfunc to GVfs that vfs implementations
can override to add metadata for local files.
2009-06-23 16:35:42 +02:00
Alexander Larsson
9a6146f54c Add g_file_info_set_attribute_status
Required for gvfs implementation for set_attribures_from_info.
2009-06-23 16:35:41 +02:00
Alexander Larsson
becf4186e6 Add g_file_info_has_namespace
Need this to quickly see if we should set attributes from
this GFileInfo in metadata extension.
2009-06-23 16:35:41 +02:00
Alexander Larsson
0ed9201ad2 Add string vector attribute type to GFileInfo
This is needed for the new metadata backend since nautilus has a
string-list metadata type, and we want to use this for nautilus.
2009-06-23 16:35:41 +02:00
Alexander Larsson
c1ab6454fe Copy namespaces correctly in g_file_copy_attributes
File attribute namespaces are delimited with "::", but
build_attribute_list_for_copy only used ":", so we didn't copy
any writable namespaces.
2009-06-23 16:35:41 +02:00
Matthias Clasen
854a43a3cd Fix build on mingw
Mingw does not have sys/uio.h. This was reported in bug 585937.

Author:    Matthias Clasen <mclasen@redhat.com>
2009-06-19 23:25:18 -04:00
Alexander Larsson
8cb481fd5f Use io_prio as mainloop prio for async-emulation (#579449)
I'm not sure why we used the elaborate formula to convert the io-priority
to the priority of the mainloop idle when emulating async i/o with idles.
However, it causes the default io priority to be less than the normal
idle prio, so the i/o won't be scheduled if there is an idle outstanding.

There is really no great mapping to use here, doing blocking i/o in an
idle of any prio is generally bad and apps doing a lot of async i/o should
initialize threads. However, if we use the io-priority directly we at least
avoid the starvation problem above and make things easier to understand.
2009-06-18 19:43:46 +02:00
Benjamin Otte
9fba812884 Revert "clarify documentation"
This reverts commit d218cf0f67.
This has been fixed in the code, so no need to keep the updated docs.
2009-06-18 15:29:41 +02:00
Benjamin Otte
835c03a5c1 syntax fix in documentation 2009-06-18 15:27:42 +02:00
Benjamin Otte
cf95d07691 fix typo in documentation 2009-06-18 15:27:42 +02:00
Benjamin Otte
d218cf0f67 clarify documentation 2009-06-18 15:27:41 +02:00
Matthias Clasen
0fbeab4520 Add g_setenv 2009-06-15 12:57:21 -04:00
David Zeuthen
fae755e056 Bug 585591 – Starting/stopping drives
Add API for starting/stopping drives. This new API will enable
GVolumeMonitor and GVfs implementations to add support for the
following features

 1. Powering down external hard disk enclosures / drives

 2. Starting/stopping multi-disk devices (such as RAID/btrfs/ZFS)

 3. Connecting/disconnecting iSCSI devices

 4. Reacting to the user pressing e.g. the "remove drive" button on
    a IBM/Lenovo Ultrabay: http://www.thinkwiki.org/wiki/Ultrabay

See the bug for the corresponding GVfs and Nautilus changes.
2009-06-15 10:59:43 -04:00
Ondrej Jirman
bb4f7c48f9 Fix incorrect freeing of thread pool in GThreadedSocketService (#584255) 2009-06-15 15:56:45 +02:00
Alexander Larsson
31cb0bdcb0 Emit changed in g_socket_listener_add_socket, not in add_address
This way we emit this signal when add_socket is called from another
place than add_address too.
2009-06-15 15:43:39 +02:00
Alexander Larsson
a640695f16 Ref the passed in socket in g_socket_listener_add_socket (#585599) 2009-06-15 15:42:38 +02:00
Alexander Larsson
67de6cba50 Add bound address out-argument to g_socket_listener_add_address (#585566)
This is very useful when binding to "any" port.
2009-06-15 14:23:57 +02:00
Alexander Larsson
740ae3aa29 Avoid unnecessary work if mount watching not specified (#585360)
If G_FILE_MONITOR_WATCH_MOUNTS isn't specified, don't do all the work
when the mtab changes.
2009-06-15 12:26:57 +02:00
Matthias Clasen
129eb07482 Support special icons for xdg user dirs
The icon names are folder-documents, folder-download, folder-music,
folder-pictures, folder-publicshare, folder-templates, folder-videos.
See bug 541276.
2009-06-15 01:45:34 -04:00
Matthias Clasen
50a7f53055 Don't use deprecated GLib api
Fixes bug 585673.
2009-06-15 01:12:50 -04:00
Matthias Clasen
642e9c7540 Fix the icon property implementation
Turns out both the setter and the getter were broken...
Fixes bug 585676.
2009-06-15 00:45:55 -04:00
Matthias Clasen
b533a944ff Trivial formatting fixes 2009-06-15 00:38:34 -04:00
Matthias Clasen
ce4aa6253e Include sys/uio.h for struct iovec
This fixes the build on OS X, bug 585280.
2009-06-14 23:55:12 -04:00
Matthias Clasen
8a3a3d797e Use inotify_init1 when available
To avoid leaking the inotify fd. Fixes bug 585478.
2009-06-14 22:29:17 -04:00
Ryan Lortie
4dbc2074bc Add GNIO test cases to .gitignore 2009-06-14 13:58:35 -04:00
Ryan Lortie
cb1a609240 Bug 585575 – g_socket_listener_add_inet_port()
Change the logic in g_socket_listener_add_inet_port() as per the
reasoning in the bug report.

  - If the OS supports neither IPv6 or IPv4, fail.
  - If the OS supports only IPv6, do that.
  - If the OS supports only IPv4, do that.
  - If the OS supports IPv6 and IPv6 "speaks" IPv4 then bind it
    and be done.
  - If the OS supports IPv6 and IPv6 doesn't "speak" IPv4 then
    create an additional socket for IPv4.
  - If binding any socket fails then fail the entire call.

Also, remove the ability to call this function with port == 0.  This
is a useless thing to do anyway since you have no way to know what
port number was actually allocated.  We should have a separate
function to deal with this.
2009-06-12 13:01:04 -04:00
Ryan Lortie
f7d756f5b6 add g_socket_speaks_ipv4()
Partial fix for Bug 585575.
2009-06-12 12:21:07 -04:00
Benjamin Otte
fd22781b18 make all APIs that take inet port arguments take a guint16 2009-06-12 15:57:51 +02:00
Benjamin Otte
3e3e3c2946 don't make strings const when they are not
gets rid of compiler warnings
2009-06-12 15:57:12 +02:00
Matthias Clasen
a402875de1 Fix an oversight in the previous commit
We don't want to unset DISPLAY etc, if none is specified in the
app launch context.
2009-06-11 12:41:16 -04:00
Matthias Clasen
9e43937d03 Include sys/types.h in gunixfdmessage.c
As recommended in 'man socket'. Fixes bug 585281.
2009-06-10 23:28:32 -04:00
Matthias Clasen
d3d81f74c5 Make setting DISPLAY work
And remove a bunch of grotty code to manipulate an environment
array at the same time. Instead, simply call setenv in the child_setup
function.
2009-06-10 16:20:51 -04:00
Dan Winship
74a3c71dcf Revert part of fix for old OS X that broke the compile on current OS X
http://bugzilla.gnome.org/show_bug.cgi?id=584574
2009-06-09 09:32:43 -04:00
Benjamin Otte
ced88fd0de Bug 585189 – g_cancellable_reset() must be called in same thread ...
... as g_cancellable_cancel()
Rework a g_critical() that would (rarely) trigger when _reset() was
called in a thread different from _cancel() by making _reset() wait for
the cancel function to be finished the same way
g_cancellable_disconnect() uses.
2009-06-09 12:19:24 +02:00
Benjamin Otte
74fd3e734f typo in documentation 2009-06-08 15:30:28 +02:00
Benjamin Otte
29a4a0a44d only query file info in g_file_copy() when we need it
The default implementation of g_file_copy() checked the size of the file
to copy to give useful progress updates unconditionally. This can cause
long delays on 1-connection FTP servers while it tries to open a second
connection before it returns EBUSY. This patch makes this query only
happen when we actually send progress updates.
2009-06-08 15:30:28 +02:00
Alexander Larsson
0bb5739f32 Reformat g_themed_icon_get_names return type to make gtk-doc work
Seems the gtk-doc scanner needs "const gchar* const *" to work, so switching
to that.
2009-06-01 22:10:41 +02:00
Dan Winship
ce6fbd6231 Fix multiple bugs in g_srv_target_list_sort()
In particular, targets with weight 0 should be very UNlikely to be
selected, not very likely, as they were before. However, even ignoring
that bug in the logic, there was an additional bug (swapping list
items would cause the 0-weight items to get re-ordered incorrectly
anyway), and the code contained several fencepost errors.

This patch also adds gio/tests/srvtarget.c, which confirms that for a
sample list of targets, we now generate all possible correct random
sortings and no incorrect sortings, and the correct sortings occur in
roughly the expected proportions (though if the current code is
still wrong, those proportions may be wrong as well).

http://bugzilla.gnome.org/show_bug.cgi?id=583398
2009-06-01 14:31:48 -04:00
Dan Winship
1ca91a2125 Clarify some GSocket docs 2009-06-01 14:24:44 -04:00
Dan Winship
5b3d62a7a6 Misc networking build fixes
http://bugzilla.gnome.org/show_bug.cgi?id=580301
http://bugzilla.gnome.org/show_bug.cgi?id=584176
2009-06-01 14:21:05 -04:00
Tor Lillqvist
85816117e3 Bump _WIN32_WINNT to 0x0501
Needed to get prototypes for getaddrinfo() and friends on mingw.
2009-06-01 14:04:49 +03:00