summaryrefslogtreecommitdiff
path: root/gtk/updateiconcache.c
Commit message (Collapse)AuthorAgeFilesLines
* iconcache: Guard deprecated gdk-pixbuf APIsBenjamin Otte2015-09-111-0/+4
|
* updateiconcache: Fix compiler warningsMatthias Clasen2015-06-021-6/+6
| | | | Fix warnings due to -Wdeclaration-after-statement and -Wshadow.
* Make gtk-update-icon-cache not fall over leftover temp filesMatthias Clasen2015-04-081-1/+1
| | | | | | | | | This is a followup to 0fd185fa6de2a89c11b4a28. There is no good reason to only try again if --force is passed. Do it always. See https://bugzilla.redhat.com/show_bug.cgi?id=1194957
* Whitespace fixesMatthias Clasen2014-12-121-108/+108
|
* gtk-update-icon-cache: Add an --include-image-data optionMatthias Clasen2014-06-141-0/+1
| | | | | Now that we don't include the image data by default anymore, lets add an option that does it.
* updateiconcache: Don't include image data by default anymoreJasper St. Pierre2014-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since large images are in the icon cache, and apps don't tend to use that many icons anymore, simply don't include image data and instead make apps load files from disk. Additionally, since they're stored in GdkPixbuf data, that means that we have to first convert them either to a cairo_surface_t, which requires converting pixel data to be premulitplied, or an OpenGL texture, which requires a whole GPU upload anyway. So, even with the icon cache, the goal of icons through zero-copy, mmap()'d data from disk just isn't doable with the icon cache format we have. The icon cache on my disk is nearing 100MB, since we include a bunch of high-resolution application icons, that I doubt would be used by apps at all. Removing this inefficient pixel data makes memory usage for all applications go down, with no speed loss. The icon cache also, however, has an index of what icons are in each folder, which prevents a readdir() and allows GTK+ to know what icon is where without having to do a bunch of stat(); calls. Keeping this data is good for GTK+, so we should still keep the index. It doesn't make sense to remove any code for mapping pixel data from the icon cache. There's a plan in the works to have a symbolic icon cache that does pixel math on 16x16 icons to prevent slow SVG rendering. 16x16 pixels are fairly small, and such images are flat colors, which should compress easily, so the icon cache would be worthwhile here. So let's keep the code around in preparation for that case. https://bugzilla.gnome.org/show_bug.cgi?id=721895
* docs: use proper quotations instead of '*'William Jon McCann2014-02-071-1/+1
|
* docs: don't use gtkdoc style for regular commentsWilliam Jon McCann2014-01-211-1/+1
|
* Make sure icon cache has /-separated subdirs only (v2 - use g_build_path)Руслан Ижбулатов2013-02-211-2/+21
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=692955
* Bump GLib dependency to 2.35Matthias Clasen2012-11-041-1/+0
| | | | And drop deprecated g_type_init() calls.
* gtk: Make functions static that don't need to be non-staticBenjamin Otte2012-10-021-3/+3
| | | | | | | | Also remove the starting underscore from function names where appropriate, as those functions are static now and not exported anymore. This is part of a bunch of fixes for gcc complaining about -Wmissing-declarations.
* Change FSF AddressJavier Jardón2012-02-271-3/+1
|
* gtk/*: Use g_list_free_full() convenience functionJavier Jardón2012-01-051-2/+1
|
* 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)