Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use namespace to avoid config collision with chinese-addons #12

Merged
merged 1 commit into from
Dec 8, 2024
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
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
Loading