summaryrefslogtreecommitdiff
path: root/gtk/updateiconcache.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug 660730: Use GStatBuf for portabilityChun-wei Fan2011-10-031-4/+4
| | | | | | | | | | | | Thanks to Kean Johnston for pointing this out. There are a few places in GTK that use "struct stat", and then g_stat(), rather than using GStatBuf.This breaks things on Windows. Since the size of struct stat can vary depending on other flags specified, this has the potential to cause overwrites and is trivial to fix. Based on patch submitted by Kean Johnston
* updateiconcache: Don't translate g_warning/g_errorColin Walters2011-04-291-2/+2
|
* Silence new gcc warningsMatthias Clasen2011-01-231-85/+81
| | | | | gcc 4.6.0 has started to warn about set-but-unused variables. So don't do that, then.
* No fsync on WindowsTor Lillqvist2010-11-241-0/+2
|
* iconcache: Ensure we don't lose data on power lossColin Walters2010-11-221-7/+35
| | | | | | | fsync() should ensure our data hits disk; since corrupt icon caches break all apps, we need to ensure it's valid. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=635307
* BugĀ 584638 - Build of gtkupdateiconcache without NLS breaksChristian Dywan2009-09-031-0/+4
| | | | Wrap textdomain calls in updateiconcache.c in NLS conditionals.
* Preserve errno, and always use g_strerror()Christian Persch2009-08-241-5/+13
| | | | Bug #592461.
* Use g_mapped_file_unref()Ryan Lortie2009-06-181-2/+2
| | | | | - drop deprecated use of g_mapped_file_free() - bump glib version requirement
* Add a missing newlineMatthias Clasen2009-06-121-1/+1
| | | | | There was a missing newline in one of the g_printerr messages in updateiconcache.c. String change.
* Make gtk-update-icon-cache not fall over leftover temp filesMatthias Clasen2009-05-111-1/+9
| | | | | When called with the --force option, try to remove the .icon-theme.cache file before giving up. This fixes rh#500163.
* Enclose ?: expression with parens so cast covers all of it.Tor Lillqvist2008-08-041-1/+1
| | | | | | | | | | 2008-08-05 Tor Lillqvist <tml@novell.com> * gtk/updateiconcache.c (write_bucket): Enclose ?: expression with parens so cast covers all of it. svn path=/trunk/; revision=20996
* Remove the old icon cache if regenerating it would cause it to be emptyFederico Mena Quintero2008-07-181-2/+2
| | | | | | Signed-off-by: Federico Mena Quintero <federico@novell.com> svn path=/trunk/; revision=20865
* Include "config.h" instead of <config.h> Command used: find -nameJohan Dahlin2008-06-221-1/+1
| | | | | | | | | | | | 2008-06-21 Johan Dahlin <jdahlin@async.com.br> * *.[ch]: Include "config.h" instead of <config.h> Command used: find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g' Rubberstamped by Mitch and Tim svn path=/trunk/; revision=20669
* Bug 536990 - updateiconcache.c: 'close ()' is redundantTor Lillqvist2008-06-071-2/+0
| | | | | | | | | | | | | 2008-06-07 Tor Lillqvist <tml@novell.com> Bug 536990 - updateiconcache.c: 'close ()' is redundant * gtk/updateiconcache.c (build_cache): Drop redundant close() calls. fclose() on a fdopen()ed strema closes the underlying file descriptor. svn path=/trunk/; revision=20327
* Use g_open().Tor Lillqvist2008-06-031-1/+1
| | | | | | | | | 2008-06-03 Tor Lillqvist <tml@novell.com> * gtk/updateiconcache.c (build_cache): Use g_open(). svn path=/trunk/; revision=20303
* Bug 535526 - updateiconcache.c: using open/close without prototypeTor Lillqvist2008-05-291-1/+6
| | | | | | | | | | | | | 2008-05-29 Tor Lillqvist <tml@novell.com> Bug 535526 - updateiconcache.c: using open/close without prototype * gtk/updateiconcache.c: Include <io.h> if _MSC_VER. Also, use g_utime() instead of utime() for UTF-8 pathname support on Windows when available. svn path=/trunk/; revision=20238
* Use simpler mode for open() on Windows. (No S_I?GRP and S_I?OTH bits areTor Lillqvist2008-05-271-2/+9
| | | | | | | | | | | | | | 2008-05-27 Tor Lillqvist <tml@novell.com> * gtk/updateiconcache.c (build_cache): Use simpler mode for open() on Windows. (No S_I?GRP and S_I?OTH bits are defined in <sys/stat.h> on Windows, and the mode used in open() doesn't matter much as there are no rwxrwxrwx bits on Windows anyway.) Open file in binary mode. Passing "b" to fdopen() later isn't enough. svn path=/trunk/; revision=20190
* Bug 523562 - gtk-update-icon-cache core dumps when run concurrently andCody Russell2008-05-251-4/+24
| | | | | | | | | | | | | | | 2008-05-25 Cody Russell <bratsche@gnome.org> Bug 523562 - gtk-update-icon-cache core dumps when run concurrently and when options are missing * gtk/updateiconcache.c: Open the cache file (O_CREAT | O_EXCL) so that other processes that try to open it will fail gracefully. Also fix a crasher caused by lack of a NULL check. Report and patch by Erwann Chenede. svn path=/trunk/; revision=20167
* Ignore images in the toplevel theme directory, avoiding one source ofMatthias Clasen2008-02-051-1/+5
| | | | | | | | | | | | 2008-02-05 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c: Ignore images in the toplevel theme directory, avoiding one source of invalid caches that has been spotted in the wild. svn path=/trunk/; revision=19466
* Fix the buildMatthias Clasen2008-02-051-4/+10
| | | | svn path=/trunk/; revision=19465
* Install a printerr handler that prepends the program name, sinceMatthias Clasen2008-02-051-0/+22
| | | | | | | | | | | 2008-02-05 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c: Install a printerr handler that prepends the program name, since gtk-update-icon-cache output often appears in the middle of other output, e.g. rpm update logs. svn path=/trunk/; revision=19464
* use the right type for "subparser_data" and remove the (gpointer*) cast.Michael Natterer2008-01-301-1/+1
| | | | | | | | | | | | | | | | | | | 2008-01-30 Michael Natterer <mitch@imendio.com> * gtk/gtkbuilderparser.c (parse_custom): use the right type for "subparser_data" and remove the (gpointer*) cast. Fixes bogus aliasing warning. * gtk/updateiconcache.c (add_string): cast const gchar* to gpointer when inserting in a GHashTable. * tests/testcalendar.c (calendar_detail_cb): remove const from return value since it's a newly allocated string. (calendar_update_details): free the detail. svn path=/trunk/; revision=19431
* Avoid double-free problemsMatthias Clasen2007-10-121-8/+0
| | | | svn path=/trunk/; revision=18906
* Don't use image->attach_points where image->n_attach_points was meant.Matthias Clasen2007-09-071-4/+1
| | | | | | | | | | | 2007-09-07 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c (get_image_meta_data_size): Don't use image->attach_points where image->n_attach_points was meant. Pointed out by Albert Chin. svn path=/trunk/; revision=18756
* Add an icon cache validator.Matthias Clasen2007-05-011-0/+63
| | | | | | | | | | | | | | | | | 2007-05-01 Matthias Clasen <mclasen@redhat.com> * gtk/gtkiconcachvalidator.[hc]: Add an icon cache validator. * gtk/updateiconcache.c: Validate the generated cache before moving it in place. Also add a --validate option to validate an existing icon cache. * gtk/gtkiconcache.c: Validate icon caches before using them. * gtk/Makefile.am: Integrate it. svn path=/trunk/; revision=17753
* Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,Matthias Clasen2007-03-091-4/+2
| | | | | | | | | | | | | 2007-03-09 Matthias Clasen <mclasen@redhat.com> * Everywhere: Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder, Djihed Afifi) * configure.in: Check for ftw.h svn path=/trunk/; revision=17444
* Handle symlinked .icon files intelligently; also avoid storing duplicateMatthias Clasen2007-02-151-235/+446
| | | | | | | | | | | 2007-02-15 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c: Handle symlinked .icon files intelligently; also avoid storing duplicate strings. svn path=/trunk/; revision=17298
* Check the mtime of all directories, not just the toplevel, if ftw() isMatthias Clasen2007-01-271-3/+51
| | | | | | | | | | | | | | 2007-01-26 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c: Check the mtime of all directories, not just the toplevel, if ftw() is available. (#331671, Behdad Esfahbod) * configure.in: Check for ftw.h. svn path=/trunk/; revision=17221
* Include locale.hMatthias Clasen2007-01-021-0/+1
| | | | svn path=/trunk/; revision=17026
* Call setlocale().Matthias Clasen2007-01-021-1/+3
| | | | | | | | | | | | | | | | | 2007-01-02 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c (main): Call setlocale(). * gtk/gtkfilesel.c: * gtk/gtkfilesystemunix.c: * gtk/gtkfilesystemwin32.c: * gtk/gtkfilechoosersettings.c: * gtk/updateiconcache.c: Consistently use folder instead of directory in translated messages. (#344584, Javier F. Serrador) svn path=/trunk/; revision=17024
* Apply a cleanup patch by Kjartan Maraas (#341812)Matthias Clasen2006-10-081-18/+18
| | | | | | 2006-10-08 Matthias Clasen <mclasen@redhat.com> * Apply a cleanup patch by Kjartan Maraas (#341812)
* Improve wording. String change! (#355128, David Lodge)Matthias Clasen2006-09-101-1/+1
| | | | | | | 2006-09-10 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c: Improve wording. String change! (#355128, David Lodge)
* Marks strings for translation. (#314278, Claudio Saavedra) `Matthias Clasen2006-06-191-18/+22
| | | | | | | | 2006-06-19 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c: Marks strings for translation. (#314278, Claudio Saavedra) `
* Don't create a big string, since Visual C++ doesn't like strings longerMatthias Clasen2005-11-231-34/+10
| | | | | | | | 2005-11-23 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c (write_csource): Don't create a big string, since Visual C++ doesn't like strings longer than 64k. (#322238, Kazuki IWAMOTO
* Can't rename a file if the target exists on Win32. First rename the targetTor Lillqvist2005-11-061-0/+34
| | | | | | | | | | | 2005-11-06 Tor Lillqvist <tml@novell.com> * gtk/updateiconcache.c (build_cache): Can't rename a file if the target exists on Win32. First rename the target temporarily, then if the renaming of the source to target fails, restore the original name for the target. * gtk/Makefile.am: Use EXEEXT in the dependency on gtk-update-icon-cache.
* Store builtin stock icons in an icon cache, instead of populating a hashMatthias Clasen2005-11-041-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-11-04 Matthias Clasen <mclasen@redhat.com> Store builtin stock icons in an icon cache, instead of populating a hash table with pixbufs at startup, to save both memory and startup time. * gtk/stock-icons/*: Reorganize the icons in a directory structure suitable for gtk-update-icon-cache, and rename them to match the stock ids. * gtk/gtkiconcache.[hc]: Support non-mmapped icon caches, and add _gtk_icon_cache_has_icon_in_directory(). * gtk/updateiconcache.c: Support a --source <VARIABLE> argument to store the contents of the icon cache in a C header. * gtk/gtkbuiltincache.h: Generated private header which contains the icon cache for the builtin icons. * gtk/gtkicontheme.c: Create a GtkIconCache for the builtin icons, and use that in addition to the hash table whenever builtin icons are searched. * gtk/gtkiconfactory.c: Add GTK_ICON_SOURCE_STATIC_ICON_NAME and use it for static stock ids. (get_default_icons): Don't add the builtin icons to the icon theme, just register the stock ids. (render_fallback_image): Take the fallback image out of the builtin icon cache. * gtk/Makefile.am: Remove stock-icons from SUBDIRS and add the necessary machinery to rebuild gtkbuiltincache.h.
* Fix a use-after-free bug. (#316256, Alexander Nedotsukov)Matthias Clasen2005-09-141-1/+1
| | | | | | | 2005-09-14 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c (foreach_remove_func): Fix a use-after-free bug. (#316256, Alexander Nedotsukov)
* Add a separate --ignore-theme-index option to avoid overloading --force.Matthias Clasen2005-08-261-2/+4
| | | | | | | 2005-08-26 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c: Add a separate --ignore-theme-index option to avoid overloading --force. (JP Rosevaar)
* Complain when there is no index.theme file in the specified directory,Matthias Clasen2005-08-231-1/+26
| | | | | | | | 2005-08-23 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c: Complain when there is no index.theme file in the specified directory, unless --force is used. Also add an --index-only option to create caches without image data.
* Use g_path_get_dirname() instead of the nonportable <libgen.h> andTor Lillqvist2005-08-151-5/+5
| | | | | | | 2005-08-15 Tor Lillqvist <tml@novell.com> * gtk/updateiconcache.c: Use g_path_get_dirname() instead of the nonportable <libgen.h> and dirname().
* Small fix for svg icons.Matthias Clasen2005-08-151-1/+8
|
* Store only one copy of the pixel data for symlinked icons. To achieveMatthias Clasen2005-08-151-26/+200
| | | | | | | | | | | | | | 2005-08-14 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c: Store only one copy of the pixel data for symlinked icons. To achieve this, maintain a hashtable mapping pathnames to pixel data, and share the pixel data for all symlinks resolving to the same pathname. When writing out the image data, write out the pixel data only the first time it is met, and store the offset pointing to the first copy for use in all later cases. This reduces the size of the Bluecurve icon cache from 40 to 13MB. (#312972)
* Fix #300218:Ivan, Wong Yat Cheung2005-04-111-0/+6
| | | | | | | | | | | | 2005-04-11 Ivan, Wong Yat Cheung <email@ivanwong.info> Fix #300218: * gdk/win32/gdkselection-win32.c (gdk_selection_convert): Fix C99ism. * gtk/updateiconcache.c: Guard inclusion of unistd.h and utime.h.
* Avoid unaligned access. (#172947)Matthias Clasen2005-04-071-6/+4
| | | | | | | | | | | 2005-04-07 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c (write_card16, write_card32): Avoid unaligned access. (#172947) * gtk/gtkfilechooserdefault.c (file_list_build_popup_menu): Consistently use the term "Bookmarks" in the UI. (#166906, Sebastian Bacher)
* Some fixes from Morten Welinder (#172947):Matthias Clasen2005-04-071-5/+6
| | | | | | | | | | | 2005-04-07 Matthias Clasen <mclasen@redhat.com> Some fixes from Morten Welinder (#172947): * gtk/updateiconcache.c (icon_name_hash): Make this compiler- and platform-independent. (is_cache_up_to_date): Don't compare mtimes is a stat call failed. (build_cache): Error out if a stat fails.
* Return TRUE if the cache is newer than the directory. (#172852, JacobMatthias Clasen2005-04-071-1/+1
| | | | | | | | 2005-04-07 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c (is_cache_up_to_date): Return TRUE if the cache is newer than the directory. (#172852, Jacob Kroon)
* Update spec.Anders Carlsson2005-03-151-14/+403
| | | | | | | | | | | | | | | | | | | | | | | | | 2005-03-15 Anders Carlsson <andersca@imendio.com> * docs/iconcache.txt: Update spec. * gtk/gtkiconcache.c: (find_image_offset), (_gtk_icon_cache_get_icon_flags), (_gtk_icon_cache_add_icons), (_gtk_icon_cache_get_icon), (_gtk_icon_cache_get_icon_data): * gtk/gtkiconcache.h: Update to be able to fetch pixbuf data and icon metadata. * gtk/gtkicontheme.c: (theme_lookup_icon), (gtk_icon_info_free), (icon_info_ensure_scale_and_pixbuf): Use new cache functions. * gtk/updateiconcache.c: (foreach_remove_func), (load_icon_data), (maybe_cache_image_data), (scan_directory), (write_pixdata), (get_image_meta_data_size), (get_image_pixel_data_size), (get_image_data_size), (get_single_node_size), (get_bucket_size), (write_bucket), (main): Update to write pixbuf data as well as information from .icon files.
* #include <config.h>Manish Singh2005-02-221-0/+2
| | | | | | Tue Feb 22 13:49:09 2005 Manish Singh <yosh@gimp.org> * gtk/updateiconcache.c: #include <config.h>
* Add a --quiet option.Matthias Clasen2005-02-011-4/+7
| | | | | | 2005-02-01 Matthias Clasen <mclasen@redhat.com> * gtk/updateiconcache.c (main): Add a --quiet option.
* gtk/gtkaccelmap.[ch] gtk/gtkfilechooser.[ch] gtk/gtkfilesel.cTor Lillqvist2004-12-121-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2004-12-12 Tor Lillqvist <tml@iki.fi> * gtk/gtkaccelmap.[ch] * gtk/gtkfilechooser.[ch] * gtk/gtkfilesel.c * gtk/gtkfilesystemwin32.c * gtk/gtkiconfactory.[ch] * gtk/gtkicontheme.[ch] * gtk/gtkimage.[ch] * gtk/gtkimmodule.c * gtk/gtkmodules.c * gtk/gtkrc.[ch] * gtk/gtkuimanager.[ch] * gtk/gtkwindow.[ch] * gtk/updateiconcache.c * gtk/gtk.symbols: Use gstdio wrappers. On Windows, convert environment variables referring to pathnames from locale encoding to UTF-8. As in GLib, in order to preserve Windows DLL ABI stability, add binary compatibility versions of functions that take file names as arguments, or return file names. Add a _utf8 suffix to the "real" such functions on Windows. The ABI compatibility versions keep the old name. * gtk/Makefile.am: Strip PRIVATE symbols from the GNU import library. * gtk/gtkiconcache.c (_gtk_icon_cache_new_for_path): Implement file mapping on Win32. * gtk/updateiconcache.c: Don't crash if invoked without argument. Use binary mode when opening file. * modules/engines/ms-windows/Theme/gtk-2.0/Makefile.am: Install gtkrc in correct place, in <datadir>/themes/MS-Windows/gtk-2.0.