Commit db4ffd2e authored by Oliver Gerlich's avatar Oliver Gerlich Committed by Sébastien Wilmet

Make gedit_document_get/set_search_context() public

https://bugzilla.gnome.org/show_bug.cgi?id=726408
parent ee300e66
......@@ -238,7 +238,7 @@ run_forward_search (GeditWindow *window,
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
search_context = _gedit_document_get_search_context (GEDIT_DOCUMENT (buffer));
search_context = gedit_document_get_search_context (GEDIT_DOCUMENT (buffer));
if (search_context == NULL)
{
......@@ -343,7 +343,7 @@ run_backward_search (GeditWindow *window,
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
search_context = _gedit_document_get_search_context (GEDIT_DOCUMENT (buffer));
search_context = gedit_document_get_search_context (GEDIT_DOCUMENT (buffer));
if (search_context == NULL)
{
......@@ -403,7 +403,7 @@ do_replace (GeditReplaceDialog *dialog,
return;
}
search_context = _gedit_document_get_search_context (doc);
search_context = gedit_document_get_search_context (doc);
if (search_context == NULL)
{
......@@ -454,7 +454,7 @@ do_replace_all (GeditReplaceDialog *dialog,
return;
}
search_context = _gedit_document_get_search_context (doc);
search_context = gedit_document_get_search_context (doc);
if (search_context == NULL)
{
......@@ -651,7 +651,7 @@ _gedit_cmd_search_clear_highlight (GSimpleAction *action,
gedit_view_frame_clear_search (frame);
doc = gedit_view_frame_get_document (frame);
_gedit_document_set_search_context (doc, NULL);
gedit_document_set_search_context (doc, NULL);
}
void
......
......@@ -2529,9 +2529,16 @@ connect_search_settings (GeditDocument *doc)
G_CONNECT_SWAPPED);
}
/**
* gedit_document_set_search_context:
* @doc: a #GeditDocument
* @search_context: (allow-none): the new #GtkSourceSearchContext
*
* Sets the new search context for the document.
*/
void
_gedit_document_set_search_context (GeditDocument *doc,
GtkSourceSearchContext *search_context)
gedit_document_set_search_context (GeditDocument *doc,
GtkSourceSearchContext *search_context)
{
g_return_if_fail (GEDIT_IS_DOCUMENT (doc));
......@@ -2566,8 +2573,15 @@ _gedit_document_set_search_context (GeditDocument *doc,
update_empty_search (doc);
}
/**
* gedit_document_get_search_context:
* @doc: a #GeditDocument
*
* Returns: the current search context of the document,
* or NULL if there is no current search context
*/
GtkSourceSearchContext *
_gedit_document_get_search_context (GeditDocument *doc)
gedit_document_get_search_context (GeditDocument *doc)
{
g_return_val_if_fail (GEDIT_IS_DOCUMENT (doc), NULL);
......
......@@ -295,10 +295,10 @@ GMountOperation
*_gedit_document_create_mount_operation
(GeditDocument *doc);
void _gedit_document_set_search_context (GeditDocument *doc,
void gedit_document_set_search_context (GeditDocument *doc,
GtkSourceSearchContext *search_context);
GtkSourceSearchContext *_gedit_document_get_search_context (GeditDocument *doc);
GtkSourceSearchContext *gedit_document_get_search_context (GeditDocument *doc);
gboolean _gedit_document_get_empty_search (GeditDocument *doc);
......
......@@ -66,7 +66,7 @@ get_search_context (GeditReplaceDialog *dialog,
return NULL;
}
search_context = _gedit_document_get_search_context (doc);
search_context = gedit_document_get_search_context (doc);
if (search_context != NULL &&
g_object_get_data (G_OBJECT (search_context), GEDIT_SEARCH_CONTEXT_KEY) == dialog)
......@@ -441,7 +441,7 @@ connect_active_document (GeditReplaceDialog *dialog)
GEDIT_SEARCH_CONTEXT_KEY,
dialog);
_gedit_document_set_search_context (doc, search_context);
gedit_document_set_search_context (doc, search_context);
g_object_unref (settings);
g_object_unref (search_context);
......
......@@ -251,7 +251,7 @@ get_search_context (GeditViewFrame *frame)
GtkSourceSearchSettings *search_settings;
doc = gedit_view_frame_get_document (frame);
search_context = _gedit_document_get_search_context (doc);
search_context = gedit_document_get_search_context (doc);
if (search_context == NULL)
{
......@@ -1258,8 +1258,8 @@ init_search_entry (GeditViewFrame *frame)
search_context = gtk_source_search_context_new (GTK_SOURCE_BUFFER (buffer),
frame->priv->search_settings);
_gedit_document_set_search_context (GEDIT_DOCUMENT (buffer),
search_context);
gedit_document_set_search_context (GEDIT_DOCUMENT (buffer),
search_context);
g_signal_connect_swapped (search_context,
"notify::occurrences-count",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment