Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package fcitx5-unikey for openSUSE:Factory 
checked in at 2025-06-23 15:04:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fcitx5-unikey (Old)
 and      /work/SRC/openSUSE:Factory/.fcitx5-unikey.new.7067 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fcitx5-unikey"

Mon Jun 23 15:04:17 2025 rev:12 rq:1287696 version:5.1.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/fcitx5-unikey/fcitx5-unikey.changes      
2025-01-29 16:18:30.963718364 +0100
+++ /work/SRC/openSUSE:Factory/.fcitx5-unikey.new.7067/fcitx5-unikey.changes    
2025-06-23 15:05:19.697872570 +0200
@@ -1,0 +2,8 @@
+Sun Jun 22 04:05:05 UTC 2025 - Marguerite Su <[email protected]>
+
+- update to 5.1.7
+  * get rid of fcitx::getline usage
+  * port to StandardPaths and drop Qt5
+  * Remove QOverload that's only new qt 6
+
+-------------------------------------------------------------------

Old:
----
  _multibuild
  fcitx5-unikey-5.1.6.tar.zst

New:
----
  fcitx5-unikey-5.1.7.tar.zst

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

Other differences:
------------------
++++++ fcitx5-unikey.spec ++++++
--- /var/tmp/diff_new_pack.0KZvS0/_old  2025-06-23 15:05:20.525907115 +0200
+++ /var/tmp/diff_new_pack.0KZvS0/_new  2025-06-23 15:05:20.529907282 +0200
@@ -16,22 +16,14 @@
 #
 
 
-%global flavor @BUILD_FLAVOR@%{nil}
-%global sname fcitx5-unikey
-%if "%{flavor}" == ""
-%global pname %sname
-%else
-%global pname %{sname}-%{flavor}
-%endif
-
-Name:           %{pname}
-Version:        5.1.6
+Name:           fcitx5-unikey
+Version:        5.1.7
 Release:        0
 Summary:        Unikey engine support for Fcitx5
 License:        GPL-2.0-or-later AND LGPL-2.0-or-later
 Group:          System/Localization
 URL:            https://github.com/fcitx/fcitx5-unikey
-Source:         
https://download.fcitx-im.org/fcitx5/%{sname}/%{sname}-%{version}.tar.zst
+Source:         
https://download.fcitx-im.org/fcitx5/%{name}/%{name}-%{version}.tar.zst
 BuildRequires:  cmake
 BuildRequires:  extra-cmake-modules
 BuildRequires:  fcitx5-devel
@@ -39,18 +31,12 @@
 BuildRequires:  gcc-c++
 BuildRequires:  hicolor-icon-theme
 BuildRequires:  pkgconfig
+BuildRequires:  qt6-base-devel
 BuildRequires:  zstd
-%if "%{flavor}" == ""
-BuildRequires:  libqt5-qtbase-devel
 Requires:       fcitx5
 Provides:       fcitx-unikey = %{version}
 Obsoletes:      fcitx-unikey <= 0.2.7
-Conflicts:      %{sname}-qt6
-%endif
-%if "%{flavor}" == "qt6"
-BuildRequires:  qt6-base-devel
-Conflicts:      %{sname}
-%endif
+Obsoletes:      fcitx5-unikey-qt6 <= 5.1.6
 %if 0%{?suse_version} <= 1520
 BuildRequires:  appstream-glib-devel
 %endif
@@ -59,37 +45,26 @@
 Chewing Wrapper for Fcitx5.
 
 %prep
-%setup -q -n %{sname}-%{version}
+%setup -q -n %{name}-%{version}
 
 %build
-%if "%{flavor}" == ""
-%cmake -DUSE_QT6=OFF
-%endif
-%if "%{flavor}" == "qt6"
 %if 0%{?suse_version} == 1500
 %cmake -DCMAKE_CXX_COMPILER=%{_bindir}/g++-13
 %else
 %cmake
 %endif
-%endif
 %make_build
 
 %install
 %cmake_install
-%find_lang %{sname}
+%find_lang %{name}
 
-%files -f %{sname}.lang
+%files -f %{name}.lang
 %license LICENSES
 %doc README
 %{_fcitx5_libdir}/libunikey.so
-%if "%{flavor}" == ""
-%{_fcitx5_qt5dir}/libfcitx5-unikey-keymap-editor.so
-%{_fcitx5_qt5dir}/libfcitx5-unikey-macro-editor.so
-%endif
-%if "%{flavor}" == "qt6"
 %{_libdir}/fcitx5/qt6/libfcitx5-unikey-keymap-editor.so
 %{_libdir}/fcitx5/qt6/libfcitx5-unikey-macro-editor.so
-%endif
 %{_fcitx5_addondir}/unikey.conf
 %{_fcitx5_imconfdir}/unikey.conf
 %{_datadir}/icons/hicolor/*/apps/fcitx-unikey*

++++++ fcitx5-unikey-5.1.6.tar.zst -> fcitx5-unikey-5.1.7.tar.zst ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/.gitignore 
new/fcitx5-unikey-5.1.7/.gitignore
--- old/fcitx5-unikey-5.1.6/.gitignore  2025-01-23 00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/.gitignore  2025-06-16 08:26:18.000000000 +0200
@@ -1,4 +1,8 @@
-build/*
+build*/
+.*
+!.git*
+.git/
+*.tar.*
 *.kdev4
 .kdev_include_paths
 .directory
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/CMakeLists.txt 
new/fcitx5-unikey-5.1.7/CMakeLists.txt
--- old/fcitx5-unikey-5.1.6/CMakeLists.txt      2025-01-23 00:27:44.000000000 
+0100
+++ new/fcitx5-unikey-5.1.7/CMakeLists.txt      2025-06-16 08:26:18.000000000 
+0200
@@ -1,8 +1,8 @@
 cmake_minimum_required(VERSION 3.6)
 
-project(fcitx5-unikey VERSION 5.1.6)
+project(fcitx5-unikey VERSION 5.1.7)
 
-set(REQUIRED_FCITX_VERSION 5.1.12)
+set(REQUIRED_FCITX_VERSION 5.1.13)
 find_package(ECM 1.0.0 REQUIRED)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" 
${CMAKE_MODULE_PATH})
 include(FeatureSummary)
@@ -12,25 +12,23 @@
 option(ENABLE_QT "Enable Qt based macro editor" On)
 option(ENABLE_TEST "Build Test" On)
 option(ENABLE_COVERAGE "Build the project with gcov support (Need 
ENABLE_TEST=On)" Off)
-option(USE_QT6 "Use Qt6" On)
 
 find_package(PkgConfig REQUIRED)
 find_package(Fcitx5Core ${REQUIRED_FCITX_VERSION} REQUIRED)
 find_package(Fcitx5Module REQUIRED COMPONENTS TestFrontend)
 find_package(Gettext REQUIRED)
 
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+
 
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
 add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-unikey\")
 fcitx5_add_i18n_definition()
 
 if (ENABLE_QT)
-  if (USE_QT6)
-    set(QT_MAJOR_VERSION 6)
-    find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
-  else()
-    set(QT_MAJOR_VERSION 5)
-    find_package(Qt5 5.7 REQUIRED COMPONENTS Core Gui Widgets)
-  endif()
+  set(QT_MAJOR_VERSION 6)
+  find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
   find_package(Fcitx5Qt${QT_MAJOR_VERSION}WidgetsAddons 5.0.12 REQUIRED)
   add_subdirectory(macro-editor)
   add_subdirectory(keymap-editor)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/keymap-editor/editor.cpp 
new/fcitx5-unikey-5.1.7/keymap-editor/editor.cpp
--- old/fcitx5-unikey-5.1.6/keymap-editor/editor.cpp    2025-01-23 
00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/keymap-editor/editor.cpp    2025-06-16 
08:26:18.000000000 +0200
@@ -6,17 +6,27 @@
  */
 #include "editor.h"
 #include "actions.h"
-#include "inputproc.h"
+#include "keycons.h"
 #include "model.h"
-#include "ui_editor.h"
+#include <QAbstractItemModel>
 #include <QCloseEvent>
+#include <QComboBox>
 #include <QDebug>
 #include <QFileDialog>
+#include <QItemSelectionModel>
+#include <QList>
 #include <QMessageBox>
+#include <QObject>
+#include <QPushButton>
+#include <QStandardItem>
+#include <QWidget>
+#include <Qt>
 #include <fcitx-utils/charutils.h>
-#include <fcitx-utils/standardpath.h>
+#include <fcitx-utils/i18n.h>
+#include <fcitx-utils/key.h>
+#include <fcitx-utils/standardpaths.h>
+#include <fcitxqtconfiguiwidget.h>
 #include <fcitxqtkeysequencewidget.h>
-#include <tuple>
 
 namespace fcitx::unikey {
 
@@ -137,10 +147,7 @@
         return false;
     }
     auto key = keySequenceEdit->keySequence()[0];
-    if (!key.isValid() || !key.isSimple()) {
-        return false;
-    }
-    return true;
+    return key.isValid() && key.isSimple();
 }
 
 void KeymapEditor::deleteKeymap() {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/keymap-editor/model.cpp 
new/fcitx5-unikey-5.1.7/keymap-editor/model.cpp
--- old/fcitx5-unikey-5.1.6/keymap-editor/model.cpp     2025-01-23 
00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/keymap-editor/model.cpp     2025-06-16 
08:26:18.000000000 +0200
@@ -8,17 +8,28 @@
 
 #include "actions.h"
 #include "editor.h"
+#include "inputproc.h"
+#include "keycons.h"
 #include "model.h"
 #include "usrkeymap.h"
+#include <QAbstractItemModel>
+#include <QObject>
+#include <QString>
+#include <Qt>
+#include <algorithm>
+#include <cstddef>
 #include <fcitx-utils/charutils.h>
+#include <fcitx-utils/fs.h>
 #include <fcitx-utils/i18n.h>
-#include <fcitx-utils/standardpath.h>
+#include <fcitx-utils/standardpaths.h>
+#include <fcitx-utils/unixfd.h>
 #include <fcntl.h>
+#include <iterator>
+#include <utility>
 
-namespace fcitx {
-namespace unikey {
+namespace fcitx::unikey {
 
-typedef QPair<QString, QString> ItemType;
+using ItemType = std::pair<QString, QString>;
 
 KeymapModel::KeymapModel(QObject *parent)
     : QAbstractTableModel(parent), needSave_(false) {}
@@ -28,17 +39,21 @@
 QVariant KeymapModel::headerData(int section, Qt::Orientation orientation,
                                  int role) const {
     if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
-        if (section == 0)
+        if (section == 0) {
             return _("Keymap");
-        else if (section == 1)
+        }
+        if (section == 1) {
             return _("Word");
+        }
     }
-    return QVariant();
+    return {};
 }
 
-int KeymapModel::rowCount(const QModelIndex &) const { return list_.size(); }
+int KeymapModel::rowCount(const QModelIndex & /*parent*/) const {
+    return list_.size();
+}
 
-int KeymapModel::columnCount(const QModelIndex &) const { return 2; }
+int KeymapModel::columnCount(const QModelIndex & /*parent*/) const { return 2; 
}
 
 QVariant KeymapModel::data(const QModelIndex &index, int role) const {
     if (index.row() >= static_cast<int>(list_.size()) || index.row() < 0) {
@@ -48,14 +63,16 @@
     if (role == Qt::DisplayRole) {
         if (index.column() == 0) {
             return QString(QChar(list_[index.row()].key));
-        } else if (index.column() == 1) {
+        }
+        if (index.column() == 1) {
             return QString::fromStdString(
                 _(actionName(list_[index.row()].action)));
         }
     } else if (role == Qt::UserRole) {
         if (index.column() == 0) {
             return QChar(list_[index.row()].key);
-        } else if (index.column() == 1) {
+        }
+        if (index.column() == 1) {
             return list_[index.row()].action;
         }
     }
@@ -69,7 +86,7 @@
         key = charutils::toupper(key);
         checkBoth = true;
     }
-    const auto lower = charutils::tolower(key);
+    const unsigned char lower = charutils::tolower(key);
     bool updated = false;
     auto match = [key, checkBoth, lower](const UkKeyMapping &item) {
         if (item.action < vneCount &&
@@ -82,7 +99,7 @@
     auto iter = list_.begin();
     for (; iter != list_.end(); iter++) {
         if (match(*iter)) {
-            *iter = UkKeyMapping{key, action};
+            *iter = UkKeyMapping{.key = key, .action = action};
             updated = true;
             break;
         }
@@ -127,8 +144,9 @@
 }
 
 void KeymapModel::deleteItem(int row) {
-    if (row >= static_cast<int>(list_.size()))
+    if (row >= static_cast<int>(list_.size())) {
         return;
+    }
     beginRemoveRows(QModelIndex(), row, row);
     list_.erase(list_.begin() + row);
     endRemoveRows();
@@ -136,8 +154,9 @@
 }
 
 void KeymapModel::deleteAllItem() {
-    if (!list_.empty())
+    if (!list_.empty()) {
         setNeedSave(true);
+    }
     beginResetModel();
     list_.clear();
     endResetModel();
@@ -150,15 +169,14 @@
     }
 }
 
-bool KeymapModel::needSave() { return needSave_; }
+bool KeymapModel::needSave() const { return needSave_; }
 
 void KeymapModel::load() {
     beginResetModel();
-    auto keymapFile = StandardPath::global().open(
-        StandardPath::Type::PkgConfig, "unikey/keymap.txt", O_RDONLY);
-    auto fp = fs::openFD(keymapFile, "rb");
-    if (fp) {
-        list_ = UkLoadKeyOrderMap(fp.get());
+    auto keymapFile = 
StandardPaths::global().open(StandardPathsType::PkgConfig,
+                                                   "unikey/keymap.txt");
+    if (keymapFile.isValid()) {
+        list_ = UkLoadKeyOrderMap(keymapFile.fd());
     } else {
         list_.clear();
     }
@@ -166,21 +184,21 @@
 }
 
 void KeymapModel::save() {
-    StandardPath::global().safeSave(StandardPath::Type::PkgConfig,
-                                    "unikey/keymap.txt",
-                                    [this](int fd) { return saveToFd(fd); });
+    StandardPaths::global().safeSave(StandardPathsType::PkgConfig,
+                                     "unikey/keymap.txt",
+                                     [this](int fd) { return saveToFd(fd); });
     setNeedSave(false);
 }
 
 void KeymapModel::load(const QString &file) {
-    UniqueFilePtr fp{fopen(file.toLocal8Bit().constData(), "rb")};
+    UnixFD fd = UnixFD::own(open(file.toLocal8Bit().constData(), O_RDONLY));
 
-    if (!fp) {
+    if (!fd.isValid()) {
         return;
     }
 
     beginResetModel();
-    list_ = UkLoadKeyOrderMap(fp.get());
+    list_ = UkLoadKeyOrderMap(fd.fd());
     endResetModel();
     setNeedSave(true);
 }
@@ -189,9 +207,9 @@
     if (!file.startsWith("/")) {
         return;
     }
-    StandardPath::global().safeSave(StandardPath::Type::PkgConfig,
-                                    file.toLocal8Bit().constData(),
-                                    [this](int fd) { return saveToFd(fd); });
+    StandardPaths::global().safeSave(StandardPathsType::PkgConfig,
+                                     file.toLocal8Bit().constData(),
+                                     [this](int fd) { return saveToFd(fd); });
     setNeedSave(false);
 }
 
@@ -226,6 +244,8 @@
     case UkMsVi:
         mapping = MsViMethodMapping;
         break;
+    default:
+        break;
     }
     if (!mapping) {
         return;
@@ -240,5 +260,4 @@
     setNeedSave(true);
 }
 
-} // namespace unikey
-} // namespace fcitx
+} // namespace fcitx::unikey
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/keymap-editor/model.h 
new/fcitx5-unikey-5.1.7/keymap-editor/model.h
--- old/fcitx5-unikey-5.1.6/keymap-editor/model.h       2025-01-23 
00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/keymap-editor/model.h       2025-06-16 
08:26:18.000000000 +0200
@@ -7,33 +7,36 @@
 #ifndef _KEYMAP_EDITOR_MODEL_H_
 #define _KEYMAP_EDITOR_MODEL_H_
 
-#include "mactab.h"
-#include "usrkeymap.h"
+#include "inputproc.h"
 #include <QAbstractItemModel>
+#include <QObject>
 #include <QSet>
+#include <QString>
+#include <QVariant>
+#include <Qt>
+#include <vector>
 
-namespace fcitx {
-namespace unikey {
+namespace fcitx::unikey {
 class KeymapModel : public QAbstractTableModel {
     Q_OBJECT
 public:
     explicit KeymapModel(QObject *parent = 0);
     virtual ~KeymapModel();
 
-    virtual QVariant headerData(int section, Qt::Orientation orientation,
-                                int role = Qt::DisplayRole) const;
-    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
-    virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
-    virtual QVariant data(const QModelIndex &index,
-                          int role = Qt::DisplayRole) const;
+    QVariant headerData(int section, Qt::Orientation orientation,
+                        int role = Qt::DisplayRole) const override;
+    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+    int columnCount(const QModelIndex &parent = QModelIndex()) const override;
+    QVariant data(const QModelIndex &index,
+                  int role = Qt::DisplayRole) const override;
     void load();
     QModelIndex addItem(unsigned char key, int action);
-    void moveUp(int index);
-    void moveDown(int index);
+    void moveUp(int row);
+    void moveDown(int row);
     void deleteItem(int row);
     void deleteAllItem();
     void save();
-    bool needSave();
+    bool needSave() const;
     void load(const QString &fileName);
     void save(const QString &fileName);
     void load(int profile);
@@ -47,7 +50,6 @@
     bool needSave_;
     std::vector<UkKeyMapping> list_;
 };
-} // namespace unikey
-} // namespace fcitx
+} // namespace fcitx::unikey
 
 #endif // _MACRO_EDITOR_MODEL_H_
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/macro-editor/editor.cpp 
new/fcitx5-unikey-5.1.7/macro-editor/editor.cpp
--- old/fcitx5-unikey-5.1.6/macro-editor/editor.cpp     2025-01-23 
00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/macro-editor/editor.cpp     2025-06-16 
08:26:18.000000000 +0200
@@ -4,20 +4,30 @@
  * SPDX-License-Identifier: GPL-2.0-or-later
  *
  */
+#include "editor.h"
+#include "charset.h"
+#include "dialog.h"
+#include "keycons.h"
+#include "mactab.h"
+#include "model.h"
+#include "vnconv.h"
 #include <QCloseEvent>
 #include <QDebug>
+#include <QDialog>
 #include <QFileDialog>
+#include <QItemSelectionModel>
 #include <QMessageBox>
+#include <QObject>
+#include <QPushButton>
+#include <QWidget>
+#include <Qt>
+#include <fcitx-utils/fs.h>
+#include <fcitx-utils/i18n.h>
+#include <fcitx-utils/standardpaths.h>
+#include <fcitxqtconfiguiwidget.h>
+#include <memory>
 
-#include "dialog.h"
-#include "editor.h"
-#include "mactab.h"
-#include "model.h"
-#include "ui_editor.h"
-#include <fcitx-utils/standardpath.h>
-
-namespace fcitx {
-namespace unikey {
+namespace fcitx::unikey {
 
 MacroEditor::MacroEditor(QWidget *parent)
     : FcitxQtConfigUIWidget(parent), table_(std::make_unique<CMacroTable>()),
@@ -78,9 +88,9 @@
     char value[MAX_MACRO_TEXT_LEN * 3];
     do {
         if (i < table->getCount()) {
-            const StdVnChar *p = NULL;
+            const StdVnChar *p = nullptr;
             int maxOutLen = 0;
-            const char *result = NULL;
+            const char *result = nullptr;
             if (iskey) {
                 p = table->getKey(i);
                 maxOutLen = sizeof(key);
@@ -91,14 +101,16 @@
                 result = value;
             }
 
-            if (!p)
+            if (!p) {
                 break;
+            }
             int inLen = -1;
             int ret =
                 VnConvert(CONV_CHARSET_VNSTANDARD, CONV_CHARSET_XUTF8,
                           (UKBYTE *)p, (UKBYTE *)result, &inLen, &maxOutLen);
-            if (ret != 0)
+            if (ret != 0) {
                 break;
+            }
             return QString::fromUtf8(result);
         }
     } while (0);
@@ -113,20 +125,20 @@
 }
 
 void MacroEditor::load() {
-    auto path = StandardPath::global().locate(StandardPath::Type::PkgConfig,
-                                              "unikey/macro");
-    table_->loadFromFile(path.data());
+    auto path = StandardPaths::global().locate(StandardPathsType::PkgConfig,
+                                               "unikey/macro");
+    table_->loadFromFile(path.string().c_str());
     model_->load(table_.get());
 }
 
 void MacroEditor::save() {
     model_->save(table_.get());
-    StandardPath::global().safeSave(StandardPath::Type::PkgConfig,
-                                    "unikey/macro", [this](int fd) -> bool {
-                                        UnixFD unixFD(fd);
-                                        auto f = fs::openFD(unixFD, "wb");
-                                        return table_->writeToFp(f.release());
-                                    });
+    StandardPaths::global().safeSave(StandardPathsType::PkgConfig,
+                                     "unikey/macro", [this](int fd) -> bool {
+                                         UnixFD unixFD(fd);
+                                         auto f = fs::openFD(unixFD, "wb");
+                                         return table_->writeToFp(f.release());
+                                     });
 }
 
 void MacroEditor::importMacro() {
@@ -169,6 +181,4 @@
     table_->writeToFile(file.toUtf8().constData());
 }
 
-} // namespace unikey
-
-} // namespace fcitx
+} // namespace fcitx::unikey
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/macro-editor/model.cpp 
new/fcitx5-unikey-5.1.7/macro-editor/model.cpp
--- old/fcitx5-unikey-5.1.6/macro-editor/model.cpp      2025-01-23 
00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/macro-editor/model.cpp      2025-06-16 
08:26:18.000000000 +0200
@@ -13,7 +13,7 @@
 namespace fcitx {
 namespace unikey {
 
-typedef QPair<QString, QString> ItemType;
+typedef std::pair<QString, QString> ItemType;
 
 MacroModel::MacroModel(QObject *parent)
     : QAbstractTableModel(parent), needSave_(false) {}
@@ -52,7 +52,7 @@
     if (keyset_.contains(macro))
         return;
     beginInsertRows(QModelIndex(), list_.size(), list_.size());
-    list_.append(QPair<QString, QString>(macro, word));
+    list_.append(std::pair<QString, QString>(macro, word));
     keyset_.insert(macro);
     endInsertRows();
     setNeedSave(true);
@@ -61,7 +61,7 @@
 void MacroModel::deleteItem(int row) {
     if (row >= list_.count())
         return;
-    QPair<QString, QString> item = list_.at(row);
+    std::pair<QString, QString> item = list_.at(row);
     QString key = item.first;
     beginRemoveRows(QModelIndex(), row, row);
     list_.removeAt(row);
@@ -95,7 +95,7 @@
     for (int i = 0; i < table->getCount(); i++) {
         QString key = MacroEditor::getData(table, i, true);
         QString value = MacroEditor::getData(table, i, false);
-        list_.append(QPair<QString, QString>(key, value));
+        list_.append(std::pair<QString, QString>(key, value));
         keyset_.insert(key);
     }
     endResetModel();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/macro-editor/model.h 
new/fcitx5-unikey-5.1.7/macro-editor/model.h
--- old/fcitx5-unikey-5.1.6/macro-editor/model.h        2025-01-23 
00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/macro-editor/model.h        2025-06-16 
08:26:18.000000000 +0200
@@ -39,7 +39,7 @@
     void setNeedSave(bool needSave);
     bool needSave_;
     QSet<QString> keyset_;
-    QList<QPair<QString, QString>> list_;
+    QList<std::pair<QString, QString>> list_;
 };
 } // namespace unikey
 } // namespace fcitx
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/fcitx5-unikey-5.1.6/org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in 
new/fcitx5-unikey-5.1.7/org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in
--- old/fcitx5-unikey-5.1.6/org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in       
2025-01-23 00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in       
2025-06-16 08:26:18.000000000 +0200
@@ -14,6 +14,7 @@
   <url type="vcs-browser">https://github.com/fcitx/fcitx5-unikey</url>
   <project_group>Fcitx</project_group>
   <releases>
+    <release version="5.1.7" date="2025-06-15"/>
     <release version="5.1.6" date="2025-01-22"/>
     <release version="5.1.5" date="2024-10-08"/>
     <release version="5.1.4" date="2024-04-22"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/po/vi.po 
new/fcitx5-unikey-5.1.7/po/vi.po
--- old/fcitx5-unikey-5.1.6/po/vi.po    2025-01-23 00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/po/vi.po    2025-06-16 08:26:18.000000000 +0200
@@ -4,17 +4,18 @@
 #
 # Translators:
 # csslayer <[email protected]>, 2018
-# Zen Fas, 2022
+# zenfas, 2022
 # trmdi, 2023
+# Huy Võ <[email protected]>, 2025
 #
 msgid ""
 msgstr ""
 "Project-Id-Version: fcitx5-unikey\n"
 "Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2023-01-05 20:25+0000\n"
+"POT-Creation-Date: 2025-03-12 20:24+0000\n"
 "PO-Revision-Date: 2018-06-12 22:55+0000\n"
-"Last-Translator: trmdi, 2023\n"
-"Language-Team: Vietnamese (https://www.transifex.com/fcitx/teams/12005/vi/)\n"
+"Last-Translator: Huy Võ <[email protected]>, 2025\n"
+"Language-Team: Vietnamese (https://app.transifex.com/fcitx/teams/12005/vi/)\n"
 "Language: vi\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -84,19 +85,19 @@
 msgid "Action:"
 msgstr "Hành động:"
 
-#: src/unikey-config.h:60
+#: src/unikey-config.h:61
 msgid "Allow to modify surrounding text (experimental)"
 msgstr "Cho phép sửa từ đã gõ (thử nghiệm)"
 
-#: src/unikey-config.h:54
+#: src/unikey-config.h:55
 msgid "Allow type with more freedom"
 msgstr "Cho phép gõ tự do"
 
-#: src/unikey-config.h:49
+#: src/unikey-config.h:50
 msgid "Auto restore keys with invalid words"
 msgstr "Tự động khôi phục phím với từ sai"
 
-#: src/unikey-config.h:29
+#: src/unikey-config.h:30
 msgid "BK HCM 2"
 msgstr "BK HCM 2"
 
@@ -111,7 +112,7 @@
 msgid "Built-in Input Methods"
 msgstr "Các kiểu gõ tích hợp"
 
-#: src/unikey-config.h:30
+#: src/unikey-config.h:31
 msgid "CString"
 msgstr "CString"
 
@@ -166,11 +167,11 @@
 msgid "E with circumflex [E^]"
 msgstr "Chữ [Ê]"
 
-#: src/unikey-config.h:45
+#: src/unikey-config.h:46
 msgid "Enable Macro"
 msgstr "Bật gõ tắt"
 
-#: src/unikey-config.h:44
+#: src/unikey-config.h:45
 msgid "Enable spell check"
 msgstr "Bật kiểm tra chính tả"
 
@@ -198,16 +199,16 @@
 msgid "Horn: U, O become U+, O+"
 msgstr "Dấu móc: U, O thành Ư, Ơ"
 
-#: src/unikey-config.h:41 src/unikey-im.cpp:331
+#: src/unikey-config.h:42 src/unikey-im.cpp:364
 msgid "Input Method"
-msgstr "Kiểu gõ"
+msgstr "Phương Thức Nhập"
 
 #. i18n: file: keymap-editor/editor.ui:30
 #. i18n: ectx: property (text), widget (QLabel, label)
 #: rc.cpp:9
 #, kde-format
 msgid "Input Method:"
-msgstr "Kiểu gõ:"
+msgstr "Phương Thức Nhập:"
 
 #. i18n: file: keymap-editor/editor.ui:101
 #. i18n: ectx: property (text), widget (QLabel, label_2)
@@ -223,27 +224,27 @@
 msgid "Key definition"
 msgstr "Định nghĩa phím"
 
-#: keymap-editor/model.cpp:32
+#: keymap-editor/model.cpp:33
 msgid "Keymap"
 msgstr "Phím"
 
-#: src/unikey-config.h:66
+#: src/unikey-config.h:67
 msgid "Keymap Editor"
 msgstr "Biên tập bàn phím"
 
-#: macro-editor/model.cpp:27 src/unikey-im.cpp:394
+#: macro-editor/model.cpp:27 src/unikey-im.cpp:427
 msgid "Macro"
 msgstr "Gõ tắt"
 
-#: src/unikey-im.cpp:645
+#: src/unikey-im.cpp:687
 msgid "Macro Disabled"
 msgstr "Tắt gõ tắt"
 
-#: src/unikey-config.h:64
+#: src/unikey-config.h:65
 msgid "Macro Editor"
 msgstr "Bảng gõ tắt"
 
-#: src/unikey-im.cpp:644
+#: src/unikey-im.cpp:686
 msgid "Macro Enabled"
 msgstr "Cho phép gõ tắt"
 
@@ -254,7 +255,7 @@
 msgid "Macro:"
 msgstr "Gõ tắt:"
 
-#: keymap-editor/editor.cpp:53 src/unikey-config.h:34
+#: keymap-editor/editor.cpp:53 src/unikey-config.h:35
 msgid "Microsoft Vietnamese"
 msgstr "Microsoft Vietnamese"
 
@@ -272,11 +273,11 @@
 msgid "Move &Up"
 msgstr "&Lên"
 
-#: src/unikey-config.h:30
+#: src/unikey-config.h:31
 msgid "NCR Decimal"
 msgstr "NCR Decimal"
 
-#: src/unikey-config.h:31
+#: src/unikey-config.h:32
 msgid "NCR Hex"
 msgstr "NCR Hex"
 
@@ -288,15 +289,15 @@
 msgid "O with horn [O+]"
 msgstr "Chữ [Ơ]"
 
-#: src/unikey-config.h:43
+#: src/unikey-config.h:44
 msgid "Output Charset"
 msgstr "Bảng Mã"
 
-#: src/unikey-im.cpp:357
+#: src/unikey-im.cpp:390
 msgid "Output charset"
 msgstr "Bảng mã"
 
-#: src/unikey-config.h:47
+#: src/unikey-config.h:48
 msgid "Process W at word begin"
 msgstr "Xử lý ký tự bắt đầu là W"
 
@@ -304,27 +305,27 @@
 msgid "Remove existing tone"
 msgstr "Xóa dấu đang có"
 
-#: src/unikey-config.h:57
+#: src/unikey-config.h:58
 msgid "Restore typing state from surrounding text"
 msgstr "Phục hồi trạng thái gõ phím bằng surrounding "
 
-#: keymap-editor/editor.cpp:54 src/unikey-config.h:35
+#: keymap-editor/editor.cpp:54 src/unikey-config.h:36
 msgid "Simple Telex"
 msgstr "Simple Telex"
 
-#: keymap-editor/editor.cpp:55 src/unikey-config.h:36
+#: keymap-editor/editor.cpp:55 src/unikey-config.h:37
 msgid "Simple Telex2"
 msgstr "Simple Telex2"
 
-#: src/unikey-im.cpp:653
+#: src/unikey-im.cpp:695
 msgid "Spell Check Disabled"
 msgstr "Tắt kiểm tra chính tả"
 
-#: src/unikey-im.cpp:652
+#: src/unikey-im.cpp:694
 msgid "Spell Check Enabled"
 msgstr "Bật kiểm tra chính tả"
 
-#: src/unikey-im.cpp:382
+#: src/unikey-im.cpp:415
 msgid "Spell check"
 msgstr "Kiểm tra chính tả"
 
@@ -332,11 +333,11 @@
 msgid "Stroke: D becomes -D"
 msgstr "Dấu gạch: D thành Đ"
 
-#: src/unikey-config.h:28
+#: src/unikey-config.h:29
 msgid "TCVN3"
 msgstr "TCVN3"
 
-#: keymap-editor/editor.cpp:50 src/unikey-config.h:33
+#: keymap-editor/editor.cpp:50 src/unikey-config.h:34
 msgid "Telex"
 msgstr "Telex"
 
@@ -368,15 +369,15 @@
 msgid "U with horn [U+]"
 msgstr "Chữ [Ư]"
 
-#: src/unikey-config.h:62
+#: src/unikey-config.h:63
 msgid "Underline the preedit text"
 msgstr "Gạch chân từ đang viết"
 
-#: src/unikey-config.h:28
+#: src/unikey-config.h:29
 msgid "Unicode"
 msgstr "Unicode"
 
-#: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:7 src/unikey.conf.in:3
+#: org.fcitx.Fcitx5.Addon.Unikey.metainfo.xml.in:7 src/unikey.conf.in:2
 msgid "Unikey"
 msgstr "Unikey"
 
@@ -394,27 +395,27 @@
 msgid "Unikey Macro Editor"
 msgstr "Bảng gõ tắt Unikey"
 
-#: src/unikey-addon.conf.in.in:3
+#: src/unikey-addon.conf.in.in:2
 msgid "Unikey Wrapper For Fcitx"
 msgstr "Bộ gõ Unikey dành cho Fcitx"
 
-#: src/unikey-config.h:52
+#: src/unikey-config.h:53
 msgid "Use oà, _uý (instead of òa, úy)"
 msgstr "Đặt dấu kiểu oà, _uý (thay vì òa, úy)"
 
-#: src/unikey-config.h:35
+#: src/unikey-config.h:36
 msgid "UserIM"
 msgstr "Tự định nghĩa"
 
-#: keymap-editor/editor.cpp:52 src/unikey-config.h:29 src/unikey-config.h:34
+#: keymap-editor/editor.cpp:52 src/unikey-config.h:30 src/unikey-config.h:35
 msgid "VIQR"
 msgstr "VIQR"
 
-#: keymap-editor/editor.cpp:51 src/unikey-config.h:33
+#: keymap-editor/editor.cpp:51 src/unikey-config.h:34
 msgid "VNI"
 msgstr "VNI"
 
-#: src/unikey-config.h:29
+#: src/unikey-config.h:30
 msgid "VNI Win"
 msgstr "VNI Win"
 
@@ -426,7 +427,7 @@
 msgid "Vietnamese input method"
 msgstr "Kiểu gõ tiếng Việt"
 
-#: keymap-editor/model.cpp:34 macro-editor/model.cpp:29
+#: keymap-editor/model.cpp:35 macro-editor/model.cpp:29
 msgid "Word"
 msgstr "Từ"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/src/unikey-im.cpp 
new/fcitx5-unikey-5.1.7/src/unikey-im.cpp
--- old/fcitx5-unikey-5.1.6/src/unikey-im.cpp   2025-01-23 00:27:44.000000000 
+0100
+++ new/fcitx5-unikey-5.1.7/src/unikey-im.cpp   2025-06-16 08:26:18.000000000 
+0200
@@ -6,10 +6,14 @@
  */
 
 #include "unikey-im.h"
+#include "charset.h"
+#include "inputproc.h"
+#include "keycons.h"
 #include "unikey-config.h"
 #include "unikeyinputcontext.h"
 #include "usrkeymap.h"
 #include "vnconv.h"
+#include "vnlexi.h"
 #include <cassert>
 #include <cstddef>
 #include <cstdint>
@@ -24,7 +28,7 @@
 #include <fcitx-utils/log.h>
 #include <fcitx-utils/macros.h>
 #include <fcitx-utils/misc.h>
-#include <fcitx-utils/standardpath.h>
+#include <fcitx-utils/standardpaths.h>
 #include <fcitx-utils/textformatflags.h>
 #include <fcitx-utils/utf8.h>
 #include <fcitx/action.h>
@@ -66,7 +70,7 @@
 constexpr unsigned int NUM_OUTPUTCHARSET = FCITX_ARRAY_SIZE(Unikey_OC);
 static_assert(NUM_OUTPUTCHARSET == UkConvI18NAnnotation::enumLength);
 
-bool isWordBreakSym(unsigned char c) { return WordBreakSyms.count(c); }
+bool isWordBreakSym(unsigned char c) { return WordBreakSyms.contains(c); }
 
 bool isWordAutoCommit(unsigned char c) {
     static const std::unordered_set<unsigned char> WordAutoCommit = {
@@ -74,7 +78,7 @@
         'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's',
         't', 'v', 'x', 'z', 'B', 'C', 'F', 'G', 'H', 'J', 'K', 'L',
         'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'X', 'Z'};
-    return WordAutoCommit.count(c);
+    return WordAutoCommit.contains(c);
 }
 
 VnLexiName charToVnLexi(uint32_t ch) {
@@ -665,12 +669,10 @@
 
 void UnikeyEngine::reloadKeymap() {
     // Keymap need to be reloaded before populateConfig.
-    auto keymapFile = StandardPath::global().open(
-        StandardPath::Type::PkgConfig, "unikey/keymap.txt", O_RDONLY);
+    auto keymapFile = 
StandardPaths::global().open(StandardPathsType::PkgConfig,
+                                                   "unikey/keymap.txt");
     if (keymapFile.isValid()) {
-        UniqueFilePtr fp = fs::openFD(keymapFile, "rb");
-
-        UkLoadKeyMap(fp.get(), im_.sharedMem()->usrKeyMap);
+        UkLoadKeyMap(keymapFile.fd(), im_.sharedMem()->usrKeyMap);
         im_.sharedMem()->usrKeyMapLoaded = true;
     } else {
         im_.sharedMem()->usrKeyMapLoaded = false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/src/unikey-im.h 
new/fcitx5-unikey-5.1.7/src/unikey-im.h
--- old/fcitx5-unikey-5.1.6/src/unikey-im.h     2025-01-23 00:27:44.000000000 
+0100
+++ new/fcitx5-unikey-5.1.7/src/unikey-im.h     2025-06-16 08:26:18.000000000 
+0200
@@ -13,7 +13,7 @@
 #include <fcitx-utils/handlertable.h>
 #include <fcitx-utils/i18n.h>
 #include <fcitx-utils/signals.h>
-#include <fcitx-utils/standardpath.h>
+#include <fcitx-utils/standardpaths.h>
 #include <fcitx/action.h>
 #include <fcitx/addonfactory.h>
 #include <fcitx/addoninstance.h>
@@ -45,7 +45,7 @@
     }
 
     void setSubConfig(const std::string &path,
-                      const fcitx::RawConfig &) override {
+                      const fcitx::RawConfig & /*unused*/) override {
         if (path == "macro") {
             reloadMacroTable();
         } else if (path == "keymap.txt") {
@@ -61,7 +61,7 @@
     void reloadConfig() override;
     void reset(const InputMethodEntry &entry,
                InputContextEvent &event) override;
-    void deactivate(const fcitx::InputMethodEntry &,
+    void deactivate(const fcitx::InputMethodEntry & /*entry*/,
                     fcitx::InputContextEvent &event) override;
     void save() override;
     auto &factory() { return factory_; }
@@ -73,18 +73,19 @@
     void updateCharsetAction(InputContext *ic);
     void updateInputMethodAction(InputContext *ic);
 
-    std::string subMode(const InputMethodEntry &, InputContext &) override;
+    std::string subMode(const InputMethodEntry & /*entry*/,
+                        InputContext & /*inputContext*/) override;
 
     UnikeyInputMethod *im() { return &im_; }
 
 private:
     void populateConfig();
     void reloadMacroTable() {
-        auto path = 
StandardPath::global().locate(StandardPath::Type::PkgConfig,
-                                                  "unikey/macro");
+        auto path = 
StandardPaths::global().locate(StandardPathsType::PkgConfig,
+                                                   "unikey/macro");
 
         if (!path.empty()) {
-            im_.loadMacroTable(path.data());
+            im_.loadMacroTable(path.string().c_str());
         }
     }
     void reloadKeymap();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/test/CMakeLists.txt 
new/fcitx5-unikey-5.1.7/test/CMakeLists.txt
--- old/fcitx5-unikey-5.1.6/test/CMakeLists.txt 2025-01-23 00:27:44.000000000 
+0100
+++ new/fcitx5-unikey-5.1.7/test/CMakeLists.txt 2025-06-16 08:26:18.000000000 
+0200
@@ -8,4 +8,4 @@
 add_executable(testunikey testunikey.cpp)
 target_link_libraries(testunikey Fcitx5::Core Fcitx5::Module::TestFrontend)
 add_dependencies(testunikey unikey copy-addon copy-im)
-add_test(testunikey testunikey)
+add_test(NAME testunikey COMMAND testunikey)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/test/testunikey.cpp 
new/fcitx5-unikey-5.1.7/test/testunikey.cpp
--- old/fcitx5-unikey-5.1.6/test/testunikey.cpp 2025-01-23 00:27:44.000000000 
+0100
+++ new/fcitx5-unikey-5.1.7/test/testunikey.cpp 2025-06-16 08:26:18.000000000 
+0200
@@ -6,14 +6,21 @@
  */
 #include "testdir.h"
 #include "testfrontend_public.h"
+#include <fcitx-config/rawconfig.h>
+#include <fcitx-utils/capabilityflags.h>
 #include <fcitx-utils/eventdispatcher.h>
+#include <fcitx-utils/key.h>
+#include <fcitx-utils/keysym.h>
 #include <fcitx-utils/log.h>
-#include <fcitx-utils/standardpath.h>
+#include <fcitx-utils/macros.h>
+#include <fcitx-utils/standardpaths.h>
 #include <fcitx-utils/testing.h>
 #include <fcitx/addonmanager.h>
+#include <fcitx/inputmethodgroup.h>
 #include <fcitx/inputmethodmanager.h>
 #include <fcitx/instance.h>
-#include <iostream>
+#include <map>
+#include <string>
 
 using namespace fcitx;
 
@@ -1756,7 +1763,7 @@
         auto *testfrontend = instance->addonManager().addon("testfrontend");
         auto uuid =
             testfrontend->call<ITestFrontend::createInputContext>("testapp");
-        auto ic = instance->inputContextManager().findByUUID(uuid);
+        auto *ic = instance->inputContextManager().findByUUID(uuid);
         ic->setCapabilityFlags(CapabilityFlag::SurroundingText);
         testfrontend->call<ITestFrontend::pushCommitExpectation>("ăo ");
         testfrontend->call<ITestFrontend::pushCommitExpectation>("âo ");
@@ -1916,8 +1923,8 @@
 void runInstance() {}
 
 int main() {
-    setupTestingEnvironment(TESTING_BINARY_DIR, {TESTING_BINARY_DIR "/src"},
-                            {TESTING_BINARY_DIR "/test"});
+    setupTestingEnvironmentPath(TESTING_BINARY_DIR, {"bin"},
+                                {TESTING_BINARY_DIR "/test"});
     // fcitx::Log::setLogRule("default=5,table=5,libime-table=5");
     char arg0[] = "testunikey";
     char arg1[] = "--disable=all";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/unikey/usrkeymap.cpp 
new/fcitx5-unikey-5.1.7/unikey/usrkeymap.cpp
--- old/fcitx5-unikey-5.1.6/unikey/usrkeymap.cpp        2025-01-23 
00:27:44.000000000 +0100
+++ new/fcitx5-unikey-5.1.7/unikey/usrkeymap.cpp        2025-06-16 
08:26:18.000000000 +0200
@@ -8,9 +8,13 @@
 #include <cstdint>
 #include <cstdio>
 #include <cstring>
+#include <fcitx-utils/fdstreambuf.h>
 #include <fcitx-utils/log.h>
 #include <fcitx-utils/misc.h>
 #include <fcitx-utils/stringutils.h>
+#include <istream>
+#include <string>
+#include <vector>
 
 namespace {
 
@@ -93,8 +97,8 @@
 }
 
 //-----------------------------------------------------
-DllExport void UkLoadKeyMap(FILE *f, int keyMap[256]) {
-    std::vector<UkKeyMapping> orderMap = UkLoadKeyOrderMap(f);
+DllExport void UkLoadKeyMap(int fd, int keyMap[256]) {
+    std::vector<UkKeyMapping> orderMap = UkLoadKeyOrderMap(fd);
     initKeyMap(keyMap);
     for (const auto &item : orderMap) {
         keyMap[item.key] = item.action;
@@ -105,18 +109,19 @@
 }
 
 //------------------------------------------------------------------
-DllExport std::vector<UkKeyMapping> UkLoadKeyOrderMap(FILE *f) {
+DllExport std::vector<UkKeyMapping> UkLoadKeyOrderMap(int fd) {
     size_t lineCount = 0;
     int keyMap[256];
 
     initKeyMap(keyMap);
 
     std::vector<UkKeyMapping> pMap;
-    fcitx::UniqueCPtr<char> clineBuf;
-    size_t bufSize = 0;
-    while (getline(clineBuf, &bufSize, f) >= 0) {
+    fcitx::IFDStreamBuf buf(fd);
+    std::istream in(&buf);
+    std::string line;
+    while (std::getline(in, line)) {
         lineCount++;
-        auto text = fcitx::stringutils::trimView(clineBuf.get());
+        auto text = fcitx::stringutils::trimView(line);
         if (text.empty()) {
             continue;
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fcitx5-unikey-5.1.6/unikey/usrkeymap.h 
new/fcitx5-unikey-5.1.7/unikey/usrkeymap.h
--- old/fcitx5-unikey-5.1.6/unikey/usrkeymap.h  2025-01-23 00:27:44.000000000 
+0100
+++ new/fcitx5-unikey-5.1.7/unikey/usrkeymap.h  2025-06-16 08:26:18.000000000 
+0200
@@ -11,8 +11,8 @@
 #include <cstdio>
 #include <vector>
 
-DllInterface void UkLoadKeyMap(FILE *f, int keyMap[256]);
-DllInterface std::vector<UkKeyMapping> UkLoadKeyOrderMap(FILE *f);
+DllInterface void UkLoadKeyMap(int fd, int keyMap[256]);
+DllInterface std::vector<UkKeyMapping> UkLoadKeyOrderMap(int fd);
 DllInterface void UkStoreKeyOrderMap(FILE *f,
                                      const std::vector<UkKeyMapping> &pMap);
 

Reply via email to