Closed jeffreyhc closed 8 years ago
@jeffreyhc :
The rename to addWrapper
violates the naming schema, which consists of lowercase verb and the target object begining with a capital letter. Your intention was originally "add" rather than adding "Wrapper" object to somewhere.
@jserv :
Thanks for your advice! How about addPhrase
?
(I think this maybe more precise but this function name is same as a function in UserphraseView.)
I agree with @Chocobo1 that add
method with access specifier 'public` should be straightforward.
@Chocobo1 @jserv I've fixed all you mentioned and modify my git commit message.
@jserv Does the "access specifier" means slot and signal?
Read C++ Programming language specification for the terminologies. http://en.cppreference.com/w/cpp/language/access
@jserv I think I don't get your point
The description "from private to public" is quite ambiguous for people to distinguish from phrases and dictionary storage.
What is "dictionary storage"? Why do people can't distinguish phrases and dictionary storage?
You should mention the access specifier.
I thought "from private to public" mentioned about the access specifier?
@jeffreyhc Because Chewing does have "private" dictionary! It is so-called user-defined phrase in the form of "hash", which is historically a terminology existing for more than 15 years. In the opposite side, Chewing has the system dictionary, which is "public".
Userphrase is kept in private storage for each IM instance, and the way to change its descriptions might result in the misunderstanding about its transition to public via shared networks.
@jserv I plan to modify my commit message like this:
Refactor the parameter type of add function
Remove "shared_ptr" type for the QString buffer phrase and bopomofo,
because "QString" can "implicit sharing" just do the same thing of
"shared_ptr". "Implicit sharing" makes ownership of an object can be
shared through pointers and the object is copied only if and when
the content is going to be changed, i.e., copy-on-write.
Moreover, in UserphraseModel, I remove the public add() which only
calls the private add() and the private add() is the function really
add phrase to dictionary. Then modify the access specifier of the
add() from private to public.
How do you think about the message?
@jeffreyhc : Do after review! Update frequently, and everyone can provides the feedback often.
@jserv OK, I update my commit.
Fix the syntax error in commit messages:
"QString" can "implicit sharing" just do the same thing of "shared_ptr"
How about this version?
Don't use quotation marks to specify a common term or phrase such as "QString" in Git commit messages. Also, you don't have to inform others of the time when the revised patch was pushed since CI does this well.
Ref: https://github.com/chewing/chewing-editor/pull/149#discussion_r57522841
I refactor the add function parameter type and rename the slot add function in UserphraseModel to addWrapper for temporary, if there is a better idea please tell me.