Make _gtk_entry_completion_compute_prefix() public-internal
This commit is contained in:
@@ -1571,19 +1571,17 @@ gtk_entry_completion_cursor_on_match (GtkEntryCompletion *completion,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
gtk_entry_completion_compute_prefix (GtkEntryCompletion *completion)
|
||||
gchar *
|
||||
_gtk_entry_completion_compute_prefix (GtkEntryCompletion *completion,
|
||||
const char *key)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gchar *prefix = NULL;
|
||||
gboolean valid;
|
||||
const gchar *key;
|
||||
|
||||
if (completion->priv->text_column < 0)
|
||||
return NULL;
|
||||
|
||||
key = gtk_entry_get_text (GTK_ENTRY (completion->priv->entry));
|
||||
|
||||
valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (completion->priv->filter_model),
|
||||
&iter);
|
||||
|
||||
@@ -1753,7 +1751,8 @@ gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion)
|
||||
g_signal_handler_block (completion->priv->entry,
|
||||
completion->priv->insert_text_id);
|
||||
|
||||
prefix = gtk_entry_completion_compute_prefix (completion);
|
||||
prefix = _gtk_entry_completion_compute_prefix (completion,
|
||||
gtk_entry_get_text (GTK_ENTRY (completion->priv->entry)));
|
||||
if (prefix)
|
||||
{
|
||||
g_signal_emit (completion, entry_completion_signals[INSERT_PREFIX],
|
||||
|
||||
@@ -74,6 +74,8 @@ struct _GtkEntryCompletionPrivate
|
||||
gboolean _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion);
|
||||
void _gtk_entry_completion_popup (GtkEntryCompletion *completion);
|
||||
void _gtk_entry_completion_popdown (GtkEntryCompletion *completion);
|
||||
gchar * _gtk_entry_completion_compute_prefix (GtkEntryCompletion *completion,
|
||||
const char *key);
|
||||
|
||||
void _gtk_entry_get_borders (GtkEntry *entry,
|
||||
gint *xborder,
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "gtkalignment.h"
|
||||
#include "gtkcelllayout.h"
|
||||
#include "gtkcellrenderertext.h"
|
||||
#include "gtkentry.h"
|
||||
#include "gtkentryprivate.h"
|
||||
#include "gtkfilesystemmodel.h"
|
||||
#include "gtklabel.h"
|
||||
#include "gtkmain.h"
|
||||
@@ -363,7 +363,7 @@ explicitly_complete (GtkFileChooserEntry *chooser_entry)
|
||||
|
||||
text = gtk_file_chooser_entry_get_completion_text (chooser_entry);
|
||||
text_len = strlen (text);
|
||||
completion = gtk_entry_completion_compute_prefix (gtk_entry_get_completion (GTK_ENTRY (chooser_entry)), text);
|
||||
completion = _gtk_entry_completion_compute_prefix (gtk_entry_get_completion (GTK_ENTRY (chooser_entry)), text);
|
||||
completion_len = completion ? strlen (completion) : 0;
|
||||
|
||||
if (completion_len > text_len)
|
||||
|
||||
Reference in New Issue
Block a user