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: | WebKitGTK | Assignee: | 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
Alejandro G. Castro
2010-12-09 01:54:25 PST
Created attachment 76025 [details]
Proposed patch
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()) { ... } (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. Created attachment 76043 [details]
Proposed patch
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. |