Example #1
0
void
ev_window_title_set_document (EvWindowTitle *window_title,
			      EvDocument    *document)
{
        if (window_title->document == document)
                return;

	window_title->document = document;
        g_clear_pointer (&window_title->doc_title, g_free);

	if (window_title->document != NULL) {
		gchar *doc_title;

		doc_title = g_strdup (ev_document_get_title (window_title->document));

		/* Make sure we get a valid title back */
		if (doc_title != NULL) {
			doc_title = g_strstrip (doc_title);

			if (doc_title[0] != '\0' &&
                            g_utf8_validate (doc_title, -1, NULL)) {
				window_title->doc_title = doc_title;
			} else {
                                g_free (doc_title);
                        }
		}
	}

	ev_window_title_update (window_title);
}
Example #2
0
void
ev_window_title_set_type (EvWindowTitle *window_title, EvWindowTitleType type)
{
	window_title->type = type;

	ev_window_title_update (window_title);
}
Example #3
0
void
ev_window_title_set_document (EvWindowTitle *window_title,
			      EvDocument    *document)
{
	window_title->document = document;

	ev_window_title_update (window_title);
}
Example #4
0
void
ev_window_title_set_uri (EvWindowTitle *window_title,
			 const char    *uri)
{
	g_free (window_title->uri);
	window_title->uri = g_strdup (uri);

	ev_window_title_update (window_title);
}
Example #5
0
void
ev_window_title_set_uri (EvWindowTitle *window_title,
			 const char    *uri)
{
        if (g_strcmp0 (uri, window_title->uri) == 0)
                return;

	g_free (window_title->uri);
	window_title->uri = g_strdup (uri);

	ev_window_title_update (window_title);
}
Example #6
0
EvWindowTitle *
ev_window_title_new (EvWindow *window)
{
	EvWindowTitle *window_title;

	window_title = g_new0 (EvWindowTitle, 1);
	window_title->window = window;
	window_title->type = EV_WINDOW_TITLE_DOCUMENT;

        ev_window_title_update (window_title);

	return window_title;
}