feat: implement get_icon

This commit is contained in:
2026-09-29 13:42:57 +02:00
parent e2e13a6b4f
commit 2bdae38b0d

View File

@@ -51,8 +51,18 @@ pub fn is_initted() -> bool {
// Gets the application icon registered.
// Available since: 0.8.4
pub fn get_app_icon() -> String {
todo!();
pub fn get_app_icon() -> Option<String> {
let app_icon_c: *const std::os::raw::c_char = unsafe { notify_get_app_icon() };
if app_icon_c.is_null() {
return None;
} else {
Some(
unsafe { std::ffi::CStr::from_ptr(app_icon_c) }
.to_string_lossy()
.to_string(),
)
}
}
/// Queries the server capabilities.