mirror of
https://github.com/szymon-jozef/libnotify-rs.git
synced 2026-10-28 11:10:43 +01:00
feat: implement get_icon
This commit is contained in:
@@ -51,8 +51,18 @@ pub fn is_initted() -> bool {
|
|||||||
|
|
||||||
// Gets the application icon registered.
|
// Gets the application icon registered.
|
||||||
// Available since: 0.8.4
|
// Available since: 0.8.4
|
||||||
pub fn get_app_icon() -> String {
|
pub fn get_app_icon() -> Option<String> {
|
||||||
todo!();
|
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.
|
/// Queries the server capabilities.
|
||||||
|
|||||||
Reference in New Issue
Block a user