Commit Graph

14 Commits

Author SHA1 Message Date
Philip Withnall
5942cd7984 gio: Add SPDX license headers automatically
Add SPDX license (but not copyright) headers to all files which follow a
certain pattern in their existing non-machine-readable header comment.

This commit was entirely generated using the command:
```
git ls-files gio/*.[ch] | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs'
```

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1415
2022-05-18 09:18:52 +01:00
Marc-André Lureau
b60b0ec72d gio: relax g_content_type_is_a on win32
This is quite gross, but it looks like the whole content-type code on
Windows is similar. Pass test_subtype.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
9d852bc6f3 gio: implement simple directory type detection
Use a logic similar to what is done for Unix, based on trailing path
separator.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:30 +04:00
Marc-André Lureau
b3379557af gio: return '*' content type on win32 from unknown mime
This fixes test_unknown.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-03-09 11:41:20 +04:00
Emmanuel Fleury
9e3a08b222 Fix signedness warning in gio/gcontenttype-win32.c
gio/gcontenttype-win32.c: In function 'get_registry_classes_key':
gio/gcontenttype-win32.c:66:78: warning: comparison of integer expressions of different signedness: 'DWORD' {aka 'long unsigned int'} and 'int'
               if (ExpandEnvironmentStringsW (wc_temp, wc_temp_expanded, len) == len)
                                                                              ^~
2021-11-12 14:58:52 +01:00
Philip Withnall
3de1b88339 gcontenttype: Add no-op versions of {get,set}_mime_dirs() on win32/macOS
These are here to prevent linker errors, since `gcontenttype.[ch]`
aren’t compiled on Windows or macOS.

The implementations are stubs to be filled out by someone who knows each
platform, at some point in the future.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1791
2019-07-24 14:50:53 +01:00
Sébastien Wilmet
3bf4a720c3 gio/: LGPLv2+ -> LGPLv2.1+
Sub-directories inside gio/ already processed in a previous commit:
- fam/
- gdbus-2.0/ (which contains only codegen/)
- gvdb/
- inotify/
- tests/
- win32/
- xdgmime/

Other sub-directories inside gio/:
- completion/: no license headers
- kqueue/: not LGPL, BSD-style license

https://bugzilla.gnome.org/show_bug.cgi?id=776504
2017-05-29 19:53:34 +02:00
TingPing
fe1a749ca6 Create g_content_type_is_mime_type()
Convenience wrapper around g_content_type_is_a().

https://bugzilla.gnome.org/show_bug.cgi?id=734946
2017-03-08 23:02:10 -05:00
Matthias Clasen
96df2727f4 win32: Make g_content_type_get_mime_type work for directories
Now that we are using inode/directory for directories, handle
this case in g_content_type_get_mime_type() as well.
2015-06-05 12:30:15 -04:00
Руслан Ижбулатов
5f0665cbbc W32: Special treatment for inode/directory mime/type
This is a hack for GLocalFileInfo to correctly get icons for directories.
Without this change content type for any W32 directory is NULL
(because there's no registry entry for "inode/directory" by default,
and in any way there's no file extension that means "directory" to put there),
and GLocalFileInfo uses content type to grab icons.

https://bugzilla.gnome.org/show_bug.cgi?id=748727
2015-06-05 12:28:09 -04:00
Matthias Clasen
9931336d2d win32: Return proper icon names
The code here was returning gtk-directory and similar names as
fallback, with a comment claiming that these are 'builtin gtk'.
But they aren't, anymore, so just return the standard names.
2015-06-05 12:26:41 -04:00
Daniel Mustieles
078dbda148 Updated FSF's address 2014-01-31 14:31:55 +01:00
Matthias Clasen
dace477c92 Add Win32 versions of some new content type APIs
This commit adds minimal versions of
g_content_type_get_symbolic_icon and
g_content_type_get_generic_icon_name.
https://bugzilla.gnome.org/show_bug.cgi?id=683642
2012-10-15 19:22:50 -04:00
Matthias Clasen
32192ee9e4 Split gcontenttype.c
Instead of a giant #if G_OS_WIN32 #else #endif around the entire
file, just split it into gcontenttype.c and gcontenttype-win32.c.
2012-07-03 21:13:32 -04:00