Skip to content

Commit 96ed61e

Browse files
committed
Use addon factory v2
1 parent c421d51 commit 96ed61e

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.6)
22

33
project(fcitx5-anthy VERSION 5.1.5)
44

5+
set(REQUIRED_FCITX_VERSION 5.1.12)
56
find_package(ECM 1.0.0 REQUIRED)
67
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
78
include(FeatureSummary)
@@ -11,7 +12,7 @@ include(ECMUninstallTarget)
1112
option(ENABLE_TEST "Build Test" On)
1213
option(ENABLE_COVERAGE "Build the project with gcov support (Need ENABLE_TEST=On)" Off)
1314

14-
find_package(Fcitx5Core 5.1.12 REQUIRED)
15+
find_package(Fcitx5Core ${REQUIRED_FCITX_VERSION} REQUIRED)
1516
find_package(Fcitx5Module REQUIRED COMPONENTS Clipboard TestFrontend)
1617
find_package(Gettext REQUIRED)
1718
find_package(PkgConfig REQUIRED)

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set( fcitx_anthy_sources
2020
nicola.cpp
2121
)
2222

23-
add_library(anthy MODULE ${fcitx_anthy_sources})
23+
add_fcitx5_addon(anthy ${fcitx_anthy_sources})
2424
target_link_libraries(anthy Fcitx5::Core Fcitx5::Config ${ANTHY_TARGET} Fcitx5::Module::Clipboard stylefile)
2525
install(TARGETS anthy DESTINATION "${CMAKE_INSTALL_LIBDIR}/fcitx5")
2626
fcitx5_translate_desktop_file(anthy.conf.in anthy.conf)

src/anthy-addon.conf.in.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ OnDemand=True
88
Configurable=True
99

1010
[Dependencies]
11-
0=core/5.0.6
11+
0=core:@REQUIRED_FCITX_VERSION@

src/engine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,4 +608,4 @@ void AnthyEngine::invokeActionImpl(const fcitx::InputMethodEntry &entry,
608608
anthy->updateUI();
609609
}
610610

611-
FCITX_ADDON_FACTORY(AnthyFactory)
611+
FCITX_ADDON_FACTORY_V2(anthy, AnthyFactory)

test/testanthy.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ void scheduleEvent(EventDispatcher *dispatcher, Instance *instance) {
3030
auto *testfrontend = instance->addonManager().addon("testfrontend");
3131
auto uuid =
3232
testfrontend->call<ITestFrontend::createInputContext>("testapp");
33-
auto ic = instance->inputContextManager().findByUUID(uuid);
33+
auto *ic = instance->inputContextManager().findByUUID(uuid);
34+
FCITX_ASSERT(ic);
3435

3536
RawConfig config;
3637
config.setValueByPath("General/TypingMethod", "Nicola");

0 commit comments

Comments
 (0)