Skip to content

Commit 84a8529

Browse files
committed
Port to StandardPaths
1 parent 329e62d commit 84a8529

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ if (NOT DEFINED M17N_TARGET)
2525
set(M17N_TARGET PkgConfig::M17NGui)
2626
endif()
2727

28+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
29+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
30+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
31+
2832
include("${FCITX_INSTALL_CMAKECONFIG_DIR}/Fcitx5Utils/Fcitx5CompilerSettings.cmake")
2933
add_definitions(-DFCITX_GETTEXT_DOMAIN=\"fcitx5-m17n\" -D_GNU_SOURCE)
3034
fcitx5_add_i18n_definition()

im/engine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <fcitx-utils/key.h>
1919
#include <fcitx-utils/keysym.h>
2020
#include <fcitx-utils/log.h>
21-
#include <fcitx-utils/standardpath.h>
21+
#include <fcitx-utils/standardpaths.h>
2222
#include <fcitx-utils/stringutils.h>
2323
#include <fcitx-utils/textformatflags.h>
2424
#include <fcitx-utils/utf8.h>
@@ -295,8 +295,8 @@ M17NEngine::M17NEngine(Instance *instance)
295295
reloadConfig();
296296
M17N_INIT();
297297

298-
auto file = StandardPath::global().open(StandardPath::Type::PkgData,
299-
"m17n/default", O_RDONLY);
298+
auto file = StandardPaths::global().open(StandardPathsType::PkgData,
299+
"m17n/default");
300300
if (file.isValid()) {
301301
list_ = ParseDefaultSettings(file.fd());
302302
}

test/testm17n.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <fcitx-utils/keysym.h>
1212
#include <fcitx-utils/log.h>
1313
#include <fcitx-utils/macros.h>
14-
#include <fcitx-utils/standardpath.h>
1514
#include <fcitx-utils/testing.h>
1615
#include <fcitx/addonmanager.h>
1716
#include <fcitx/inputcontextmanager.h>
@@ -75,7 +74,7 @@ void scheduleEvent(Instance *instance) {
7574
void runInstance() {}
7675

7776
int main() {
78-
setupTestingEnvironment(TESTING_BINARY_DIR, {TESTING_BINARY_DIR "/im"},
77+
setupTestingEnvironment(TESTING_BINARY_DIR, {"bin"},
7978
{TESTING_BINARY_DIR "/test"});
8079
// fcitx::Log::setLogRule("default=5,table=5,libime-table=5");
8180
char arg0[] = "testm17n";

0 commit comments

Comments
 (0)