Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
container: archlinux:latest
env:
XDG_DATA_DIRS: /opt/fcitx/share # for test
FCITX_DATA_DIRS: /opt/fcitx/share/fcitx5/testing/addon:/opt/fcitx/share/fcitx5/testing
steps:
- name: Install dependencies
run: pacman -Syu --noconfirm base-devel clang cmake ninja extra-cmake-modules fmt libuv marisa
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.6.0)

project(fcitx5-hallelujah VERSION 5.0.2)
project(fcitx5-hallelujah VERSION 5.0.3)

find_package(ECM 1.0.0 REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
Expand All @@ -12,7 +12,7 @@ option(ENABLE_TEST "Build Test" On)
option(BUILD_DATA "Build data" On)

find_package(Gettext REQUIRED)
find_package(Fcitx5Core 5.1.12 REQUIRED)
find_package(Fcitx5Core 5.1.13 REQUIRED)
find_package(Fcitx5Module REQUIRED COMPONENTS Spell TestFrontend)
find_package(PkgConfig REQUIRED)

Expand Down
14 changes: 7 additions & 7 deletions src/hallelujah.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "hallelujah.h"
#include <algorithm>
#include <cctype>
#include <fcitx-utils/standardpath.h>
#include <fcitx-utils/standardpaths.h>
#include <fcitx/candidatelist.h>
#include <fcitx/inputpanel.h>
#include <fmt/format.h>
Expand Down Expand Up @@ -286,8 +286,8 @@ void HallelujahEngine::reset(const InputMethodEntry &,
}

void HallelujahEngine::loadTrie() {
const auto &sp = fcitx::StandardPath::global();
std::string trie_path = sp.locate(fcitx::StandardPath::Type::Data,
const auto &sp = fcitx::StandardPaths::global();
std::string trie_path = sp.locate(fcitx::StandardPathsType::Data,
"hallelujah/google_227800_words.bin");
if (trie_path.empty()) {
throw std::runtime_error("Failed to load google_227800_words.bin");
Expand All @@ -296,9 +296,9 @@ void HallelujahEngine::loadTrie() {
}

void HallelujahEngine::loadWords() {
const auto &sp = fcitx::StandardPath::global();
const auto &sp = fcitx::StandardPaths::global();
std::string words_path =
sp.locate(fcitx::StandardPath::Type::Data, "hallelujah/words.json");
sp.locate(fcitx::StandardPathsType::Data, "hallelujah/words.json");
if (words_path.empty()) {
throw std::runtime_error("Failed to load words.json");
}
Expand Down Expand Up @@ -335,9 +335,9 @@ void HallelujahEngine::loadWords() {
}

void HallelujahEngine::loadPinyin() {
const auto &sp = fcitx::StandardPath::global();
const auto &sp = fcitx::StandardPaths::global();
std::string pinyin_path =
sp.locate(fcitx::StandardPath::Type::Data, "hallelujah/cedict.json");
sp.locate(fcitx::StandardPathsType::Data, "hallelujah/cedict.json");
if (pinyin_path.empty()) {
throw std::runtime_error("Failed to load cedict.json");
}
Expand Down
7 changes: 0 additions & 7 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
configure_file(testdir.h.in ${CMAKE_CURRENT_BINARY_DIR}/testdir.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

add_subdirectory(addon)
add_subdirectory(inputmethod)

add_executable(testhallelujah testhallelujah.cpp)
target_link_libraries(testhallelujah Fcitx5::Core Fcitx5::Module::TestFrontend)
add_dependencies(testhallelujah hallelujah copy-addon copy-im)
add_test(NAME testhallelujah COMMAND testhallelujah)
2 changes: 0 additions & 2 deletions test/addon/CMakeLists.txt

This file was deleted.

2 changes: 0 additions & 2 deletions test/inputmethod/CMakeLists.txt

This file was deleted.

6 changes: 0 additions & 6 deletions test/testdir.h.in

This file was deleted.

6 changes: 0 additions & 6 deletions test/testhallelujah.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include "testdir.h"
#include "testfrontend_public.h"
#include <fcitx-utils/eventdispatcher.h>
#include <fcitx-utils/log.h>
#include <fcitx-utils/standardpath.h>
#include <fcitx-utils/testing.h>
#include <fcitx/addonmanager.h>
#include <fcitx/inputmethodmanager.h>
#include <fcitx/instance.h>
Expand Down Expand Up @@ -62,9 +59,6 @@ void scheduleEvent(EventDispatcher *dispatcher, Instance *instance) {
}

int main() {
setupTestingEnvironment(
TESTING_BINARY_DIR, {TESTING_BINARY_DIR "/src"},
{TESTING_BINARY_DIR "/test", StandardPath::fcitxPath("pkgdatadir")});
char arg0[] = "testhallelujah";
char arg1[] = "--disable=all";
char arg2[] = "--enable=testim,testfrontend,spell,hallelujah";
Expand Down