Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package fcitx5-rime for openSUSE:Factory 
checked in at 2022-11-28 11:05:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fcitx5-rime (Old)
 and      /work/SRC/openSUSE:Factory/.fcitx5-rime.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fcitx5-rime"

Mon Nov 28 11:05:51 2022 rev:5 rq:1038432 version:5.0.15

Changes:
--------
--- /work/SRC/openSUSE:Factory/fcitx5-rime/fcitx5-rime.changes  2022-07-15 
13:52:57.295572666 +0200
+++ /work/SRC/openSUSE:Factory/.fcitx5-rime.new.1597/fcitx5-rime.changes        
2022-11-28 11:05:55.747421537 +0100
@@ -1,0 +2,8 @@
+Sun Nov 20 10:24:21 UTC 2022 - Fusion Future <[email protected]>
+
+- Update to 5.0.15
+  * fixes some memory leaks
+- Remove obsolete patch, since Leap 15.3 already has newer CMake
+  * fcitx5-rime-cmake-3.10.patch
+
+-------------------------------------------------------------------

Old:
----
  fcitx5-rime-5.0.14.tar.xz

New:
----
  fcitx5-rime-5.0.15.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ fcitx5-rime.spec ++++++
--- /var/tmp/diff_new_pack.5bKCwz/_old  2022-11-28 11:05:56.463425043 +0100
+++ /var/tmp/diff_new_pack.5bKCwz/_new  2022-11-28 11:05:56.467425062 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           fcitx5-rime
-Version:        5.0.14
+Version:        5.0.15
 Release:        0
 Summary:        RIME support for Fcitx5
 License:        LGPL-2.1-or-later

++++++ fcitx5-rime-5.0.14.tar.xz -> fcitx5-rime-5.0.15.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-rime-5.0.14/CMakeLists.txt 
new/fcitx5-rime-5.0.15/CMakeLists.txt
--- old/fcitx5-rime-5.0.14/CMakeLists.txt       2022-07-03 19:55:42.055909600 
+0200
+++ new/fcitx5-rime-5.0.15/CMakeLists.txt       2022-11-20 08:08:12.975394700 
+0100
@@ -1,6 +1,6 @@
 cmake_minimum_required(VERSION 3.4.0)
 
-project(fcitx5-rime VERSION 5.0.14)
+project(fcitx5-rime VERSION 5.0.15)
 
 find_package(ECM 1.0.0 REQUIRED)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" 
${CMAKE_MODULE_PATH})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fcitx5-rime-5.0.14/org.fcitx.Fcitx5.Addon.Rime.metainfo.xml.in 
new/fcitx5-rime-5.0.15/org.fcitx.Fcitx5.Addon.Rime.metainfo.xml.in
--- old/fcitx5-rime-5.0.14/org.fcitx.Fcitx5.Addon.Rime.metainfo.xml.in  
2022-07-03 19:55:42.155905500 +0200
+++ new/fcitx5-rime-5.0.15/org.fcitx.Fcitx5.Addon.Rime.metainfo.xml.in  
2022-11-20 08:08:13.052061800 +0100
@@ -10,6 +10,7 @@
   <url type="bugtracker">https://github.com/fcitx/fcitx5-rime/issues</url>
   <project_group>Fcitx</project_group>
   <releases>
+    <release version="5.0.15" date="2022-11-19"/>
     <release version="5.0.14" date="2022-07-03"/>
     <release version="5.0.13" date="2022-05-22"/>
     <release version="5.0.12" date="2022-03-09"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-rime-5.0.14/src/rimecandidate.cpp 
new/fcitx5-rime-5.0.15/src/rimecandidate.cpp
--- old/fcitx5-rime-5.0.14/src/rimecandidate.cpp        2020-05-09 
01:29:31.317116000 +0200
+++ new/fcitx5-rime-5.0.15/src/rimecandidate.cpp        2022-11-08 
04:58:32.800564500 +0100
@@ -24,9 +24,10 @@
 void RimeCandidateWord::select(InputContext *inputContext) const {
     // Rime does not provide such an API, simulate the selection with a fake
     // key event.
-    auto state = engine_->state(inputContext);
-    KeyEvent event(inputContext, Key(sym_));
-    state->keyEvent(event);
+    if (auto state = engine_->state(inputContext)) {
+        KeyEvent event(inputContext, Key(sym_));
+        state->keyEvent(event);
+    }
 }
 
 RimeCandidateList::RimeCandidateList(RimeEngine *engine, InputContext *ic,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-rime-5.0.14/src/rimecandidate.h 
new/fcitx5-rime-5.0.15/src/rimecandidate.h
--- old/fcitx5-rime-5.0.14/src/rimecandidate.h  2020-05-09 01:29:31.317116000 
+0200
+++ new/fcitx5-rime-5.0.15/src/rimecandidate.h  2022-11-08 04:58:12.999984300 
+0100
@@ -49,11 +49,15 @@
     bool hasNext() const override { return hasNext_; }
     void prev() override {
         KeyEvent event(ic_, Key(FcitxKey_Page_Up));
-        engine_->state(ic_)->keyEvent(event);
+        if (auto state = engine_->state(ic_)) {
+            state->keyEvent(event);
+        }
     }
     void next() override {
         KeyEvent event(ic_, Key(FcitxKey_Page_Down));
-        engine_->state(ic_)->keyEvent(event);
+        if (auto state = engine_->state(ic_)) {
+            state->keyEvent(event);
+        }
     }
 
     bool usedNextBefore() const override { return true; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-rime-5.0.14/src/rimeengine.cpp 
new/fcitx5-rime-5.0.15/src/rimeengine.cpp
--- old/fcitx5-rime-5.0.14/src/rimeengine.cpp   2022-06-30 06:13:14.526662800 
+0200
+++ new/fcitx5-rime-5.0.15/src/rimeengine.cpp   2022-11-08 04:59:08.628269700 
+0100
@@ -55,20 +55,21 @@
     IMAction(RimeEngine *engine) : engine_(engine) {}
 
     std::string shortText(InputContext *ic) const override {
-        auto state = engine_->state(ic);
-        RIME_STRUCT(RimeStatus, status);
         std::string result;
-        if (state->getStatus(&status)) {
-            if (status.is_disabled) {
-                result = "\xe2\x8c\x9b";
-            } else if (status.is_ascii_mode) {
-                result = "A";
-            } else if (status.schema_name && status.schema_name[0] != '.') {
-                result = status.schema_name;
-            } else {
-                result = "中";
-            }
-            engine_->api()->free_status(&status);
+        auto state = engine_->state(ic);
+        if (state) {
+            state->getStatus([&result](const RimeStatus &status) {
+                result = status.schema_id ? status.schema_id : "";
+                if (status.is_disabled) {
+                    result = "\xe2\x8c\x9b";
+                } else if (status.is_ascii_mode) {
+                    result = "A";
+                } else if (status.schema_name && status.schema_name[0] != '.') 
{
+                    result = status.schema_name;
+                } else {
+                    result = "中";
+                }
+            });
         } else {
             result = "\xe2\x8c\x9b";
         }
@@ -76,25 +77,26 @@
     }
 
     std::string longText(InputContext *ic) const override {
-        auto state = engine_->state(ic);
         std::string result;
-        RIME_STRUCT(RimeStatus, status);
-        if (state->getStatus(&status)) {
-            if (status.schema_name) {
-                result = status.schema_name;
-            }
-            engine_->api()->free_status(&status);
+        auto state = engine_->state(ic);
+        if (state) {
+            state->getStatus([&result](const RimeStatus &status) {
+                result = status.schema_name ? status.schema_name : "";
+            });
         }
         return result;
     }
 
     std::string icon(InputContext *ic) const override {
+        bool isDisabled = false;
         auto state = engine_->state(ic);
-        RIME_STRUCT(RimeStatus, status);
-        if (state->getStatus(&status)) {
-            if (status.is_disabled) {
-                return "fcitx-rime-disabled";
-            }
+        if (state) {
+            state->getStatus([&isDisabled](const RimeStatus &status) {
+                isDisabled = status.is_disabled;
+            });
+        }
+        if (isDisabled) {
+            return "fcitx-rime-disabled";
         }
         return "fcitx-rime-im";
     }
@@ -116,7 +118,7 @@
     deployAction_.connect<SimpleAction::Activated>([this](InputContext *ic) {
         deploy();
         auto state = this->state(ic);
-        if (ic->hasFocus()) {
+        if (state && ic->hasFocus()) {
             state->updateUI(ic, false);
         }
     });
@@ -129,7 +131,7 @@
     syncAction_.connect<SimpleAction::Activated>([this](InputContext *ic) {
         sync();
         auto state = this->state(ic);
-        if (ic->hasFocus()) {
+        if (state && ic->hasFocus()) {
             state->updateUI(ic, false);
         }
     });
@@ -397,18 +399,25 @@
 }
 
 RimeState *RimeEngine::state(InputContext *ic) {
+    if (!factory_.registered()) {
+        return nullptr;
+    }
     return ic->propertyFor(&factory_);
 }
 
 std::string RimeEngine::subMode(const InputMethodEntry &, InputContext &ic) {
-    auto rimeState = state(&ic);
-    return rimeState->subMode();
+    if (auto rimeState = state(&ic)) {
+        return rimeState->subMode();
+    }
+    return "";
 }
 
 std::string RimeEngine::subModeLabelImpl(const InputMethodEntry &,
                                          InputContext &ic) {
-    auto rimeState = state(&ic);
-    return rimeState->subModeLabel();
+    if (auto rimeState = state(&ic)) {
+        return rimeState->subModeLabel();
+    }
+    return "";
 }
 
 std::string RimeEngine::subModeIconImpl(const InputMethodEntry &,
@@ -418,16 +427,16 @@
         return result;
     }
     auto state = this->state(&ic);
-    RIME_STRUCT(RimeStatus, status);
-    if (state->getStatus(&status)) {
-        if (status.is_disabled) {
-            result = "fcitx-rime-disable";
-        } else if (status.is_ascii_mode) {
-            result = "fcitx-rime-latin";
-        } else {
-            result = "fcitx-rime";
-        }
-        api_->free_status(&status);
+    if (state) {
+        state->getStatus([&result](const RimeStatus &status) {
+            if (status.is_disabled) {
+                result = "fcitx-rime-disable";
+            } else if (status.is_ascii_mode) {
+                result = "fcitx-rime-latin";
+            } else {
+                result = "fcitx-rime";
+            }
+        });
     }
     return result;
 }
@@ -435,8 +444,9 @@
 void RimeEngine::deploy() {
     RIME_DEBUG() << "Rime Deploy";
     instance_->inputContextManager().foreach([this](InputContext *ic) {
-        auto state = this->state(ic);
-        state->release();
+        if (auto state = this->state(ic)) {
+            state->release();
+        }
         return true;
     });
     api_->finalize();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-rime-5.0.14/src/rimeservice.cpp 
new/fcitx5-rime-5.0.15/src/rimeservice.cpp
--- old/fcitx5-rime-5.0.14/src/rimeservice.cpp  2021-11-02 01:36:59.249882200 
+0100
+++ new/fcitx5-rime-5.0.15/src/rimeservice.cpp  2022-11-08 04:58:12.999984300 
+0100
@@ -24,7 +24,7 @@
     if (!ic) {
         return nullptr;
     }
-    return ic->propertyFor(&engine_->factory());
+    return engine_->state(ic);
 }
 
 void RimeService::setAsciiMode(bool ascii) {
@@ -38,13 +38,13 @@
 }
 
 bool RimeService::isAsciiMode() {
+    bool isAscii = false;
     if (auto state = currentState()) {
-        RIME_STRUCT(RimeStatus, status);
-        if (state->getStatus(&status)) {
-            return status.is_ascii_mode;
-        }
+        state->getStatus([&isAscii](const RimeStatus &status) {
+            isAscii = status.is_ascii_mode;
+        });
     }
-    return false;
+    return isAscii;
 }
 
 void RimeService::setSchema(const std::string &schema) {
@@ -58,13 +58,14 @@
 }
 
 std::string RimeService::currentSchema() {
-    if (auto state = currentState()) {
-        RIME_STRUCT(RimeStatus, status);
-        if (state->getStatus(&status)) {
-            return status.schema_id ? status.schema_id : "";
-        }
+    std::string result;
+    auto state = currentState();
+    if (state) {
+        state->getStatus([&result](const RimeStatus &status) {
+            result = status.schema_id ? status.schema_id : "";
+        });
     }
-    return "";
+    return result;
 }
 
 std::vector<std::string> RimeService::listAllSchemas() {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-rime-5.0.14/src/rimestate.cpp 
new/fcitx5-rime-5.0.15/src/rimestate.cpp
--- old/fcitx5-rime-5.0.14/src/rimestate.cpp    2022-01-12 06:12:28.304102700 
+0100
+++ new/fcitx5-rime-5.0.15/src/rimestate.cpp    2022-11-08 05:01:15.195166800 
+0100
@@ -47,8 +47,7 @@
 
 std::string RimeState::subMode() {
     std::string result;
-    RIME_STRUCT(RimeStatus, status);
-    if (getStatus(&status)) {
+    getStatus([&result](const RimeStatus &status) {
         if (status.is_disabled) {
             result = "\xe2\x8c\x9b";
         } else if (status.is_ascii_mode) {
@@ -56,15 +55,13 @@
         } else if (status.schema_name && status.schema_name[0] != '.') {
             result = status.schema_name;
         }
-        engine_->api()->free_status(&status);
-    }
+    });
     return result;
 }
 
 std::string RimeState::subModeLabel() {
     std::string result;
-    RIME_STRUCT(RimeStatus, status);
-    if (getStatus(&status)) {
+    getStatus([this, &result](const RimeStatus &status) {
         if (status.is_disabled) {
             result = "";
         } else if (status.is_ascii_mode) {
@@ -78,8 +75,7 @@
                                      utf8::nextChar(result.begin())));
             }
         }
-        engine_->api()->free_status(&status);
-    }
+    });
     return result;
 }
 
@@ -141,7 +137,8 @@
     }
 }
 
-bool RimeState::getStatus(RimeStatus *status) {
+bool RimeState::getStatus(
+    const std::function<void(const RimeStatus &)> &callback) {
     auto api = engine_->api();
     if (!api) {
         return false;
@@ -152,7 +149,13 @@
     if (!session_) {
         return false;
     }
-    return api->get_status(session_, status);
+    RIME_STRUCT(RimeStatus, status);
+    if (!api->get_status(session_, &status)) {
+        return false;
+    }
+    callback(status);
+    api->free_status(&status);
+    return true;
 }
 
 void RimeState::updatePreedit(InputContext *ic, const RimeContext &context) {
@@ -299,6 +302,7 @@
         if (context.commit_text_preview) {
             ic->commitString(context.commit_text_preview);
         }
+        api->free_context(&context);
     }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-rime-5.0.14/src/rimestate.h 
new/fcitx5-rime-5.0.15/src/rimestate.h
--- old/fcitx5-rime-5.0.14/src/rimestate.h      2021-12-29 19:21:02.231941000 
+0100
+++ new/fcitx5-rime-5.0.15/src/rimestate.h      2022-11-08 04:59:34.529011700 
+0100
@@ -19,7 +19,7 @@
 
     void clear();
     void keyEvent(KeyEvent &event);
-    bool getStatus(RimeStatus *status);
+    bool getStatus(const std::function<void(const RimeStatus &)> &);
     void updatePreedit(InputContext *ic, const RimeContext &context);
     void updateUI(InputContext *ic, bool keyRelease);
     void release();

Reply via email to