Swap checks for completion data and key to fix the arrow popup

This commit is contained in:
Dale Whittaker 2009-08-24 23:15:57 +02:00 committed by Christian Dywan
parent b4a6de2e96
commit 72ae687ef2

View file

@ -638,12 +638,10 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout,
: g_ascii_strdown (gtk_entry_get_text (GTK_ENTRY (entry)), -1); : g_ascii_strdown (gtk_entry_get_text (GTK_ENTRY (entry)), -1);
len = 0; len = 0;
} }
if (key && *key)
{
if (G_LIKELY (data && uri)) if (G_LIKELY (data && uri))
{ {
temp = g_ascii_strdown (uri, -1); temp = g_ascii_strdown (uri, -1);
if ((start = strstr (temp, key))) if (key && *key && (start = strstr (temp, key)))
{ {
len = strlen (key); len = strlen (key);
skey = g_malloc0 (len + 1); skey = g_malloc0 (len + 1);
@ -666,7 +664,7 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout,
if (G_LIKELY (data && title)) if (G_LIKELY (data && title))
{ {
temp = g_utf8_strdown (title, -1); temp = g_utf8_strdown (title, -1);
if ((start = strstr (temp, key))) if (key && *key && (start = strstr (temp, key)))
{ {
if (!len) if (!len)
len = strlen (key); len = strlen (key);
@ -696,7 +694,7 @@ midori_location_entry_render_text_cb (GtkCellLayout* layout,
g_object_set (renderer, "markup", desc, g_object_set (renderer, "markup", desc,
"ellipsize-set", TRUE, "ellipsize", PANGO_ELLIPSIZE_END, NULL); "ellipsize-set", TRUE, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
}
g_free (uri); g_free (uri);
g_free (title); g_free (title);
g_free (key); g_free (key);