1- From 15a8b479e66ac597a0fca4bede8012f5bb9df151 Mon Sep 17 00:00:00 2001
2- From: Rocka <i@rocka.me>
3- Date: Tue, 12 Nov 2024 22:16:16 +0800
4- Subject: [PATCH 1/2] set file-prefix-map to relative path
5-
6- ---
7- src/CMakeLists.txt | 2 ++
8- 1 file changed, 2 insertions(+)
9-
101diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
11- index 16082869..c4a5b5ca 100644
2+ index 8faa61f8..671622ce 100644
123--- a/src/CMakeLists.txt
134+++ b/src/CMakeLists.txt
145@@ -166,6 +166,8 @@ if(BUILD_SHARED_LIBS)
@@ -20,24 +11,8 @@ index 16082869..c4a5b5ca 100644
2011 set_target_properties(rime-static PROPERTIES
2112 OUTPUT_NAME "rime" PREFIX "lib"
2213 ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
23- - -
24- 2.47.0
25-
26-
27- From 25608d1ea7a246b3ac4e7ccc02b1b6dfbb468869 Mon Sep 17 00:00:00 2001
28- From: Rocka <i@rocka.me>
29- Date: Tue, 12 Nov 2024 22:20:33 +0800
30- Subject: [PATCH 2/2] Persist options to user.yaml in RimeSetOption
31-
32- ---
33- src/rime/engine.cc | 1 -
34- src/rime/engine.h | 2 ++
35- src/rime/service.h | 8 ++++----
36- src/rime_api_impl.h | 9 +++++++++
37- 4 files changed, 15 insertions(+), 5 deletions(-)
38-
3914diff --git a/src/rime/engine.cc b/src/rime/engine.cc
40- index 07aa6b7d..7360e0b5 100644
15+ index 4a54f64c..2efe0c93 100644
4116--- a/src/rime/engine.cc
4217+++ b/src/rime/engine.cc
4318@@ -52,7 +52,6 @@ class ConcreteEngine : public Engine {
@@ -49,7 +24,7 @@ index 07aa6b7d..7360e0b5 100644
4924
5025 // implementations
5126diff --git a/src/rime/engine.h b/src/rime/engine.h
52- index 2e1c8b81..94a6b500 100644
27+ index 6b51a68e..c5b8f7e4 100644
5328--- a/src/rime/engine.h
5429+++ b/src/rime/engine.h
5530@@ -16,6 +16,7 @@ namespace rime {
@@ -68,8 +43,30 @@ index 2e1c8b81..94a6b500 100644
6843
6944 protected:
7045 Engine();
46+ diff --git a/src/rime/lever/deployment_tasks.cc b/src/rime/lever/deployment_tasks.cc
47+ index 6e6ff895..fe111d55 100644
48+ --- a/src/rime/lever/deployment_tasks.cc
49+ +++ b/src/rime/lever/deployment_tasks.cc
50+ @@ -429,17 +429,6 @@ static bool ConfigNeedsUpdate(Config* config) {
51+ }
52+
53+ bool ConfigFileUpdate::Run(Deployer* deployer) {
54+ - const path shared_data_path(deployer->shared_data_dir);
55+ - const path user_data_path(deployer->user_data_dir);
56+ - // trash deprecated user copy created by an older version of Rime
57+ - path source_config_path(shared_data_path / file_name_);
58+ - path dest_config_path(user_data_path / file_name_);
59+ - path trash = user_data_path / "trash";
60+ - if (TrashDeprecatedUserCopy(source_config_path, dest_config_path,
61+ - version_key_, trash)) {
62+ - LOG(WARNING) << "deprecated user copy of '" << file_name_
63+ - << "' is moved to " << trash;
64+ - }
65+ // build the config file if needs update
66+ the<Config> config(Config::Require("config")->Create(file_name_));
67+ if (ConfigNeedsUpdate(config.get())) {
7168diff --git a/src/rime/service.h b/src/rime/service.h
72- index 2b3111af..95ca87dc 100644
69+ index a69ae741..9b3d4b16 100644
7370--- a/src/rime/service.h
7471+++ b/src/rime/service.h
7572@@ -44,11 +44,11 @@ class Session {
@@ -89,7 +86,7 @@ index 2b3111af..95ca87dc 100644
8986 string commit_text_;
9087 };
9188diff --git a/src/rime_api_impl.h b/src/rime_api_impl.h
92- index 7749ce98..b0200a67 100644
89+ index 30f4514f..c17d4794 100644
9390--- a/src/rime_api_impl.h
9491+++ b/src/rime_api_impl.h
9592@@ -17,6 +17,8 @@
@@ -101,7 +98,7 @@ index 7749ce98..b0200a67 100644
10198
10299 using namespace rime;
103100
104- @@ -426 ,6 +428 ,13 @@ RIME_DEPRECATED void RimeSetOption(RimeSessionId session_id,
101+ @@ -430 ,6 +432 ,13 @@ RIME_DEPRECATED void RimeSetOption(RimeSessionId session_id,
105102 if (!ctx)
106103 return;
107104 ctx->set_option(option, !!value);
@@ -115,6 +112,3 @@ index 7749ce98..b0200a67 100644
115112 }
116113
117114 RIME_DEPRECATED Bool RimeGetOption(RimeSessionId session_id,
118- - -
119- 2.47.0
120-
0 commit comments