]> Pileus Git - ~andy/gtk/blobdiff - gtk/updateiconcache.c
Bump GLib dependency to 2.35
[~andy/gtk] / gtk / updateiconcache.c
index 28992620bc4276d79eda00b6f111280444b9a553..d3ebd2c1175b9a54ce20186eab422416e605c981 100644 (file)
@@ -12,9 +12,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
@@ -73,11 +71,11 @@ static gchar *var_name = "-";
 
 #include <ftw.h>
 
-static struct stat cache_stat;
+static GStatBuf cache_stat;
 static gboolean cache_up_to_date;
 
 static int check_dir_mtime (const char        *dir, 
-                            const struct stat *sb,
+                            const GStatBuf    *sb,
                             int                tf)
 {
   if (tf != FTW_NS && sb->st_mtime > cache_stat.st_mtime)
@@ -90,9 +88,9 @@ static int check_dir_mtime (const char        *dir,
   return 0;
 }
 
- gboolean
- is_cache_up_to_date (const gchar *path)
- {
+static gboolean
+is_cache_up_to_date (const gchar *path)
+{
   gchar *cache_path;
   gint retval;
 
@@ -118,7 +116,7 @@ static int check_dir_mtime (const char        *dir,
 gboolean
 is_cache_up_to_date (const gchar *path)
 {
-  struct stat path_stat, cache_stat;
+  GStatBuf path_stat, cache_stat;
   gchar *cache_path;
   int retval; 
   
@@ -489,7 +487,7 @@ maybe_cache_image_data (Image       *image,
          idata2 = g_hash_table_lookup (image_data_hash, path2);
 
          if (idata && idata2 && idata != idata2)
-           g_error (_("different idatas found for symlinked '%s' and '%s'\n"),
+           g_error ("different idatas found for symlinked '%s' and '%s'\n",
                     path, path2);
 
          if (idata && !idata2)
@@ -549,7 +547,7 @@ maybe_cache_icon_data (Image       *image,
          idata2 = g_hash_table_lookup (icon_data_hash, path2);
 
          if (idata && idata2 && idata != idata2)
-           g_error (_("different idatas found for symlinked '%s' and '%s'\n"),
+           g_error ("different idatas found for symlinked '%s' and '%s'\n",
                     path, path2);
 
          if (idata && !idata2)
@@ -1455,7 +1453,7 @@ build_cache (const gchar *path)
 #endif
   GHashTable *files;
   FILE *cache;
-  struct stat path_stat, cache_stat;
+  GStatBuf path_stat, cache_stat;
   struct utimbuf utime_buf;
   GList *directories = NULL;
   int fd;
@@ -1525,8 +1523,7 @@ opentmp:
     }
   cache = NULL;
 
-  g_list_foreach (directories, (GFunc)g_free, NULL);
-  g_list_free (directories);
+  g_list_free_full (directories, g_free);
 
   if (!validate_file (tmp_cache_path))
     {
@@ -1739,7 +1736,6 @@ main (int argc, char **argv)
   if (!force_update && is_cache_up_to_date (path))
     return 0;
 
-  g_type_init ();
   build_cache (path);
 
   if (strcmp (var_name, "-") != 0)