PROP_NAME=1,
PROP_URL,
PROP_CACHE_DIR,
+ PROP_AUTO_DOWNLOAD,
+ PROP_AUTO_UPDATE,
+ PROP_MAX_AGE,
};
typedef struct _ProgressUpdateInfo ProgressUpdateInfo;
g_free(tr->cache_dir);
tr->cache_dir=g_value_dup_string(value);
break;
+ case PROP_AUTO_DOWNLOAD:
+ break;
+ case PROP_AUTO_UPDATE:
+ break;
+ case PROP_MAX_AGE:
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_CACHE_DIR:
g_value_set_string(value, tr->cache_dir);
break;
+ case PROP_AUTO_DOWNLOAD:
+ g_value_set_boolean(value, tr->auto_download);
+ break;
+ case PROP_AUTO_UPDATE:
+ g_value_set_boolean(value, tr->auto_update);
+ break;
+ case PROP_MAX_AGE:
+ g_value_set_long(value, tr->max_age);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
static void
tile_repo_class_init(TileRepoClass *klass)
{
+GParamSpec *pspec;
GObjectClass *object_class=G_OBJECT_CLASS(klass);
object_class->dispose=tile_repo_dispose;
object_class->finalize=tile_repo_finalize;
object_class->set_property=tile_repo_set_property;
object_class->get_property=tile_repo_get_property;
+
+pspec=g_param_spec_uint("max-age","Tile max age","Redownload if tile is over max-age and auto-update is true", 0, 2, 1, G_PARAM_READWRITE);
+g_object_class_install_property (object_class, PROP_MAX_AGE, pspec);
+
+pspec=g_param_spec_boolean("auto-download","Auto download tiles","Automaticaly download map tiles when needed", FALSE, G_PARAM_READWRITE);
+g_object_class_install_property(object_class, PROP_AUTO_DOWNLOAD, pspec);
+
+pspec=g_param_spec_boolean("auto-update","Refresh tiles","Automaticaly refresh old tiles", FALSE, G_PARAM_READWRITE);
+g_object_class_install_property(object_class, PROP_AUTO_UPDATE, pspec);
}
static gboolean
tr->dl_zoom_steps=1;
tr->double_size=0;
tr->nextable=FALSE;
+tr->auto_download=FALSE;
+tr->auto_update=FALSE;
+tr->max_age=604800;
tr->download.cond=g_cond_new();
tr->download.mutex=g_mutex_new();
g_hash_table_destroy(tr->download.pui_by_easy);
if (tr->download.curl_easy_queue)
g_queue_free(tr->download.curl_easy_queue);
+g_cond_free(tr->download.cond);
+g_mutex_free(tr->download.mutex);
g_object_unref(tr);
}