+ return FALSE;
+}
+
+gboolean a_check_html_file(FILE* f)
+{
+ gchar * html_str[] = {
+ "<html",
+ "<!DOCTYPE html",
+ "<head",
+ "<title",
+ NULL
+ };
+
+ return check_file_first_line(f, html_str);
+}
+
+gboolean a_check_map_file(FILE* f)
+{
+ /* FIXME no more true since a_check_kml_file */
+ return !a_check_html_file(f);
+}
+
+gboolean a_check_kml_file(FILE* f)
+{
+ gchar * kml_str[] = {
+ "<?xml",
+ NULL
+ };
+
+ return check_file_first_line(f, kml_str);
+}
+
+static GList *file_list = NULL;
+static GMutex *file_list_mutex = NULL;
+
+/* spin button scales */
+VikLayerParamScale params_scales[] = {
+ {1, 86400*7, 60, 0}, /* download_tile_age */
+};
+
+static VikLayerParam prefs[] = {
+ { VIKING_PREFERENCES_NAMESPACE "download_tile_age", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Tile age (s):"), VIK_LAYER_WIDGET_SPINBUTTON, params_scales + 0, NULL },
+};
+
+void a_download_init (void)
+{
+ VikLayerParamData tmp;
+ tmp.u = VIK_CONFIG_DEFAULT_TILE_AGE;
+ a_preferences_register(prefs, tmp, VIKING_PREFERENCES_GROUP_KEY);
+
+ file_list_mutex = g_mutex_new();