Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): new api to save input history without cleaning up sessions #766

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/rime_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ RIME_API Bool RimeSyncUserData() {
return Bool(deployer.StartMaintenance());
}

RIME_API Bool RimeSyncUserDict() {
Deployer& deployer(Service::instance().deployer());
return Bool(deployer.ScheduleTask("user_dict_sync"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this safe to do while user input session accesses user dictionary simutaniously?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it working? It doesn't look like actually running the task.

}

// session management

RIME_API RimeSessionId RimeCreateSession() {
Expand Down Expand Up @@ -1101,6 +1106,7 @@ RIME_API RimeApi* rime_get_api() {
s_api.deploy_schema = &RimeDeploySchema;
s_api.deploy_config_file = &RimeDeployConfigFile;
s_api.sync_user_data = &RimeSyncUserData;
s_api.sync_user_dict = &RimeSyncUserDict;
s_api.create_session = &RimeCreateSession;
s_api.find_session = &RimeFindSession;
s_api.destroy_session = &RimeDestroySession;
Expand Down
2 changes: 2 additions & 0 deletions src/rime_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ RIME_API Bool RimeDeployConfigFile(const char* file_name,
const char* version_key);

RIME_API Bool RimeSyncUserData(void);
RIME_API Bool RimeSyncUserDict(void);

// Session management

Expand Down Expand Up @@ -465,6 +466,7 @@ typedef struct rime_api_t {
Bool (*deploy_config_file)(const char* file_name, const char* version_key);

Bool (*sync_user_data)(void);
Bool (*sync_user_dict)(void);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't insert new API functions.


// session management

Expand Down