Skip to content

Commit

Permalink
use namespace to avoid config collision with chinese-addons (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Dec 8, 2024
1 parent 9123b40 commit 9358efc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/factory.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "factory.h"
#include "hallelujah.h"

namespace fcitx {
namespace fcitx::hallelujah {
AddonInstance *HallelujahFactory::create(AddonManager *manager) {
return new HallelujahEngine(manager->instance());
}
} // namespace fcitx
} // namespace fcitx::hallelujah

FCITX_ADDON_FACTORY_V2(hallelujah, fcitx::HallelujahFactory)
FCITX_ADDON_FACTORY_V2(hallelujah, fcitx::hallelujah::HallelujahFactory)
4 changes: 2 additions & 2 deletions src/factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

#include <fcitx/addonfactory.h>

namespace fcitx {
namespace fcitx::hallelujah {
class HallelujahFactory : public AddonFactory {
public:
AddonInstance *create(AddonManager *manager) override;
};
} // namespace fcitx
} // namespace fcitx::hallelujah
#endif
4 changes: 2 additions & 2 deletions src/hallelujah.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <json-c/json.h>
#include <spell_public.h>

namespace fcitx {
namespace fcitx::hallelujah {
static const std::array<Key, 10> selectionKeys = {
Key{FcitxKey_1}, Key{FcitxKey_2}, Key{FcitxKey_3}, Key{FcitxKey_4},
Key{FcitxKey_5}, Key{FcitxKey_6}, Key{FcitxKey_7}, Key{FcitxKey_8},
Expand Down Expand Up @@ -379,4 +379,4 @@ void HallelujahEngine::setConfig(const RawConfig &config) {
safeSaveAsIni(config_, ConfPath);
reloadConfig();
}
} // namespace fcitx
} // namespace fcitx::hallelujah
4 changes: 2 additions & 2 deletions src/hallelujah.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <marisa/trie.h>
#include <unordered_map>

namespace fcitx {
namespace fcitx::hallelujah {
enum class PreeditMode { No, ComposingText };

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

#endif

0 comments on commit 9358efc

Please sign in to comment.