Skip to content

Commit 9358efc

Browse files
authored
use namespace to avoid config collision with chinese-addons (#12)
1 parent 9123b40 commit 9358efc

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/factory.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#include "factory.h"
22
#include "hallelujah.h"
33

4-
namespace fcitx {
4+
namespace fcitx::hallelujah {
55
AddonInstance *HallelujahFactory::create(AddonManager *manager) {
66
return new HallelujahEngine(manager->instance());
77
}
8-
} // namespace fcitx
8+
} // namespace fcitx::hallelujah
99

10-
FCITX_ADDON_FACTORY_V2(hallelujah, fcitx::HallelujahFactory)
10+
FCITX_ADDON_FACTORY_V2(hallelujah, fcitx::hallelujah::HallelujahFactory)

src/factory.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
#include <fcitx/addonfactory.h>
55

6-
namespace fcitx {
6+
namespace fcitx::hallelujah {
77
class HallelujahFactory : public AddonFactory {
88
public:
99
AddonInstance *create(AddonManager *manager) override;
1010
};
11-
} // namespace fcitx
11+
} // namespace fcitx::hallelujah
1212
#endif

src/hallelujah.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <json-c/json.h>
1010
#include <spell_public.h>
1111

12-
namespace fcitx {
12+
namespace fcitx::hallelujah {
1313
static const std::array<Key, 10> selectionKeys = {
1414
Key{FcitxKey_1}, Key{FcitxKey_2}, Key{FcitxKey_3}, Key{FcitxKey_4},
1515
Key{FcitxKey_5}, Key{FcitxKey_6}, Key{FcitxKey_7}, Key{FcitxKey_8},
@@ -379,4 +379,4 @@ void HallelujahEngine::setConfig(const RawConfig &config) {
379379
safeSaveAsIni(config_, ConfPath);
380380
reloadConfig();
381381
}
382-
} // namespace fcitx
382+
} // namespace fcitx::hallelujah

src/hallelujah.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <marisa/trie.h>
1313
#include <unordered_map>
1414

15-
namespace fcitx {
15+
namespace fcitx::hallelujah {
1616
enum class PreeditMode { No, ComposingText };
1717

1818
FCITX_CONFIG_ENUM_NAME_WITH_I18N(PreeditMode, N_("Do not show"),
@@ -89,6 +89,6 @@ class HallelujahEngine final : public InputMethodEngine {
8989
std::unordered_map<std::string, std::vector<std::string>> pinyin_;
9090
static const inline std::string ConfPath = "conf/hallelujah.conf";
9191
};
92-
} // namespace fcitx
92+
} // namespace fcitx::hallelujah
9393

9494
#endif

0 commit comments

Comments
 (0)