Bug 50738

Summary: [GTK] Choose a dictionary in case there is no one defined or the env LANG does not propose one
Product: WebKit Reporter: Alejandro G. Castro <alex>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 50739    
Attachments:
Description Flags
Proposed patch
mrobinson: review-
Proposed patch mrobinson: review+

Alejandro G. Castro
Reported 2010-12-09 01:54:25 PST
Currently we are not setting any dictionary and this is causing that the DRT in case the LANG is set to C does not take any dict and spelling tests fail.
Attachments
Proposed patch (3.05 KB, patch)
2010-12-09 02:06 PST, Alejandro G. Castro
mrobinson: review-
Proposed patch (2.55 KB, patch)
2010-12-09 04:15 PST, Alejandro G. Castro
mrobinson: review+
Alejandro G. Castro
Comment 1 2010-12-09 02:06:22 PST
Created attachment 76025 [details] Proposed patch
Martin Robinson
Comment 2 2010-12-09 02:14:53 PST
Comment on attachment 76025 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=76025&action=review Yay! Thanks for fixing this. > WebKit/gtk/webkit/webkitwebsettings.cpp:953 > +static void get_avail_dicts_cb(const char * const lang_tag, const char * const provider_name, const char * const provider_desc, const char * const provider_file, void * data) Should be in WebKit style (camelCase), asterisks with the typenames and use full words instead of abbreviations. :) > WebKit/gtk/webkit/webkitwebsettings.cpp:1079 > + // No dictionaries selected, we get one from the list > + enchant_broker_list_dicts(broker, get_avail_dicts_cb, &dicts); > + if (dicts) { > + GSList* tmp; Instead of passing a GSList* it might simplify things to pass a point to a Vector<CString> like: Vector<CString> allDictionaries; enchant_broker_list_dicts(broker, getAvilableDictionariesCallback, &allDictionaries); if (!allDictionaries.empty()) { ... }
Alejandro G. Castro
Comment 3 2010-12-09 04:14:24 PST
(In reply to comment #2) > (From update of attachment 76025 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=76025&action=review > > Yay! Thanks for fixing this. > Thanks for the review, I like your proposal.
Alejandro G. Castro
Comment 4 2010-12-09 04:15:47 PST
Created attachment 76043 [details] Proposed patch
Martin Robinson
Comment 5 2010-12-09 04:33:31 PST
Comment on attachment 76043 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=76043&action=review Thank you! Please fix the remaining minor issues before landing. > WebKit/gtk/webkit/webkitwebsettings.cpp:953 > +static void getAvilableDictionariesCallback(const char* const lang_tag, const char* const provider_name, const char* const provider_desc, const char* const provider_file, void* data) Please change lang_tag to languageTag before landing. You should actually omit provider_name, provider_desc, and provider_file to avoid a warning here too. > WebKit/gtk/webkit/webkitwebsettings.cpp:955 > + Vector<CString>* dicts = static_cast< Vector<CString>* >(data); Please remove the extra space after the static_cast< before landing.
Alejandro G. Castro
Comment 6 2010-12-10 09:37:50 PST
Note You need to log in before you can comment on or make changes to this bug.