summaryrefslogtreecommitdiff
path: root/libyelp/yelp-simple-document.c
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2009-10-10 13:36:36 -0500
committerShaun McCance <shaunm@gnome.org>2009-10-10 13:36:36 -0500
commitdc81e41bf0b876e10423c895314bae872b451adc (patch)
tree8dfb10f2f3bf71b619f19e1d5f0d2e5bcef3b2b4 /libyelp/yelp-simple-document.c
parentc6f42db8238cb0056677f1e3c76488f8ad7377e0 (diff)
downloadyelp-dc81e41bf0b876e10423c895314bae872b451adc.tar.gz
[libyelp] Changing YelpUri API, document/canonical URI
Diffstat (limited to 'libyelp/yelp-simple-document.c')
-rw-r--r--libyelp/yelp-simple-document.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libyelp/yelp-simple-document.c b/libyelp/yelp-simple-document.c
index 11b303c5..658df0cd 100644
--- a/libyelp/yelp-simple-document.c
+++ b/libyelp/yelp-simple-document.c
@@ -42,8 +42,6 @@ struct _Request {
};
struct _YelpSimpleDocumentPriv {
- gchar *base_uri;
-
GFile *file;
GInputStream *stream;
@@ -51,6 +49,7 @@ struct _YelpSimpleDocumentPriv {
gssize contents_len;
gssize contents_read;
gchar *mime_type;
+ gboolean started;
gboolean finished;
GSList *reqs;
@@ -122,6 +121,7 @@ yelp_simple_document_init (YelpSimpleDocument *document)
document->priv->file = NULL;
document->priv->stream = NULL;
+ document->priv->started = FALSE;
document->priv->finished = FALSE;
document->priv->contents = NULL;
document->priv->mime_type = NULL;
@@ -156,8 +156,6 @@ yelp_simple_document_finalize (GObject *object)
{
YelpSimpleDocument *document = YELP_SIMPLE_DOCUMENT (object);
- g_free (document->priv->base_uri);
-
g_free (document->priv->contents);
g_free (document->priv->mime_type);
@@ -171,7 +169,7 @@ yelp_simple_document_new (YelpUri *uri)
document = (YelpSimpleDocument *) g_object_new (YELP_TYPE_SIMPLE_DOCUMENT, NULL);
- document->priv->base_uri = yelp_uri_get_base_uri (uri);
+ document->priv->file = yelp_uri_get_file (uri);
return (YelpDocument *) document;
}
@@ -205,8 +203,8 @@ document_request_page (YelpDocument *document,
g_idle_add ((GSourceFunc) document_signal_all, simple);
ret = TRUE;
}
- else if (simple->priv->file == NULL) {
- simple->priv->file = g_file_new_for_uri (simple->priv->base_uri);
+ else if (!simple->priv->started) {
+ simple->priv->started = TRUE;
g_file_query_info_async (simple->priv->file,
G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
G_FILE_QUERY_INFO_NONE,