Skip to content

Commit 916f46e

Browse files
committed
Put notifications addon's class into its own namespace to avoid symbol collision when linked statically.
1 parent f5f8d6c commit 916f46e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/modules/notifications/notifications.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define NOTIFICATIONS_INTERFACE_NAME "org.freedesktop.Notifications"
1919
#define NOTIFICATIONS_PATH "/org/freedesktop/Notifications"
2020

21-
namespace fcitx {
21+
namespace fcitx::notifications {
2222

2323
Notifications::Notifications(Instance *instance)
2424
: instance_(instance), dbus_(instance_->addonManager().addon("dbus")),
@@ -220,6 +220,7 @@ class NotificationsModuleFactory : public AddonFactory {
220220
return new Notifications(manager->instance());
221221
}
222222
};
223-
} // namespace fcitx
223+
} // namespace fcitx::notifications
224224

225-
FCITX_ADDON_FACTORY_V2(notifications, fcitx::NotificationsModuleFactory)
225+
FCITX_ADDON_FACTORY_V2(notifications,
226+
fcitx::notifications::NotificationsModuleFactory)

src/modules/notifications/notifications.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "fcitx/instance.h"
1919
#include "notifications_public.h"
2020

21-
namespace fcitx {
21+
namespace fcitx::notifications {
2222

2323
FCITX_CONFIGURATION(NotificationsConfig,
2424
fcitx::Option<std::vector<std::string>> hiddenNotifications{
@@ -113,6 +113,7 @@ class Notifications final : public AddonInstance {
113113
std::unordered_map<uint64_t, NotificationItem> items_;
114114
std::unordered_map<uint32_t, uint64_t> globalToInternalId_;
115115
};
116-
} // namespace fcitx
116+
117+
} // namespace fcitx::notifications
117118

118119
#endif // _FCITX_MODULES_NOTIFICATIONS_NOTIFICATIONS_H_

0 commit comments

Comments
 (0)