[Webkit-unassigned] [Bug 122681] [GTK] Search functionality in MiniBrowser provides feedback on search fail

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 25 06:20:59 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=122681





--- Comment #6 from Mario Sanchez Prada <mario at webkit.org>  2013-11-25 06:19:27 PST ---
(In reply to comment #5)
> [...]
> > Tools/MiniBrowser/gtk/BrowserSearchBar.c:35
> > +    GtkCssProvider *cssProvider;
> > +    const gchar* failStyle;
> 
> Wrong * location for failStyle.
> 
> Also, I think that we normally use char instead of gchar for internal variables
> 
> > Tools/MiniBrowser/gtk/BrowserSearchBar.c:51
> > +    if (failedSearch)
> > +        gtk_css_provider_load_from_data(searchBar->cssProvider, searchBar->failStyle, -1, NULL);
> > +    else
> > +        gtk_css_provider_load_from_data(searchBar->cssProvider, "", -1, NULL);
> 
> That's more of a personal preference I think, but I'd use the ternary operator here
> 
>
> > Tools/MiniBrowser/gtk/BrowserSearchBar.c:169
> > +    searchBar->failStyle = " GtkEntry#searchEntry {\n"
> > +        "   background-color: #ff6666;\n"
> > +        "}\n";
> 
> What about putting this string in one line only (no \n) and moving its 
> definition to a global const (static const char*) up in this file, 
> right after the priv struct?

Actually, I just realized that you don't need to keep the const char for failStyle in the private struct at all if you follow this advice :)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list