879 Commits

Author SHA1 Message Date
Tor Lillqvist
dce6ec3b7f Put a version info resource also in the gio DLL
Also, distribute gio/gio.rc(.in).
2010-02-04 01:01:57 +02:00
Matthias Clasen
2c0c35af56 Fix the filename roundtrip check
The check was always failing because the code was comparing
the wrong strings. Reported in bug 605977.
(cherry picked from commit f2d8f6287d6e3fcb9e58402c2051d557f7e41632)
2010-01-06 19:24:45 -05:00
Ryan Lortie
40005647ed GUnixFDMessage: fix a small typo in an extra check
In the deserialise function, GUnixFDMessage was comparing 'level' to
both SOL_SOCKET and SCM_RIGHTS.  It is correct to compare 'type' to
SCM_RIGHTS.  The code passed tests only because:

1) it's a "should always be OK" double-check

2) SOL_SOCKET and SCM_RIGHTS, by chance, both have the value '1' on
   Linux systems.
(cherry picked from commit baf20e09842a97c2d7925dff5ff9c6d35e36b27d)
2010-01-06 19:24:36 -05:00
Matthias Clasen
aecd2616c7 Fix a memleak
An early exit in expand_application_parameters forgot to free
a GString. Reported by Steve Grubb.
(cherry picked from commit b00c6d7fb5798b4e528554e1221a553ab95506ed)
2010-01-06 19:24:28 -05:00
Matthias Clasen
6a8828d40f Fix an off-by-one error
Reported by Steve Grubb.
(cherry picked from commit 6cee86a3efc98333282218f8eb1e0149a7cd703d)
2010-01-06 19:24:20 -05:00
Dan Winship
1a0f372907 Fix UnixWare build by not using "sa_len" as a variable name
https://bugzilla.gnome.org/show_bug.cgi?id=604875
(cherry picked from commit 28d91b5bb6f0543c259976d8338a7b4d95054dd3)
2010-01-06 19:22:05 -05:00
Gian Mario Tagliaretti
7e9ad3d746 Remove wrong file imports, only gio/gio.h should be included 2009-12-16 23:38:39 +01:00
Tor Lillqvist
3d546303e8 Check for <wspiapi.h> and use it if present
Should help bug #603527 if glib is built in an environment that has
<wspiapi.h>.
2009-12-14 03:30:39 +02:00
Alexander Larsson
31f928a2c3 Remove default implementation of async filter steam ops
Not only is the default implementation broken (it causes infinite recursion
as seen in bug #603982), but its also worthless. If we just fall back on the
default stream operations we automatically get async version based on
the sync filter stream operations, which is what we want.
(cherry picked from commit 4fbbe190b7cbfd271bbb18428bc103ebffa41112)
2009-12-07 22:15:27 +01:00
Ryan Lortie
8a190a155c Bug 598712 - can't detect text file with backspace
looks_like_text(): Allow '\b' to appear in text files.
(cherry picked from commit 48e2a570439373882cf755567e1d147bc5dd50e5)
2009-11-30 23:31:50 -05:00
Ryan Lortie
7a1b265e97 Bug 595138 - GFile not robust with invalid input
Improve handling of g_file_query_default_handler() when called on an
invalid GFile (ie: one created with an invalid URI).
(cherry picked from commit 9681d7e75f2d1296a890bfa64b3478ea7025df62)
2009-11-30 23:30:38 -05:00
Alexander Larsson
b0e4df9375 Pass in the right device to vfs->local_file_add_info for symlinks
We used to pass the path for the symlink, but the device of the target
which is wrong and breaks metadata access.

https://bugzilla.gnome.org/show_bug.cgi?id=593809
(cherry picked from commit 2b2195bf68bf68837dc9f6b4765d3716694f42b3)
2009-11-26 16:07:13 +01:00
Mures Andone
c5b846eb13 Fixed bug 91 (GIO monitoring not working due to bad assert)
https://bugzilla.gnome.org/show_bug.cgi?id=593856
(cherry picked from commit 96f41b62836810563c4f69ba6d053e91c638728a)
2009-11-26 15:41:58 +01:00
Matthias Clasen
d8fc1528b7 Avoid a warning 2009-10-25 02:53:55 -04:00
Matthias Clasen
36df8c9b9c Don't give up too early when collecting mime types
Since returning exactly one match has special significance, don't
give up matching before we've found at least 2 types. Also, make
sure that we don't return the same mime type more than once.
Bug 541236.
2009-10-25 02:53:54 -04:00
Alexander Larsson
cf622936c4 xdgmime: sort glob hits with larger weight first
Higher weight is more important, so return these first meaning
they will be used as the default.
2009-10-25 02:53:54 -04:00
Tor Lillqvist
a7a480b335 Fix GWin32DirectoryMonitor
GWin32DirectoryMonitor was quite broken, but nobody had apparently
noticed, or at least not filed any bug. Only now with a bleeding edge
GTK+ file chooser does the code get exercised in common programs like
gtk-demo or GIMP, apparently. Bug #598899.
2009-10-23 00:51:48 +03:00
Tomas Bzatek
d5f4e7c656 Documentation fixes 2009-10-13 16:22:16 +02:00
Tor Lillqvist
ae0a220bf3 Construct the gio module directory pathname at run-time on Windows 2009-10-12 00:18:48 +03:00
Alexander Larsson
07ad638adf remove xdgmime test
This is getting diverged from the xdgmime copy and we don't need it here.
2009-10-02 12:55:54 +02:00
Alexander Larsson
c7c0bcef89 xdgmime - Correct the range checks for magic matching 2009-10-02 12:55:54 +02:00
Alexander Larsson
2624e7d6c6 Remove unnecessary includes 2009-10-02 12:55:54 +02:00
Alexander Larsson
e1643fd76d xdgmime - support the new case sensitive flag 2009-10-02 12:55:54 +02:00
Alexander Larsson
7c27df1fee xdgmime - support cache files with minor version 2 2009-10-02 12:55:54 +02:00
Alexander Larsson
ce239a010e Read the new glob2 format with case sensitive flags 2009-10-02 12:55:54 +02:00
Matthias Clasen
e9fe53980b Fix --runtime-libdir option
For stable releases, it needs to take LT_REVISION into account, not
hardcode 0.
2009-09-29 23:08:03 -04:00
Matthias Clasen
6555e0171d Fix mime_info_cache_dir_add_desktop_entries
This function tried to avoid adding duplicate entries, but failed
due to using the wrong search function. See bug 595972.
2009-09-29 20:52:26 -04:00
Matthias Clasen
5fdb169b72 Clarify docs of g_async_result_get_source_object
It returns a new reference. Reported in bug 596748
2009-09-29 20:33:39 -04:00
Alexander Larsson
90e1308809 Avoid critical error in thread check if source is destroyed
The source can be destroyed by the time we complete the result, and
then the g_source_get_context(current_source) call will cause
a critical error. We check for the source being destroyed and avoid
the check in that case.

This means we miss the right-thread check in this case, but thats
merely a helper, so this is not critical.
2009-09-29 11:27:15 +02:00
Alexander Larsson
6f1ce483eb Always report metadata on the path, not symlink target
Metadata are really part of the pathname, not the target file
(as they are stored by pathname, and for many metadata like icon position
etc make not sense using the target data). So, even if nofollow
is not specified we should not follow links for metadata.

Ideally this should be implemented in the metadata extension in gvfs,
but the extension API does not allow this, so we do it in gio.

See https://bugzilla.gnome.org/show_bug.cgi?id=593809
2009-09-28 15:55:44 +02:00
Josselin Mouette
cc4970cf94 Fall back to inotify_init if inotify_init1 does not work
This fixes monitoring failing to work when glib is built on a 2.6.27+
kernel but run on an older one.

http://bugs.debian.org/544354
https://bugzilla.gnome.org/show_bug.cgi?id=593775
2009-09-23 18:39:45 +02:00
Mart Raudsepp
c755a7fd11 gio: Fix some typos in G*AppInfo documentation 2009-09-22 11:22:44 +03:00
Mart Raudsepp
6c061da2a2 gio: Fix a Since tag to actually show up in new API of 2.20 indeces
Typo made in e05426062
2009-09-22 11:22:44 +03:00
Paolo Borelli
80f66b1141 Fix build with srcdir != builddir, bug #594597 2009-09-19 10:22:33 +02:00
Matthias Clasen
53fc10d269 Fix a lot of clang complaints
Mostly dead assignments.
2009-09-18 19:20:06 -04:00
Sjoerd Simons
8667317766 Fix GNetworkAddress skipping addresses when enumerating
g_network_address_address_enumerator_next_finish takes the first item of the
address list and moves the pointer to the next one, so we shouldn't do the same
in g_network_address_address_enumerator_next_async function

Fixes bug #593941
2009-09-11 15:25:34 +01:00
Richard Hughes
cdd04f36ca Make the error const for g_simple_async_result_set_from_error 2009-09-11 15:20:34 +01:00
James Hunt
11477609d1 g_socket_send_message() fails due to invalid sendmsg(2) params.
g_socket_send_message() and g_socket_send_to() fail with ENOBUFS or
EFAULT due to the fact that if no "address" argument is specified to
g_socket_send_message, when g_socket_send_message() calls sendmsg(2),
the 2nd parameter to sendmsg ("const struct msghdr *msg") contains
uninitialized values. The fix is simple - initialize msg.msg_name to
NULL and msg.msg_msg_namelen to 0.

https://bugzilla.gnome.org/show_bug.cgi?id=594759
2009-09-11 08:52:14 -04:00
Alexander Larsson
8af494d987 Avoid reading uninitialized memory
If the statfs call fails, don't look at the result.
2009-09-07 12:50:58 +02:00
Alexander Larsson
06de24f430 Remove warning in g_simple_async_result_complete
This warning hits code that uses GSimpleAsyncResult outside of a
mainloop as a helper object. For instance EggDBus does this.
Since the bugs this warning would fix are pretty easy to spot
and since EggDBus is deployed already we just remove the
"called from outside main loop" warning.

However, we need to keep the "called from wrong context" warning
as that is very helpful when debugging misuse of the new multiple
main context code.
2009-09-07 10:25:14 +02:00
Matthias Clasen
034d516160 Another dead assignment 2009-09-07 03:28:35 -04:00
Matthias Clasen
6cda9bfb02 Remove a dead initialization 2009-09-07 03:14:15 -04:00
Matthias Clasen
30645bd0a5 Remove a dead increment 2009-09-07 03:12:06 -04:00
Matthias Clasen
0d1ffbf361 Remove another dead assignment 2009-09-07 03:10:01 -04:00
Matthias Clasen
f2c8572d84 Remmove a dead assignment.
Spotted by clang.
2009-09-07 03:07:22 -04:00
Matthias Clasen
1ec32c403b Move a assignment to the relevant #ifdef branch
Dead code spotted by clang.
2009-09-07 03:02:58 -04:00
Matthias Clasen
e67c3cf2b0 Remove dead code 2009-09-07 03:01:02 -04:00
Matthias Clasen
80fd5ed402 Don't evaluate an uninitialized value
Bug found by clang.
2009-09-07 02:50:51 -04:00
Benjamin Otte
4114f1214c Bug 594034 - Use g_mkstemp_full() when creating the replacement file
Previous code used g_mkstemp(). But when using
G_FILE_CREATE_REPLACE_DESTINATION, no attempt was made to ensure proper
mode and flags of the created temporary file. The visible issue was that
the file was always created with mode 0600 as opposed to using 0666.
(The invisible issue was that O_RDWR was used instead of O_WRONLY.)
2009-09-04 22:45:57 +02:00
Benjamin Otte
3826963e65 Use lchmod instead of stat + chown if available
Fallout of the NOFLOOW_SYMLINKS fix from bug 593406
2009-09-01 21:53:35 +02:00